зеркало из https://github.com/mozilla/popcorn-js.git
[#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:
Родитель
57e80e7c47
Коммит
ad0e9f094b
|
@ -70,9 +70,12 @@ Popcorn.player( "youtube", {
|
||||||
|
|
||||||
var timeupdate = function() {
|
var timeupdate = function() {
|
||||||
|
|
||||||
currentTime = youtubeObject.getCurrentTime();
|
if ( !media.paused ) {
|
||||||
media.dispatchEvent( "timeupdate" );
|
|
||||||
setTimeout( timeupdate, 10 );
|
currentTime = youtubeObject.getCurrentTime();
|
||||||
|
media.dispatchEvent( "timeupdate" );
|
||||||
|
setTimeout( timeupdate, 10 );
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var volumeupdate = function() {
|
var volumeupdate = function() {
|
||||||
|
@ -89,7 +92,7 @@ Popcorn.player( "youtube", {
|
||||||
media.dispatchEvent( "volumechange" );
|
media.dispatchEvent( "volumechange" );
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout( volumeupdate, 1000 );
|
setTimeout( volumeupdate, 250 );
|
||||||
};
|
};
|
||||||
|
|
||||||
media.play = function() {
|
media.play = function() {
|
||||||
|
|
|
@ -1494,7 +1494,9 @@
|
||||||
events = {},
|
events = {},
|
||||||
|
|
||||||
// The container div of the resource
|
// 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 = {},
|
basePlayer = {},
|
||||||
timeout,
|
timeout,
|
||||||
popcorn;
|
popcorn;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче