diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-04 15:29:18 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-04 15:38:32 +0100 |
commit | e772bdf14c46701552491dc337a21325c34e1ec2 (patch) | |
tree | ce50d56a3433306beeb8c4c0cd711636bac242ee /client | |
parent | 3851e732c4b1da0bc0c40a46ed5a89d93cdc5389 (diff) | |
download | PeerTube-e772bdf14c46701552491dc337a21325c34e1ec2.tar.gz PeerTube-e772bdf14c46701552491dc337a21325c34e1ec2.tar.zst PeerTube-e772bdf14c46701552491dc337a21325c34e1ec2.zip |
Load video in permanent live after last one ended
Diffstat (limited to 'client')
-rw-r--r-- | client/src/app/+videos/+video-watch/video-watch.component.ts | 13 |
1 files changed, 12 insertions, 1 deletions
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 66af9709d..b15de2a79 100644 --- a/client/src/app/+videos/+video-watch/video-watch.component.ts +++ b/client/src/app/+videos/+video-watch/video-watch.component.ts | |||
@@ -607,6 +607,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
607 | } | 607 | } |
608 | }) | 608 | }) |
609 | 609 | ||
610 | this.player.one('ended', () => { | ||
611 | if (this.video.isLive) { | ||
612 | this.video.state.id = VideoState.LIVE_ENDED | ||
613 | } | ||
614 | }) | ||
615 | |||
610 | this.player.on('theaterChange', (_: any, enabled: boolean) => { | 616 | this.player.on('theaterChange', (_: any, enabled: boolean) => { |
611 | this.zone.run(() => this.theaterEnabled = enabled) | 617 | this.zone.run(() => this.theaterEnabled = enabled) |
612 | }) | 618 | }) |
@@ -844,7 +850,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
844 | if (!this.liveVideosSub) { | 850 | if (!this.liveVideosSub) { |
845 | this.liveVideosSub = this.peertubeSocket.getLiveVideosObservable() | 851 | this.liveVideosSub = this.peertubeSocket.getLiveVideosObservable() |
846 | .subscribe(({ payload }) => { | 852 | .subscribe(({ payload }) => { |
847 | if (payload.state !== VideoState.PUBLISHED || this.video.state.id !== VideoState.WAITING_FOR_LIVE) return | 853 | if (payload.state !== VideoState.PUBLISHED) return |
854 | |||
855 | const videoState = this.video.state.id | ||
856 | if (videoState !== VideoState.WAITING_FOR_LIVE && videoState !== VideoState.LIVE_ENDED) return | ||
857 | |||
858 | console.log('Loading video after live update.') | ||
848 | 859 | ||
849 | const videoUUID = this.video.uuid | 860 | const videoUUID = this.video.uuid |
850 | 861 | ||