wait if video is currently seeking

This commit is contained in:
j 2014-02-10 09:32:08 +00:00
parent e763541eea
commit 635a26dc48

View file

@ -227,7 +227,11 @@ Ox.VideoElement = function(options, self) {
}
function onLoadedMetadata($video, callback) {
if ($video[0].readyState) {
if ($video[0].seeking) {
$video.one('seeked', function(event) {
callback($video[0]);
});
} else if ($video[0].readyState) {
callback($video[0]);
} else {
$video.one('loadedmetadata', function(event) {
@ -254,7 +258,6 @@ Ox.VideoElement = function(options, self) {
self.video && self.video.pause();
self.currentItem = item;
self.currentItemId = self.items[self.currentItem].id;
Ox.Log('Video', 'sCV', self.video.src, item['in']);
setCurrentVideo(function() {
if (!self.loadedMetadata) {
self.loadedMetadata = true;
@ -295,6 +298,8 @@ Ox.VideoElement = function(options, self) {
self.video.volume = volume;
self.video.muted = muted;
self.$video.css(css);
Ox.Log('Video', 'sCV', self.video.src, self.items[self.currentItem]['in'],
self.video.currentTime, self.video.seeking);
onLoadedMetadata(self.$video, function(video) {
self.$video.one('seeked', function() {
self.loading = false;