});
test("Extension and Method Overriding", function () {
- var expects = 3,
+ var expects = 4,
count = 0,
player = Popcorn.baseplayer(),
playerForPopcorn = Popcorn.baseplayer(),
timeupdate: function() {
ok( true, "Timeupdate overridden" );
plus();
+
+ // Must dispatch event so event listeners can work!
+ this.dispatchEvent("timeupdate");
+
+ // We don't want to cue custom timing loop using setTimeout because we only want this to run once
}
});
+ player.addEventListener( "timeupdate", function() {
+ ok( true, "Timeupdate event dispatched!" );
+ plus();
+ });
+
popcorn = Popcorn( playerForPopcorn )
.exec( 2, function() {
ok( true, "Exec triggereed from popcorn after 2 seconds" );
player.load();
player.play();
+ // Each player will define its own criteria for when readyState should be changed
+ // No logic in base player for this, so we must do it manually so popcorn will be able to cue track events
playerForPopcorn.readyState = 2;
popcorn.play();
});