timeUpdate: function( event ) {
Popcorn.timeUpdate.call( null, this, event );
return this;
+ },
+
+ stop: function() {
+
+ return this.currentTime( 0 ).pause();
}
});
});
+test( "Popcorn.stop", function() {
+
+ var $pop = Popcorn( "#video" ),
+ count = 0,
+ expects = 4;
+
+ expect( expects );
+
+ function plus() {
+ if ( ++count === expects ) {
+ start();
+ $pop.removePlugin( "exec" );
+ }
+ }
+
+ stop( 8000 );
+
+ ok( $pop.stop, "stop is a method of the $pop instance" );
+ plus();
+
+ equals( typeof $pop.stop, "function", "$pop.stop is a function" );
+ plus();
+
+ $pop.exec( 4, function() {
+ $pop.stop();
+
+ equals( $pop.currentTime(), 0, "currentTime is 0" );
+ plus();
+ equals( $pop.media.paused, true, "The media is paused" );
+ plus();
+ });
+
+ $pop.currentTime( 3 ).play();
+
+});
module("Popcorn Static Methods");
start();
// clean up added events after tests
clearInterval( interval );
- poppercore.removePlugin( "parserTest" );
+ poppercore.removePlugin( "parserTest" ).stop();
}
}
start();
Popcorn.removePlugin( "testAudioParser" );
+ audiocorn.stop();
}
}