Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Smoother live autoplay

Chocobozzzb8cb1d8e87c1
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 40547bc15b..3121a47237 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -317,13 +317,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
private loadVideo (options: {
videoId: string
forceAutoplay: boolean
+ liveRefresh?: boolean
videoPassword?: string
}) {
- const { videoId, forceAutoplay, videoPassword } = options
+ const { videoId, liveRefresh, forceAutoplay, videoPassword } = options
- if (this.isSameElement(this.video, videoId)) return
-
- this.video = undefined
+ if (!liveRefresh && this.isSameElement(this.video, videoId)) return
const videoObs = this.hooks.wrapObsFun(
this.videoService.getVideo.bind(this.videoService),
@@ -895,9 +894,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
const videoUUID = this.video.uuid
- // Reset to force refresh the video
- this.video = undefined
- this.loadVideo({ videoId: videoUUID, forceAutoplay: true })
+ this.loadVideo({ videoId: videoUUID, forceAutoplay: true, liveRefresh: true })
}
private handleLiveViewsChange (newViewers: number) {