aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-28 16:10:09 +0100
committerChocobozzz <me@florianbigard.com>2021-01-28 16:10:09 +0100
commit80ac2e5548bf5167d2f243a3cb0e993c75456d76 (patch)
tree1f1d2d7004283c48a4b142182a58fb79e68991a3 /client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts
parent1896bca09e088b0da9d5e845407ecebae330618c (diff)
downloadPeerTube-80ac2e5548bf5167d2f243a3cb0e993c75456d76.tar.gz
PeerTube-80ac2e5548bf5167d2f243a3cb0e993c75456d76.tar.zst
PeerTube-80ac2e5548bf5167d2f243a3cb0e993c75456d76.zip
Support transcoding profile in client admin
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.ts18
1 files changed, 17 insertions, 1 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 9a46a2e59..ae6a9e844 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
@@ -1,4 +1,5 @@
1import { forkJoin } from 'rxjs' 1import { forkJoin } from 'rxjs'
2import { pairwise } from 'rxjs/operators'
2import { ViewportScroller } from '@angular/common' 3import { ViewportScroller } from '@angular/common'
3import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' 4import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core'
4import { ConfigService } from '@app/+admin/config/shared/config.service' 5import { ConfigService } from '@app/+admin/config/shared/config.service'
@@ -20,7 +21,6 @@ import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@a
20import { FormReactive, FormValidatorService, SelectOptionsItem } from '@app/shared/shared-forms' 21import { FormReactive, FormValidatorService, SelectOptionsItem } from '@app/shared/shared-forms'
21import { NgbNav } from '@ng-bootstrap/ng-bootstrap' 22import { NgbNav } from '@ng-bootstrap/ng-bootstrap'
22import { CustomConfig, ServerConfig } from '@shared/models' 23import { CustomConfig, ServerConfig } from '@shared/models'
23import { pairwise } from 'rxjs/operators'
24 24
25@Component({ 25@Component({
26 selector: 'my-edit-custom-config', 26 selector: 'my-edit-custom-config',
@@ -39,6 +39,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
39 transcodingThreadOptions: { label: string, value: number }[] = [] 39 transcodingThreadOptions: { label: string, value: number }[] = []
40 liveMaxDurationOptions: { label: string, value: number }[] = [] 40 liveMaxDurationOptions: { label: string, value: number }[] = []
41 41
42 vodTranscodingProfileOptions: string[] = []
43 liveTranscodingProfileOptions: string[] = []
44
42 languageItems: SelectOptionsItem[] = [] 45 languageItems: SelectOptionsItem[] = []
43 categoryItems: SelectOptionsItem[] = [] 46 categoryItems: SelectOptionsItem[] = []
44 47
@@ -101,6 +104,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
101 { value: 8, label: '8' } 104 { value: 8, label: '8' }
102 ] 105 ]
103 106
107 this.vodTranscodingProfileOptions = [ 'default' ]
108 this.liveTranscodingProfileOptions = [ 'default' ]
109
104 this.liveMaxDurationOptions = [ 110 this.liveMaxDurationOptions = [
105 { value: -1, label: $localize`No limit` }, 111 { value: -1, label: $localize`No limit` },
106 { value: 1000 * 3600, label: $localize`1 hour` }, 112 { value: 1000 * 3600, label: $localize`1 hour` },
@@ -127,6 +133,14 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
127 return this.serverConfig.live.rtmp.port 133 return this.serverConfig.live.rtmp.port
128 } 134 }
129 135
136 getAvailableTranscodingProfile (type: 'live' | 'vod') {
137 if (type === 'live') {
138 return this.serverConfig.live.transcoding.availableProfiles
139 }
140
141 return this.serverConfig.transcoding.availableProfiles
142 }
143
130 getTotalTranscodingThreads () { 144 getTotalTranscodingThreads () {
131 const transcodingEnabled = this.form.value['transcoding']['enabled'] 145 const transcodingEnabled = this.form.value['transcoding']['enabled']
132 const transcodingThreads = this.form.value['transcoding']['threads'] 146 const transcodingThreads = this.form.value['transcoding']['threads']
@@ -247,6 +261,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
247 threads: TRANSCODING_THREADS_VALIDATOR, 261 threads: TRANSCODING_THREADS_VALIDATOR,
248 allowAdditionalExtensions: null, 262 allowAdditionalExtensions: null,
249 allowAudioFiles: null, 263 allowAudioFiles: null,
264 profile: null,
250 resolutions: {}, 265 resolutions: {},
251 hls: { 266 hls: {
252 enabled: null 267 enabled: null
@@ -266,6 +281,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A
266 transcoding: { 281 transcoding: {
267 enabled: null, 282 enabled: null,
268 threads: TRANSCODING_THREADS_VALIDATOR, 283 threads: TRANSCODING_THREADS_VALIDATOR,
284 profile: null,
269 resolutions: {} 285 resolutions: {}
270 } 286 }
271 }, 287 },