]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/+videos/+video-watch/video-watch.component.ts
Use new primeng i18n api
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.ts
index 66af9709dfcc8cfa5ceac2a2e606d77c5722c71d..b15de2a79633922f5f030097a5bddf32d4292523 100644 (file)
@@ -607,6 +607,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
         }
       })
 
+      this.player.one('ended', () => {
+        if (this.video.isLive) {
+          this.video.state.id = VideoState.LIVE_ENDED
+        }
+      })
+
       this.player.on('theaterChange', (_: any, enabled: boolean) => {
         this.zone.run(() => this.theaterEnabled = enabled)
       })
@@ -844,7 +850,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
     if (!this.liveVideosSub) {
       this.liveVideosSub = this.peertubeSocket.getLiveVideosObservable()
         .subscribe(({ payload }) => {
-          if (payload.state !== VideoState.PUBLISHED || this.video.state.id !== VideoState.WAITING_FOR_LIVE) return
+          if (payload.state !== VideoState.PUBLISHED) return
+
+          const videoState = this.video.state.id
+          if (videoState !== VideoState.WAITING_FOR_LIVE && videoState !== VideoState.LIVE_ENDED) return
+
+          console.log('Loading video after live update.')
 
           const videoUUID = this.video.uuid