[#423] tightened up volume event listener. fixed regression on timeupdate loop. youtube now works with target id, element, or hash-id, just like popcorn's html video targeting

This commit is contained in:
ScottDowne 2011-09-28 12:14:45 -04:00
Родитель 57e80e7c47
Коммит ad0e9f094b
2 изменённых файлов: 10 добавлений и 5 удалений

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

@ -70,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() {
@ -89,7 +92,7 @@ Popcorn.player( "youtube", {
media.dispatchEvent( "volumechange" );
}
setTimeout( volumeupdate, 1000 );
setTimeout( volumeupdate, 250 );
};
media.play = function() {

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

@ -1494,7 +1494,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;