wait for video
This commit is contained in:
parent
8ec0f2f9b9
commit
6a8fca06cc
1 changed files with 10 additions and 2 deletions
12
playlist.js
12
playlist.js
|
@ -131,7 +131,13 @@
|
||||||
var $player, player;
|
var $player, player;
|
||||||
if (pandora.$ui.editPanel) {
|
if (pandora.$ui.editPanel) {
|
||||||
$player = $('.OxVideoPlayer').not('.OxBar');
|
$player = $('.OxVideoPlayer').not('.OxBar');
|
||||||
if($player.data('oxid') && Ox.$elements[$player.data('oxid')]) {
|
var readyState = 0;
|
||||||
|
if($player.find('video').length) {
|
||||||
|
$player.find('video').each(function() {
|
||||||
|
readyState = Math.max(readyState, this.readyState);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(readyState && $player.data('oxid') && Ox.$elements[$player.data('oxid')]) {
|
||||||
player = Ox.$elements[$player.data('oxid')];
|
player = Ox.$elements[$player.data('oxid')];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -140,7 +146,9 @@
|
||||||
callback(player, $player);
|
callback(player, $player);
|
||||||
}, 250);
|
}, 250);
|
||||||
} else {
|
} else {
|
||||||
setTimeout(function() { waitForPlayer(callback); }, 250);
|
setTimeout(function() {
|
||||||
|
waitForPlayer(callback);
|
||||||
|
}, 250);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue