Merge branch 't423' of git://github.com/ScottDowne/popcorn-js into t423

This commit is contained in:
Christopher De Cairos 2011-09-28 12:37:57 -04:00
Родитель e98351c019 d76ea3d20e
Коммит 261e12c8d8
2 изменённых файлов: 13 добавлений и 9 удалений

Просмотреть файл

@ -9,7 +9,6 @@ Popcorn.player( "youtube", {
_setup: function( options ) {
var media = this,
player = {},
youtubeObject,
container = document.createElement( "div" ),
currentTime = 0,
@ -71,9 +70,12 @@ Popcorn.player( "youtube", {
var timeupdate = function() {
currentTime = youtubeObject.getCurrentTime();
media.dispatchEvent( "timeupdate" );
setTimeout( timeupdate, 10 );
if ( !media.paused ) {
currentTime = youtubeObject.getCurrentTime();
media.dispatchEvent( "timeupdate" );
setTimeout( timeupdate, 10 );
}
};
var volumeupdate = function() {
@ -90,7 +92,7 @@ Popcorn.player( "youtube", {
media.dispatchEvent( "volumechange" );
}
setTimeout( volumeupdate, 1000 );
setTimeout( volumeupdate, 250 );
};
media.play = function() {
@ -180,10 +182,10 @@ Popcorn.player( "youtube", {
});
media.readyState = 4;
media.dispatchEvent( 'load' );
media.dispatchEvent( "load" );
dataLoaded = true;
media.duration = youtubeObject.getDuration();
media.dispatchEvent( 'durationchange' );
media.dispatchEvent( "durationchange" );
volumeupdate();
if ( !media.paused ) {
@ -191,7 +193,7 @@ Popcorn.player( "youtube", {
media.play();
}
media.paused && media.dispatchEvent( 'loadeddata' );
media.paused && media.dispatchEvent( "loadeddata" );
};
options.controls = +options.controls === 0 || +options.controls === 1 ? options.controls : 1;

Просмотреть файл

@ -1507,7 +1507,9 @@
events = {},
// The container div of the resource
container = document.getElementById( rIdExp.exec( target ) && rIdExp.exec( target )[ 2 ] ) || document.createElement( "div" ),
container = document.getElementById( rIdExp.exec( target ) && rIdExp.exec( target )[ 2 ] ) ||
document.getElementById( target ) ||
target,
basePlayer = {},
timeout,
popcorn;