-// Immediately invoked function expression is used to
-// create a pseudo-private scope for our api definition
-// a reference to the `window` object is passed into the
-// closure and referenced as `global`. This is both
-// beneficial for compressors and provides a fast
-// reference to the window context
(function(global) {
// Cache refs to speed up calls to native utils
definition = function ( options ) {
- var self = this;
+ var self = this,
+ fired = {
+ start: 0,
+ end: 0
+ };
if ( !options ) {
return this;
if ( ~~self.currentTime() === options.start ||
self.currentTime() === options.start ) {
-
- setup.start.call(self, event, options);
+
+ !fired.start && setup.start.call(self, event, options);
+
+ fired.start++;
}
if ( self.currentTime() > options.start &&
if ( ~~self.currentTime() === options.end ||
self.currentTime() === options.end ) {
- setup.end.call(self, event, options);
+ !fired.end && setup.end.call(self, event, options);
+
+ fired.end++;
}
});
-test("Popcorn API", function () {
+
+module("Popcorn");
+test("API", function () {
var expects = 3,
count = 0;
});
-test("Popcorn Utility", function () {
+test("Utility", function () {
+
+ // TODO: comprehensive tests for these utilities
equals( typeof Popcorn.forEach, "function" , "Popcorn.forEach is a provided utility function");
equals( typeof Popcorn.extend, "function" , "Popcorn.extend is a provided utility function");
+ equals( typeof Popcorn.guid, "function" , "Popcorn.guid is a provided utility function");
+ equals( typeof Popcorn.sizeOf, "function" , "Popcorn.sizeOf is a provided utility function");
+ equals( typeof Popcorn.nop, "function" , "Popcorn.nop is a provided utility function");
});
-test("Popcorn Object", function () {
+test("Object", function () {
var popped = Popcorn("#video"),
methods = "load play pause currentTime mute volume";
- //console.log(popped);
+
+
+ console.log(popped);
popped.play();
});
+module("Popcorn Events");
-test("Popcorn Events Stored By Type", function () {
+test("Stored By Type", function () {
QUnit.reset();
});
-test("Popcorn Events Simulated", function () {
+test("Simulated", function () {
QUnit.reset();
});
-test("Popcorn Events Real", function () {
+test("Real", function () {
QUnit.reset();
});
-test("Popcorn Plugin", function () {
+module("Popcorn Plugin")
+test("Plugin API", function () {
QUnit.reset();
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-test("Popcorn Plugin Extended Events", function () {
+test("Events Extended", function () {
//QUnit.reset();