diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-03 14:10:54 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-03 15:21:16 +0100 |
commit | bb4ba6d94c5051fdd665ebe63fffcc105778b8be (patch) | |
tree | d39302608c53e31395683bb5dd551eac6ced89f8 /client/src | |
parent | 19b7ebfaa822b12f6da25ad2ba10398b3ef25ec6 (diff) | |
download | PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.tar.gz PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.tar.zst PeerTube-bb4ba6d94c5051fdd665ebe63fffcc105778b8be.zip |
Add permanent live support
Diffstat (limited to 'client/src')
4 files changed, 42 insertions, 3 deletions
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 @@ | |||
223 | <div class="form-group-description" i18n>⚠️ Never share your stream key with anyone.</div> | 223 | <div class="form-group-description" i18n>⚠️ Never share your stream key with anyone.</div> |
224 | </div> | 224 | </div> |
225 | 225 | ||
226 | <div class="form-group"> | ||
227 | <my-peertube-checkbox inputName="liveVideoPermanentLive" formControlName="permanentLive"> | ||
228 | <ng-template ptTemplate="label"> | ||
229 | <ng-container i18n>This is a permanent live</ng-container> | ||
230 | </ng-template> | ||
231 | |||
232 | <ng-container ngProjectAs="description"> | ||
233 | <span i18n>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</span> | ||
234 | </ng-container> | ||
235 | </my-peertube-checkbox> | ||
236 | </div> | ||
237 | |||
226 | <div class="form-group" *ngIf="isSaveReplayEnabled()"> | 238 | <div class="form-group" *ngIf="isSaveReplayEnabled()"> |
227 | <my-peertube-checkbox inputName="liveVideoSaveReplay" formControlName="saveReplay"> | 239 | <my-peertube-checkbox inputName="liveVideoSaveReplay" formControlName="saveReplay"> |
228 | <ng-template ptTemplate="label"> | 240 | <ng-template ptTemplate="label"> |
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 { | |||
138 | schedulePublicationAt: VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR, | 138 | schedulePublicationAt: VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR, |
139 | originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR, | 139 | originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR, |
140 | liveStreamKey: null, | 140 | liveStreamKey: null, |
141 | permanentLive: null, | ||
141 | saveReplay: null | 142 | saveReplay: null |
142 | } | 143 | } |
143 | 144 | ||
@@ -158,6 +159,7 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
158 | 159 | ||
159 | this.trackChannelChange() | 160 | this.trackChannelChange() |
160 | this.trackPrivacyChange() | 161 | this.trackPrivacyChange() |
162 | this.trackLivePermanentFieldChange() | ||
161 | } | 163 | } |
162 | 164 | ||
163 | ngOnInit () { | 165 | ngOnInit () { |
@@ -254,6 +256,10 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
254 | return this.serverConfig.live.allowReplay | 256 | return this.serverConfig.live.allowReplay |
255 | } | 257 | } |
256 | 258 | ||
259 | isPermanentLiveEnabled () { | ||
260 | return this.form.value['permanentLive'] === true | ||
261 | } | ||
262 | |||
257 | private sortVideoCaptions () { | 263 | private sortVideoCaptions () { |
258 | this.videoCaptions.sort((v1, v2) => { | 264 | this.videoCaptions.sort((v1, v2) => { |
259 | if (v1.language.label < v2.language.label) return -1 | 265 | if (v1.language.label < v2.language.label) return -1 |
@@ -362,6 +368,24 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
362 | ) | 368 | ) |
363 | } | 369 | } |
364 | 370 | ||
371 | private trackLivePermanentFieldChange () { | ||
372 | // We will update the "support" field depending on the channel | ||
373 | this.form.controls['permanentLive'] | ||
374 | .valueChanges | ||
375 | .subscribe( | ||
376 | permanentLive => { | ||
377 | const saveReplayControl = this.form.controls['saveReplay'] | ||
378 | |||
379 | if (permanentLive === true) { | ||
380 | saveReplayControl.setValue(false) | ||
381 | saveReplayControl.disable() | ||
382 | } else { | ||
383 | saveReplayControl.enable() | ||
384 | } | ||
385 | } | ||
386 | ) | ||
387 | } | ||
388 | |||
365 | private updateSupportField (support: string) { | 389 | private updateSupportField (support: string) { |
366 | return this.form.patchValue({ support: support || '' }) | 390 | return this.form.patchValue({ support: support || '' }) |
367 | } | 391 | } |
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 | |||
107 | video.uuid = this.videoUUID | 107 | video.uuid = this.videoUUID |
108 | 108 | ||
109 | const liveVideoUpdate: LiveVideoUpdate = { | 109 | const liveVideoUpdate: LiveVideoUpdate = { |
110 | saveReplay: this.form.value.saveReplay | 110 | saveReplay: this.form.value.saveReplay, |
111 | permanentLive: this.form.value.permanentLive | ||
111 | } | 112 | } |
112 | 113 | ||
113 | // Update the video | 114 | // 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 { | |||
64 | 64 | ||
65 | if (this.liveVideo) { | 65 | if (this.liveVideo) { |
66 | this.form.patchValue({ | 66 | this.form.patchValue({ |
67 | saveReplay: this.liveVideo.saveReplay | 67 | saveReplay: this.liveVideo.saveReplay, |
68 | permanentLive: this.liveVideo.permanentLive | ||
68 | }) | 69 | }) |
69 | } | 70 | } |
70 | }) | 71 | }) |
@@ -114,7 +115,8 @@ export class VideoUpdateComponent extends FormReactive implements OnInit { | |||
114 | this.video.patch(this.form.value) | 115 | this.video.patch(this.form.value) |
115 | 116 | ||
116 | const liveVideoUpdate: LiveVideoUpdate = { | 117 | const liveVideoUpdate: LiveVideoUpdate = { |
117 | saveReplay: this.form.value.saveReplay | 118 | saveReplay: this.form.value.saveReplay, |
119 | permanentLive: this.form.value.permanentLive | ||
118 | } | 120 | } |
119 | 121 | ||
120 | this.loadingBar.useRef().start() | 122 | this.loadingBar.useRef().start() |