@@ -238,6 +238,7 @@ test('removes the poster attribute so it does not flash between videos', functio
238238
239239 player . trigger ( 'adsready' ) ;
240240 player . trigger ( 'play' ) ;
241+ player . trigger ( 'adstart' ) ;
241242
242243 equal ( video . poster , '' , 'poster is removed' ) ;
243244} ) ;
@@ -455,8 +456,10 @@ test('only restores the player snapshot if the src changed', function() {
455456 }
456457 srcModified = true ;
457458 } ;
458- player . currentTime = function ( ) {
459- currentTimeModified = true ;
459+ player . currentTime = function ( time ) {
460+ if ( time !== undefined ) {
461+ currentTimeModified = true ;
462+ }
460463 } ;
461464
462465 // with a separate video display or server-side ad insertion, ads play but
@@ -582,15 +585,41 @@ test('snapshot does not resume after multiple post-rolls', function() {
582585 player . trigger ( 'ended' ) ;
583586 //trigger a lots o post-rolls
584587 player . trigger ( 'adstart' ) ;
585- player . src ( '//exampe .com/ad1.mp4' ) ;
588+ player . src ( 'http://example .com/ad1.mp4' ) ;
586589 player . trigger ( 'loadstart' ) ;
587590 player . trigger ( 'adend' ) ;
588591 player . trigger ( 'adstart' ) ;
589- player . src ( '//exampe .com/ad2.mp4' ) ;
592+ player . src ( 'http://example .com/ad2.mp4' ) ;
590593 player . trigger ( 'loadstart' ) ;
591594 player . trigger ( 'adend' ) ;
592595
593596 equal ( player . ads . state , 'content-playback' , 'Player should be in content-playback state after a post-roll' ) ;
594597 ok ( ! playCalled , 'content playback should not resume' ) ;
595598
596599} ) ;
600+
601+ test ( 'changing the source and then timing out does not restore a snapshot' , function ( ) {
602+ player . paused = function ( ) {
603+ return false ;
604+ } ;
605+ // load and play the initial video
606+ player . src ( 'http://example.com/movie.mp4' ) ;
607+ player . trigger ( 'loadstart' ) ;
608+ player . trigger ( 'play' ) ;
609+ player . trigger ( 'adsready' ) ;
610+ // preroll
611+ player . trigger ( 'adstart' ) ;
612+ player . trigger ( 'adend' ) ;
613+
614+ // change the content and timeout the new ad response
615+ player . src ( 'http://example.com/movie2.mp4' ) ;
616+ player . trigger ( 'loadstart' ) ;
617+ player . trigger ( 'adtimeout' ) ;
618+
619+ equal ( player . ads . state ,
620+ 'ad-timeout-playback' ,
621+ 'playing the new content video after the ad timeout' ) ;
622+ equal ( 'http://example.com/movie2.mp4' ,
623+ player . currentSrc ( ) ,
624+ 'playing the second video' ) ;
625+ } ) ;
0 commit comments