wait for video

This commit is contained in:
j 2017-04-16 23:20:58 +02:00
parent 8ec0f2f9b9
commit 6a8fca06cc

View file

@ -131,7 +131,13 @@
var $player, player;
if (pandora.$ui.editPanel) {
$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')];
}
}
@ -140,7 +146,9 @@
callback(player, $player);
}, 250);
} else {
setTimeout(function() { waitForPlayer(callback); }, 250);
setTimeout(function() {
waitForPlayer(callback);
}, 250);
}
}