diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index 99228b96..428ffa5e 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -434,13 +434,13 @@ class VideoContentSetup { // Set the source to the original video if (isHLS) { - content.videojs.src(this.getDirectSrc(content)); + this.changeSourceKeepTime(content.videojs, this.getDirectSrc(content)); } return; } else { // Set source to HLS if (!isHLS) { - content.videojs.src(this.getHLSsrc(content)); + this.changeSourceKeepTime(content.videojs, this.getHLSsrc(content)); } } @@ -458,6 +458,13 @@ class VideoContentSetup { } } + changeSourceKeepTime(vidjs: Player, src: { src: string; type: string }) { + const time = vidjs.currentTime(); + vidjs.src(src); + vidjs.currentTime(time); + vidjs.play(); + } + onContentDestroy({ content }: PsVideoEvent) { this.destroyVideo(content); }