trigger seeking/seeked events if video is not ready. fixes #2316
This commit is contained in:
parent
4aba1474d6
commit
3b65b9a1c3
1 changed files with 6 additions and 0 deletions
|
@ -177,15 +177,21 @@ Ox.VideoElement = function(options, self) {
|
||||||
|
|
||||||
function isReady($video, callback) {
|
function isReady($video, callback) {
|
||||||
if ($video[0].seeking) {
|
if ($video[0].seeking) {
|
||||||
|
that.triggerEvent('seeking');
|
||||||
$video.one('seeked', function(event) {
|
$video.one('seeked', function(event) {
|
||||||
|
that.triggerEvent('seeked');
|
||||||
callback($video[0]);
|
callback($video[0]);
|
||||||
});
|
});
|
||||||
} else if ($video[0].readyState) {
|
} else if ($video[0].readyState) {
|
||||||
callback($video[0]);
|
callback($video[0]);
|
||||||
} else {
|
} else {
|
||||||
|
that.triggerEvent('seeking');
|
||||||
$video.one('loadedmetadata', function(event) {
|
$video.one('loadedmetadata', function(event) {
|
||||||
callback($video[0]);
|
callback($video[0]);
|
||||||
});
|
});
|
||||||
|
$video.one('seeked', function(event) {
|
||||||
|
that.triggerEvent('seeked');
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue