From bb4ba6d94c5051fdd665ebe63fffcc105778b8be Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 3 Dec 2020 14:10:54 +0100 Subject: Add permanent live support --- .../+video-edit/shared/video-edit.component.html | 12 +++++++++++ .../+video-edit/shared/video-edit.component.ts | 24 ++++++++++++++++++++++ .../video-go-live.component.ts | 3 ++- .../+videos/+video-edit/video-update.component.ts | 6 ++++-- 4 files changed, 42 insertions(+), 3 deletions(-) (limited to 'client/src') diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html index bf8b0b267..f62464d35 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html @@ -223,6 +223,18 @@
⚠️ Never share your stream key with anyone.
+
+ + + This is a permanent live + + + + You can stream multiple times in a permanent live. The URL for your viewers won't change but you cannot save replays of your lives + + +
+
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index de78a18cc..5294a57a1 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts @@ -138,6 +138,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { schedulePublicationAt: VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR, originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR, liveStreamKey: null, + permanentLive: null, saveReplay: null } @@ -158,6 +159,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { this.trackChannelChange() this.trackPrivacyChange() + this.trackLivePermanentFieldChange() } ngOnInit () { @@ -254,6 +256,10 @@ export class VideoEditComponent implements OnInit, OnDestroy { return this.serverConfig.live.allowReplay } + isPermanentLiveEnabled () { + return this.form.value['permanentLive'] === true + } + private sortVideoCaptions () { this.videoCaptions.sort((v1, v2) => { if (v1.language.label < v2.language.label) return -1 @@ -362,6 +368,24 @@ export class VideoEditComponent implements OnInit, OnDestroy { ) } + private trackLivePermanentFieldChange () { + // We will update the "support" field depending on the channel + this.form.controls['permanentLive'] + .valueChanges + .subscribe( + permanentLive => { + const saveReplayControl = this.form.controls['saveReplay'] + + if (permanentLive === true) { + saveReplayControl.setValue(false) + saveReplayControl.disable() + } else { + saveReplayControl.enable() + } + } + ) + } + private updateSupportField (support: string) { return this.form.patchValue({ support: support || '' }) } diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts index d29b2da97..a87d84d48 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-go-live.component.ts @@ -107,7 +107,8 @@ export class VideoGoLiveComponent extends VideoSend implements OnInit, CanCompon video.uuid = this.videoUUID const liveVideoUpdate: LiveVideoUpdate = { - saveReplay: this.form.value.saveReplay + saveReplay: this.form.value.saveReplay, + permanentLive: this.form.value.permanentLive } // Update the video diff --git a/client/src/app/+videos/+video-edit/video-update.component.ts b/client/src/app/+videos/+video-edit/video-update.component.ts index e37163ca9..30c82343b 100644 --- a/client/src/app/+videos/+video-edit/video-update.component.ts +++ b/client/src/app/+videos/+video-edit/video-update.component.ts @@ -64,7 +64,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { if (this.liveVideo) { this.form.patchValue({ - saveReplay: this.liveVideo.saveReplay + saveReplay: this.liveVideo.saveReplay, + permanentLive: this.liveVideo.permanentLive }) } }) @@ -114,7 +115,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { this.video.patch(this.form.value) const liveVideoUpdate: LiveVideoUpdate = { - saveReplay: this.form.value.saveReplay + saveReplay: this.form.value.saveReplay, + permanentLive: this.form.value.permanentLive } this.loadingBar.useRef().start() -- cgit v1.2.3