]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
[#119] passing all tests
authorScottDowne <sdowne@learn.senecac.on.ca>
Fri, 10 Dec 2010 19:50:49 +0000 (14:50 -0500)
committerScottDowne <sdowne@learn.senecac.on.ca>
Fri, 10 Dec 2010 19:50:49 +0000 (14:50 -0500)
popcorn.js
test/popcorn.unit.js

index 895118f48ca8b229e6ad761c96d28ddbaf5a219b..74931db06cbd655847d14585420f4cd1b6cb301e 100644 (file)
@@ -66,7 +66,7 @@
               while (tracksByEnd[tracks.endIndex].end <= currentTime) {
                 if (tracksByEnd[tracks.endIndex].running === true) {
                   tracksByEnd[tracks.endIndex].running = false;
-                  tracksByEnd[tracks.endIndex].natives.end(event, tracksByEnd[tracks.endIndex]);
+                  tracksByEnd[tracks.endIndex].natives.end.call(that, event, tracksByEnd[tracks.endIndex]);
                 }
                 tracks.endIndex++;
               }
@@ -74,7 +74,7 @@
               while (tracksByStart[tracks.startIndex].start <= currentTime) {
                 if (tracksByStart[tracks.startIndex].end > currentTime && tracksByStart[tracks.startIndex].running === false) {
                   tracksByStart[tracks.startIndex].running = true;
-                  tracksByStart[tracks.startIndex].natives.start(event, tracksByStart[tracks.startIndex]);
+                  tracksByStart[tracks.startIndex].natives.start.call(that, event, tracksByStart[tracks.startIndex]);
                 }
                 tracks.startIndex++;
               }
@@ -85,7 +85,7 @@
               while (tracksByStart[tracks.startIndex].start > currentTime) {
                 if (tracksByStart[tracks.startIndex].running === true) {
                   tracksByStart[tracks.startIndex].running = false;
-                  tracksByStart[tracks.startIndex].natives.end(event, tracksByStart[tracks.startIndex]);
+                  tracksByStart[tracks.startIndex].natives.end.call(that, event, tracksByStart[tracks.startIndex]);
                 }
                 tracks.startIndex--;
               }
@@ -93,7 +93,7 @@
               while (tracksByEnd[tracks.endIndex].end > currentTime) {
                 if (tracksByEnd[tracks.endIndex].start <= currentTime && tracksByEnd[tracks.endIndex].running === false) {
                   tracksByEnd[tracks.endIndex].running = true;
-                  tracksByEnd[tracks.endIndex].natives.start(event, tracksByEnd[tracks.endIndex]);
+                  tracksByEnd[tracks.endIndex].natives.start.call(that, event, tracksByEnd[tracks.endIndex]);
                 }
                 tracks.endIndex--;
               }
             tracks.previousUpdateTime = currentTime;
           }, false);
         } else {
-          setTimeout(function() { isReady(that); }, 1);
+          setTimeout(function() {
+            isReady(that);
+          }, 1);
         }
       };
 
       
       
       return this;
-    },
-
-
-
-    toTrack: function( setup ) {
-      /*
-      {
-        in: ts,
-        out: ts, 
-        command: f()
-      }
-      */
-      // stores the command in a track
     }
-  
   });
 
   Popcorn.Events  = {
index 4cf645f2b904ce6e21e9dfbe4973b76d498655d4..3d1c57ff35a439f005120ddb83138b6e5dcef338 100644 (file)
@@ -410,7 +410,7 @@ test("Plugin Factory", function () {
 
         ok( "tracks" in this.data, "executor instance has `tracks` property" );
         plus();
-        ok( Object.prototype.toString.call(popped.data.tracks) === "[object Array]", "executor tracks property is an array" )      
+        ok( Object.prototype.toString.call(popped.data.tracks) === "[object Object]", "executor tracks property is an object" )      
         plus();      
       }, 
       end: function () {