]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Implemented a fix for if the previousTime === currentTime in the timeUpdate function...
authorDavid Seifried <david.c.seifried@gmail.com>
Tue, 6 Sep 2011 18:47:19 +0000 (14:47 -0400)
committerDavid Seifried <david.c.seifried@gmail.com>
Tue, 6 Sep 2011 18:47:19 +0000 (14:47 -0400)
popcorn.js
test/popcorn.unit.js

index 51659a728ad55b8cdf113942933a744e4ea5f5d4..9f6b0913db0b4e57fc2257aaf57ed2b5b3a214fc 100644 (file)
         break;
       }
     }
+    
+    this.timeUpdate( obj, null );
 
     // Store references to user added trackevents in ref table
     if ( track._id ) {
         tracksByStart  = tracks.byStart;
 
     //  Playbar advancing
-    if ( previousTime < currentTime ) {
+    if ( previousTime <= currentTime ) {
 
       while ( tracksByEnd[ tracks.endIndex ] && tracksByEnd[ tracks.endIndex ].end <= currentTime ) {
         //  If plugin does not exist on this instance, remove it
index 605922acebd1636efe4639e226d3c92ba41851ed..1fecb607a23039195b9e10e662da974100582877 100644 (file)
@@ -2538,6 +2538,30 @@ test("getTrackEvent", function () {
 
 });
 
+test("timeUpdate functionality", function() {
+
+  var $pop = Popcorn( "#video" ),
+    count = 0,
+    expects = 5;
+
+  expect( expects );
+
+  function plus() {
+    if ( ++count === expects ) {
+      start();
+
+      Popcorn.removeInstance( $pop );
+    }
+  }
+
+  Popcorn.plugin("timeUpdateTester", function() {
+    return {
+      start: function(){},
+      end: function(){}
+    };
+  });
+});
+
 test("Index Integrity", function () {