Embed: more fixes to do with showing the correct seek window in the progress bar

Embed: display more consistent timestamps across protocols and correctly show seekable range
Embed: fix: don't force nonexistent forcePlayer value
Embed: when info.unixoffset is known, display clock time based timestamps
This commit is contained in:
Cat 2021-10-20 13:46:10 +02:00 committed by Thulinma
parent c542155e10
commit 67d992e352
12 changed files with 178 additions and 22 deletions

View file

@ -195,6 +195,7 @@ p.prototype.build = function (MistVideo,callback) {
MistVideo.player.api.setSource(MistUtil.http.url.addParam(MistVideo.source.url,params));
}
MistUtil.event.addListener(video,"progress",function(){
MistVideo.player.api.lastProgress = new Date();
});
@ -217,9 +218,21 @@ p.prototype.build = function (MistVideo,callback) {
};
if (MistVideo.source.type == "html5/video/mp4") {
var otherdurationoverride = overrides.get.duration;
overrides.get.duration = function(){
return otherdurationoverride.apply(this,arguments) - MistVideo.player.api.liveOffset + MistVideo.info.lastms * 1e-3;
}
overrides.get.currentTime = function(){
return this.currentTime - MistVideo.player.api.liveOffset + MistVideo.info.lastms * 1e-3;
}
overrides.get.buffered = function(){
var video = this;
return {
length: video.buffered.length,
start: function(i) { return video.buffered.start(i) - MistVideo.player.api.liveOffset + MistVideo.info.lastms * 1e-3; },
end: function(i) { return video.buffered.end(i) - MistVideo.player.api.liveOffset + MistVideo.info.lastms * 1e-3; }
}
};
}
}
else {