Embed: videojs didnt allow seeking backwards

This commit is contained in:
Cat 2019-05-16 15:03:40 +02:00 committed by Thulinma
parent 09d54228d1
commit e1150fe871
2 changed files with 9 additions and 2 deletions

View file

@ -159,6 +159,12 @@ p.prototype.build = function (MistVideo,callback) {
});
MistVideo.player.api.load = function(){};
overrides.set.currentTime = function(value){
console.log("seeking to",value);
MistVideo.player.videojs.currentTime(value); //seeking backwards does not work if we set it on the video directly
//MistVideo.video.currentTime = value;
};
if (MistVideo.info.type == "live") {
function getLastBuffer(video) {
var buffer_end = 0;
@ -189,7 +195,8 @@ p.prototype.build = function (MistVideo,callback) {
//MistVideo.player.api.liveOffset = offset;
MistVideo.log("Seeking to "+MistUtil.format.time(value)+" ("+Math.round(offset*-10)/10+"s from live)");
MistVideo.video.currentTime -= diff;
//MistVideo.video.currentTime -= diff;
MistVideo.player.videojs.currentTime(MistVideo.video.currentTime - diff); //seeking backwards does not work if we set it on the video directly
}
var lastms = 0;
overrides.get.currentTime = function(){