if play returns pormise, wait for it

This commit is contained in:
j 2016-08-23 14:06:36 +02:00
parent 4c54a294f6
commit 310502df22

View file

@ -363,8 +363,14 @@ Ox.VideoElement = function(options, self) {
Ox.Log('Video', 'sCV set in', video.src, item['in'] || 0, video.currentTime, video.seeking);
video.currentTime = item['in'] || 0;
if (self.paused) {
self.video.play();
self.video.pause();
var promise = self.video.play();
if (promise) {
promise.then(function() {
self.video.pause();
});
} else {
self.video.pause();
}
}
}
});