Skip to content

Commit

Permalink
[#1102] Update 'exec', 'listen' to 'cue', 'on'
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenaw committed Jun 28, 2012
1 parent 5ea8870 commit 987a496
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions players/youtube/popcorn.youtube.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ asyncTest( "Player play, pause, autoplay", function() {

pop1 = Popcorn.youtube( "#video6", "http://www.youtube.com/watch?v=nfGV32RNkhw" );

pop1.listen( "canplaythrough", function() {
pop1.on( "canplaythrough", function() {

pop1.play();

Expand All @@ -32,23 +32,23 @@ asyncTest( "Player play, pause, autoplay", function() {

pop2 = Popcorn.youtube( "#video7", "http://www.youtube.com/watch?v=nfGV32RNkhw" );

pop2.listen( "canplaythrough", function() {
pop2.on( "canplaythrough", function() {

equal( pop2.media.paused, true, "popcorn 2 pauses" );
plus();
});

pop3 = Popcorn.youtube( "#video8", "http://www.youtube.com/watch?v=nfGV32RNkhw&autoplay=0" );

pop3.listen( "canplaythrough", function() {
pop3.on( "canplaythrough", function() {

equal( pop3.media.paused, true, "popcorn 3 autoplay off paused" );
plus();
});

pop4 = Popcorn.youtube( "#video9", "http://www.youtube.com/watch?v=nfGV32RNkhw&autoplay=1" );

pop4.listen( "canplaythrough", function() {
pop4.on( "canplaythrough", function() {

equal( pop4.media.paused, false, "popcorn 4 is autoplaying" );
plus();
Expand All @@ -75,7 +75,7 @@ asyncTest("Update Timer", function () {
Popcorn.removePlugin( "forwards" );
Popcorn.removePlugin( "backwards" );
Popcorn.removePlugin( "wrapper" );
p2.removePlugin( "exec" );
p2.removePlugin( "cue" );
p2.destroy();
start();
}
Expand Down Expand Up @@ -166,7 +166,7 @@ asyncTest("Update Timer", function () {
wrapper: "two"
})
// checking wrapper 2's start
.exec( 5, function() {
.cue( 5, function() {

if ( execCount === 0 ) {

Expand All @@ -178,7 +178,7 @@ asyncTest("Update Timer", function () {
}
})
// checking wrapper 1's start
.exec( 6, function() {
.cue( 6, function() {

if ( execCount === 1 ) {

Expand All @@ -190,7 +190,7 @@ asyncTest("Update Timer", function () {
}
})
// checking wrapper 1's end
.exec( 7, function() {
.cue( 7, function() {

if ( execCount === 2 ) {

Expand All @@ -202,7 +202,7 @@ asyncTest("Update Timer", function () {
}
})
// checking wrapper 2's end
.exec( 8, function() {
.cue( 8, function() {

if ( execCount === 3 ) {

Expand All @@ -214,7 +214,7 @@ asyncTest("Update Timer", function () {
}
});

p2.exec( 3, function() {
p2.cue( 3, function() {
p2.play();
});

Expand Down Expand Up @@ -369,7 +369,7 @@ asyncTest( "Popcorn YouTube Plugin Url and Duration Tests", function() {
plus();
});

popcorn.listen( "durationchange", function() {
popcorn.on( "durationchange", function() {

notEqual( popcorn.duration(), 0, "Duration has been changed from 0" );
plus();
Expand Down Expand Up @@ -423,7 +423,7 @@ asyncTest( "Popcorn YouTube Plugin Url Regex Test", function() {
var urlTest = urlTests[ key ],
popcorn = Popcorn.youtube( "#video" + i++, urlTest.url );

popcorn.listen( "loadeddata", function() {
popcorn.on( "loadeddata", function() {

equal( popcorn.media.src, urlTest.expected, "Video id is correct for " + urlTest.name + ": " + urlTest.url );
popcorn.pause();
Expand Down Expand Up @@ -492,20 +492,20 @@ asyncTest( "YouTube ended event", function() {

var pop = Popcorn.youtube( "#video10", "http://www.youtube.com/watch?v=nfGV32RNkhw" );

pop.listen( "ended", function() {
pop.on( "ended", function() {
ok( true, "YouTube is successfully firing the ended event" );
start();
});

pop.exec( 5, function(){
pop.cue( 5, function(){
pop.currentTime( 150 );
});

pop.play();
});

asyncTest( "youtube player gets a proper _teardown", function() {

var count = 0,
expects = 1;

Expand All @@ -519,7 +519,7 @@ asyncTest( "youtube player gets a proper _teardown", function() {
expect( expects );

var popcorn = Popcorn.youtube( "#video9", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
popcorn.listen( "loadeddata", function() {
popcorn.on( "loadeddata", function() {

popcorn.destroy();
equal( popcorn.media.children.length, 0, "" );
Expand All @@ -546,7 +546,7 @@ asyncTest( "Youtube ready state events", function() {
expect( expects );

var popcorn = Popcorn.youtube( "#video9", "http://www.youtube.com/watch?v=nfGV32RNkhw" );
popcorn.listen( "loadeddata", function() {
popcorn.on( "loadeddata", function() {

popcorn.destroy();
equal( popcorn.media.children.length, 0, "" );
Expand Down Expand Up @@ -650,13 +650,13 @@ asyncTest( "Youtube media start time fragment", function() {
});

asyncTest( "youtube player quarantine", function() {

ok( window.quarantineYT, "quarantine of broken youtube player exists." );
start();
});

asyncTest( "youtube can play type", function() {

ok( Popcorn.youtube.canPlayType( "div", "http://youtube.com/watch/v/6v3jsVivU6U?format=json" ), "youtube can play url in this format: http://youtube.com/watch/v/6v3jsVivU6U?format=json" );
ok( Popcorn.youtube.canPlayType( "div", "http://www.youtube.com/v/M3r2XDceM6A&fs=1" ), "youtube can play url in this format: http://www.youtube.com/v/M3r2XDceM6A&fs=1" );
ok( Popcorn.youtube.canPlayType( "div", "youtube.com/v/M3r2XDceM6A&fs=1" ), "youtube can play url in this format: youtube.com/v/M3r2XDceM6A&fs=1" );
Expand Down

0 comments on commit 987a496

Please sign in to comment.