Skip to content
This repository

[#1117] Bug on trackstart and trackend while seeking backwards. #85

Merged
merged 2 commits into from almost 2 years ago

1 participant

ScottDowne
ScottDowne
Collaborator

No description provided.

ScottDowne ScottDowne merged commit 15777df into from June 05, 2012
ScottDowne ScottDowne closed this June 05, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
4  popcorn.js
@@ -1200,7 +1200,7 @@
1200 1200
               natives.end.call( obj, event, byStart );
1201 1201
 
1202 1202
               obj.emit( trackend,
1203  
-                Popcorn.extend({}, byEnd, {
  1203
+                Popcorn.extend({}, byStart, {
1204 1204
                   plugin: type,
1205 1205
                   type: trackend
1206 1206
                 })
@@ -1237,7 +1237,7 @@
1237 1237
               natives.start.call( obj, event, byEnd );
1238 1238
 
1239 1239
               obj.emit( trackstart,
1240  
-                Popcorn.extend({}, byStart, {
  1240
+                Popcorn.extend({}, byEnd, {
1241 1241
                   plugin: type,
1242 1242
                   type: trackstart
1243 1243
                 })
75  test/popcorn.unit.js
@@ -2260,7 +2260,7 @@ test( "Start Zero Immediately", function() {
2260 2260
 test( "Special track event listeners: trackstart, trackend", function() {
2261 2261
 
2262 2262
   var $pop = Popcorn( "#video" ),
2263  
-      expects = 4,
  2263
+      expects = 24,
2264 2264
       count = 0;
2265 2265
 
2266 2266
   expect( expects );
@@ -2285,24 +2285,79 @@ test( "Special track event listeners: trackstart, trackend", function() {
2285 2285
 
2286 2286
   $pop.emitter({
2287 2287
     start: 1,
2288  
-    end: 3
  2288
+    end: 3,
  2289
+    direction: "forward"
  2290
+  }).emitter({
  2291
+    start: 4,
  2292
+    end: 6,
  2293
+    direction: "backward"
2289 2294
   }).on( "trackstart", function( event ) {
2290 2295
 
2291  
-    equal( event.type, "trackstart", "Special trackstart event object includes correct type" );
2292  
-    plus();
  2296
+    if ( event.plugin === "cue" ) {
  2297
+      ok( !event.direction, "trackstart no plugin specific data on cue" );
  2298
+      plus();
2293 2299
 
  2300
+      equal( event._running, true, "cue event is running on trackstart" );
  2301
+      plus();
2294 2302
 
2295  
-    equal( event.plugin, "emitter", "Special trackstart event object includes correct plugin name" );
2296  
-    plus();
  2303
+      equal( event.type, "trackstart", "cue special trackstart event object includes correct type" );
  2304
+      plus();
  2305
+
  2306
+      equal( event.plugin, "cue", "cue special trackstart event object includes correct plugin name" );
  2307
+      plus();
  2308
+    } else if ( event.plugin === "emitter" ) {
  2309
+      ok( event.direction, "a direction exsists with plugin specific data going " + event.direction );
  2310
+      plus();
  2311
+
  2312
+      equal( event._running, true, "event is running on trackstart going " + event.direction );
  2313
+      plus();
  2314
+
  2315
+      equal( event.type, "trackstart", "Special trackstart event object includes correct type going " + event.direction );
  2316
+      plus();
  2317
+
  2318
+      equal( event.plugin, "emitter", "Special trackstart event object includes correct plugin name " + event.direction );
  2319
+      plus();
  2320
+    } else {
  2321
+      ok( false, "invalid plugin fired trackstart" );
  2322
+      plus();
  2323
+    }
2297 2324
 
2298 2325
   }).on( "trackend", function( event ) {
2299 2326
 
2300  
-    equal( event.type, "trackend", "Special trackend event object includes correct type" );
2301  
-    plus();
  2327
+    if ( event.plugin === "cue" ) {
  2328
+      ok( !event.direction, "trackend no plugin specific data on cue" );
  2329
+      plus();
2302 2330
 
2303  
-    equal( event.plugin, "emitter", "Special trackend event object includes correct plugin name" );
2304  
-    plus();
  2331
+      equal( event._running, false, "cue event is not running on trackend" );
  2332
+      plus();
  2333
+
  2334
+      equal( event.type, "trackend", "cue special trackend event object includes correct type" );
  2335
+      plus();
  2336
+
  2337
+      equal( event.plugin, "cue", "cue special trackend event object includes correct plugin name" );
  2338
+      plus();
  2339
+    } else if ( event.plugin === "emitter" ) {
  2340
+      ok( event.direction, "a direction exsists with plugin specific data going " + event.direction );
  2341
+      plus();
  2342
+
  2343
+      equal( event._running, false, "event is not running on trackend going " + event.direction );
  2344
+      plus();
  2345
+
  2346
+      equal( event.type, "trackend", "Special trackend event object includes correct type " + event.direction );
  2347
+      plus();
  2348
+
  2349
+      equal( event.plugin, "emitter", "Special trackend event object includes correct plugin name " + event.direction );
  2350
+      plus();
  2351
+    } else {
  2352
+      ok( false, "invalid plugin fired trackend" );
  2353
+    }
2305 2354
 
  2355
+  }).cue( 4, function() {
  2356
+    $pop.pause().currentTime( 10 );
  2357
+  }).cue( 10, function() {
  2358
+    $pop.currentTime( 5 );
  2359
+  }).cue( 5, function() {
  2360
+    $pop.currentTime( 0 );
2306 2361
   }).play();
2307 2362
 });
2308 2363
 
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.