video: keep time in src switches
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/900/head
parent
1f7602c8c6
commit
0fad53b3e0
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue