trigger seeking/seeked events if video is not ready. fixes #2316

This commit is contained in:
j 2014-12-26 23:44:31 +00:00
parent 4aba1474d6
commit 3b65b9a1c3

View file

@ -177,15 +177,21 @@ Ox.VideoElement = function(options, self) {
function isReady($video, callback) {
if ($video[0].seeking) {
that.triggerEvent('seeking');
$video.one('seeked', function(event) {
that.triggerEvent('seeked');
callback($video[0]);
});
} else if ($video[0].readyState) {
callback($video[0]);
} else {
that.triggerEvent('seeking');
$video.one('loadedmetadata', function(event) {
callback($video[0]);
});
$video.one('seeked', function(event) {
that.triggerEvent('seeked');
});
}
}