diff options
author | Chocobozzz <me@florianbigard.com> | 2020-09-17 09:20:52 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e (patch) | |
tree | 79304b0152b0a38d33b26e65d4acdad0da4032a7 /client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |
parent | 110d463fece85e87a26aca48a6048ae0017a27b3 (diff) | |
download | PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.gz PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.tar.zst PeerTube-c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e.zip |
Live streaming implementation first step
Diffstat (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts')
-rw-r--r-- | client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 78e9dd5e5..de800c87e 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts | |||
@@ -34,6 +34,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
34 | customConfig: CustomConfig | 34 | customConfig: CustomConfig |
35 | 35 | ||
36 | resolutions: { id: string, label: string, description?: string }[] = [] | 36 | resolutions: { id: string, label: string, description?: string }[] = [] |
37 | liveResolutions: { id: string, label: string, description?: string }[] = [] | ||
37 | transcodingThreadOptions: { label: string, value: number }[] = [] | 38 | transcodingThreadOptions: { label: string, value: number }[] = [] |
38 | 39 | ||
39 | languageItems: SelectOptionsItem[] = [] | 40 | languageItems: SelectOptionsItem[] = [] |
@@ -82,6 +83,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
82 | } | 83 | } |
83 | ] | 84 | ] |
84 | 85 | ||
86 | this.liveResolutions = this.resolutions.filter(r => r.id !== '0p') | ||
87 | |||
85 | this.transcodingThreadOptions = [ | 88 | this.transcodingThreadOptions = [ |
86 | { value: 0, label: $localize`Auto (via ffmpeg)` }, | 89 | { value: 0, label: $localize`Auto (via ffmpeg)` }, |
87 | { value: 1, label: '1' }, | 90 | { value: 1, label: '1' }, |
@@ -198,6 +201,15 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
198 | enabled: null | 201 | enabled: null |
199 | } | 202 | } |
200 | }, | 203 | }, |
204 | live: { | ||
205 | enabled: null, | ||
206 | |||
207 | transcoding: { | ||
208 | enabled: null, | ||
209 | threads: TRANSCODING_THREADS_VALIDATOR, | ||
210 | resolutions: {} | ||
211 | } | ||
212 | }, | ||
201 | autoBlacklist: { | 213 | autoBlacklist: { |
202 | videos: { | 214 | videos: { |
203 | ofUsers: { | 215 | ofUsers: { |
@@ -245,13 +257,24 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
245 | const defaultValues = { | 257 | const defaultValues = { |
246 | transcoding: { | 258 | transcoding: { |
247 | resolutions: {} | 259 | resolutions: {} |
260 | }, | ||
261 | live: { | ||
262 | transcoding: { | ||
263 | resolutions: {} | ||
264 | } | ||
248 | } | 265 | } |
249 | } | 266 | } |
267 | |||
250 | for (const resolution of this.resolutions) { | 268 | for (const resolution of this.resolutions) { |
251 | defaultValues.transcoding.resolutions[resolution.id] = 'false' | 269 | defaultValues.transcoding.resolutions[resolution.id] = 'false' |
252 | formGroupData.transcoding.resolutions[resolution.id] = null | 270 | formGroupData.transcoding.resolutions[resolution.id] = null |
253 | } | 271 | } |
254 | 272 | ||
273 | for (const resolution of this.liveResolutions) { | ||
274 | defaultValues.live.transcoding.resolutions[resolution.id] = 'false' | ||
275 | formGroupData.live.transcoding.resolutions[resolution.id] = null | ||
276 | } | ||
277 | |||
255 | this.buildForm(formGroupData) | 278 | this.buildForm(formGroupData) |
256 | this.loadForm() | 279 | this.loadForm() |
257 | this.checkTranscodingFields() | 280 | this.checkTranscodingFields() |
@@ -268,6 +291,14 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A | |||
268 | return this.form.value['transcoding']['enabled'] === true | 291 | return this.form.value['transcoding']['enabled'] === true |
269 | } | 292 | } |
270 | 293 | ||
294 | isLiveEnabled () { | ||
295 | return this.form.value['live']['enabled'] === true | ||
296 | } | ||
297 | |||
298 | isLiveTranscodingEnabled () { | ||
299 | return this.form.value['live']['transcoding']['enabled'] === true | ||
300 | } | ||
301 | |||
271 | isSignupEnabled () { | 302 | isSignupEnabled () { |
272 | return this.form.value['signup']['enabled'] === true | 303 | return this.form.value['signup']['enabled'] === true |
273 | } | 304 | } |