]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Initial fix
authorrwldrn <waldron.rick@gmail.com>
Wed, 20 Jul 2011 20:15:04 +0000 (16:15 -0400)
committerrwldrn <waldron.rick@gmail.com>
Wed, 20 Jul 2011 20:15:04 +0000 (16:15 -0400)
popcorn.js
test/popcorn.unit.js

index 33c4926140e9321246bbb5f3e4edd0172f8fc81e..803963162062e5bc5611eb8d8cd3f8b5f222f535 100644 (file)
             start: -1,
             end: -1
           }],
-          byEnd:   [{
+          byEnd: [{
             start: -1,
             end: -1
           }],
           startIndex: 0,
-          endIndex:   0,
-          previousUpdateTime: 0
+          endIndex: 0,
+          previousUpdateTime: -1
         }
       };
 
index 15178e45b79e3cf212084d69731c962b073c5523..aca47107c3da602f695bad481771f269dcd9e001 100644 (file)
@@ -1270,6 +1270,37 @@ test("Configurable Defaults", function () {
 
 });
 
+test("Start Zero Immediately", function () {
+
+  var $pop = Popcorn("#video"),
+      expects = 1,
+      count   = 0;
+
+  function plus() {
+    if ( ++count === expects ) {
+      // clean up added events after tests
+      Popcorn.removePlugin("zero");
+      start();
+    }
+  }
+
+  stop();
+
+  $pop.pause().currentTime( 0 );
+
+  Popcorn.plugin( "zero", {
+    start: function() {
+      ok( true, "$pop.zero({ start:0, end: 2 }) ran without play()");
+      plus();
+    },
+    end: function() {}
+  });
+
+  $pop.zero({ 
+    start:0, 
+    end: 2 
+  });
+});
 test("Update Timer", function () {
 
   QUnit.reset();