diff options
author | Chocobozzz <me@florianbigard.com> | 2019-06-12 17:26:23 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-06-12 17:26:23 +0200 |
commit | 00aa1f0d9b9a976a102773cb520f2464ef5c7540 (patch) | |
tree | 90ed4d44d75470ff0890332fe6038422859b2f11 | |
parent | a80e84f047dc3d2229f1c5df9f008298fafb85a0 (diff) | |
download | PeerTube-00aa1f0d9b9a976a102773cb520f2464ef5c7540.tar.gz PeerTube-00aa1f0d9b9a976a102773cb520f2464ef5c7540.tar.zst PeerTube-00aa1f0d9b9a976a102773cb520f2464ef5c7540.zip |
Add 4k conf in transcoding in admin panel
5 files changed, 34 insertions, 12 deletions
diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html index 44fc6dc26..d5b625d9c 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.html | |||
@@ -309,8 +309,8 @@ | |||
309 | <ng-container formGroupName="resolutions"> | 309 | <ng-container formGroupName="resolutions"> |
310 | <div class="form-group" *ngFor="let resolution of resolutions"> | 310 | <div class="form-group" *ngFor="let resolution of resolutions"> |
311 | <my-peertube-checkbox | 311 | <my-peertube-checkbox |
312 | [inputName]="getResolutionKey(resolution)" [formControlName]="resolution" | 312 | [inputName]="getResolutionKey(resolution.id)" [formControlName]="resolution.id" |
313 | i18n-labelText labelText="Resolution {{resolution}} enabled" | 313 | i18n-labelText labelText="Resolution {{resolution.label}} enabled" |
314 | ></my-peertube-checkbox> | 314 | ></my-peertube-checkbox> |
315 | </div> | 315 | </div> |
316 | </ng-container> | 316 | </ng-container> |
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 c238a6c81..055bae851 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 | |||
@@ -15,7 +15,7 @@ import { FormValidatorService } from '@app/shared/forms/form-validators/form-val | |||
15 | export class EditCustomConfigComponent extends FormReactive implements OnInit { | 15 | export class EditCustomConfigComponent extends FormReactive implements OnInit { |
16 | customConfig: CustomConfig | 16 | customConfig: CustomConfig |
17 | 17 | ||
18 | resolutions: string[] = [] | 18 | resolutions: { id: string, label: string }[] = [] |
19 | transcodingThreadOptions: { label: string, value: number }[] = [] | 19 | transcodingThreadOptions: { label: string, value: number }[] = [] |
20 | 20 | ||
21 | constructor ( | 21 | constructor ( |
@@ -30,11 +30,30 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
30 | super() | 30 | super() |
31 | 31 | ||
32 | this.resolutions = [ | 32 | this.resolutions = [ |
33 | this.i18n('240p'), | 33 | { |
34 | this.i18n('360p'), | 34 | id: '240p', |
35 | this.i18n('480p'), | 35 | label: this.i18n('240p') |
36 | this.i18n('720p'), | 36 | }, |
37 | this.i18n('1080p') | 37 | { |
38 | id: '360p', | ||
39 | label: this.i18n('360p') | ||
40 | }, | ||
41 | { | ||
42 | id: '480p', | ||
43 | label: this.i18n('480p') | ||
44 | }, | ||
45 | { | ||
46 | id: '720p', | ||
47 | label: this.i18n('720p') | ||
48 | }, | ||
49 | { | ||
50 | id: '1080p', | ||
51 | label: this.i18n('1080p') | ||
52 | }, | ||
53 | { | ||
54 | id: '2160p', | ||
55 | label: this.i18n('2160p') | ||
56 | } | ||
38 | ] | 57 | ] |
39 | 58 | ||
40 | this.transcodingThreadOptions = [ | 59 | this.transcodingThreadOptions = [ |
@@ -140,8 +159,8 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { | |||
140 | } | 159 | } |
141 | } | 160 | } |
142 | for (const resolution of this.resolutions) { | 161 | for (const resolution of this.resolutions) { |
143 | defaultValues.transcoding.resolutions[resolution] = 'false' | 162 | defaultValues.transcoding.resolutions[resolution.id] = 'false' |
144 | formGroupData.transcoding.resolutions[resolution] = null | 163 | formGroupData.transcoding.resolutions[resolution.id] = null |
145 | } | 164 | } |
146 | 165 | ||
147 | this.buildForm(formGroupData) | 166 | this.buildForm(formGroupData) |
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts index 27c416a12..1d12f701b 100644 --- a/server/controllers/api/config.ts +++ b/server/controllers/api/config.ts | |||
@@ -262,7 +262,8 @@ function customConfig (): CustomConfig { | |||
262 | '360p': CONFIG.TRANSCODING.RESOLUTIONS[ '360p' ], | 262 | '360p': CONFIG.TRANSCODING.RESOLUTIONS[ '360p' ], |
263 | '480p': CONFIG.TRANSCODING.RESOLUTIONS[ '480p' ], | 263 | '480p': CONFIG.TRANSCODING.RESOLUTIONS[ '480p' ], |
264 | '720p': CONFIG.TRANSCODING.RESOLUTIONS[ '720p' ], | 264 | '720p': CONFIG.TRANSCODING.RESOLUTIONS[ '720p' ], |
265 | '1080p': CONFIG.TRANSCODING.RESOLUTIONS[ '1080p' ] | 265 | '1080p': CONFIG.TRANSCODING.RESOLUTIONS[ '1080p' ], |
266 | '2160p': CONFIG.TRANSCODING.RESOLUTIONS[ '2160p' ] | ||
266 | }, | 267 | }, |
267 | hls: { | 268 | hls: { |
268 | enabled: CONFIG.TRANSCODING.HLS.ENABLED | 269 | enabled: CONFIG.TRANSCODING.HLS.ENABLED |
diff --git a/server/initializers/config.ts b/server/initializers/config.ts index 50653b0a0..bb278ba43 100644 --- a/server/initializers/config.ts +++ b/server/initializers/config.ts | |||
@@ -156,7 +156,8 @@ const CONFIG = { | |||
156 | get '360p' () { return config.get<boolean>('transcoding.resolutions.360p') }, | 156 | get '360p' () { return config.get<boolean>('transcoding.resolutions.360p') }, |
157 | get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') }, | 157 | get '480p' () { return config.get<boolean>('transcoding.resolutions.480p') }, |
158 | get '720p' () { return config.get<boolean>('transcoding.resolutions.720p') }, | 158 | get '720p' () { return config.get<boolean>('transcoding.resolutions.720p') }, |
159 | get '1080p' () { return config.get<boolean>('transcoding.resolutions.1080p') } | 159 | get '1080p' () { return config.get<boolean>('transcoding.resolutions.1080p') }, |
160 | get '2160p' () { return config.get<boolean>('transcoding.resolutions.2160p') } | ||
160 | }, | 161 | }, |
161 | HLS: { | 162 | HLS: { |
162 | get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') } | 163 | get ENABLED () { return config.get<boolean>('transcoding.hls.enabled') } |
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts index 4cc379b2a..670553d16 100644 --- a/shared/models/server/custom-config.model.ts +++ b/shared/models/server/custom-config.model.ts | |||
@@ -62,6 +62,7 @@ export interface CustomConfig { | |||
62 | '480p': boolean | 62 | '480p': boolean |
63 | '720p': boolean | 63 | '720p': boolean |
64 | '1080p': boolean | 64 | '1080p': boolean |
65 | '2160p': boolean | ||
65 | } | 66 | } |
66 | hls: { | 67 | hls: { |
67 | enabled: boolean | 68 | enabled: boolean |