From 80ac2e5548bf5167d2f243a3cb0e993c75456d76 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 28 Jan 2021 16:10:09 +0100 Subject: Support transcoding profile in client admin --- .../edit-custom-config/edit-custom-config.component.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts') 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 @@ import { forkJoin } from 'rxjs' +import { pairwise } from 'rxjs/operators' import { ViewportScroller } from '@angular/common' import { AfterViewChecked, Component, OnInit, ViewChild } from '@angular/core' import { ConfigService } from '@app/+admin/config/shared/config.service' @@ -20,7 +21,6 @@ import { USER_VIDEO_QUOTA_DAILY_VALIDATOR, USER_VIDEO_QUOTA_VALIDATOR } from '@a import { FormReactive, FormValidatorService, SelectOptionsItem } from '@app/shared/shared-forms' import { NgbNav } from '@ng-bootstrap/ng-bootstrap' import { CustomConfig, ServerConfig } from '@shared/models' -import { pairwise } from 'rxjs/operators' @Component({ selector: 'my-edit-custom-config', @@ -39,6 +39,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A transcodingThreadOptions: { label: string, value: number }[] = [] liveMaxDurationOptions: { label: string, value: number }[] = [] + vodTranscodingProfileOptions: string[] = [] + liveTranscodingProfileOptions: string[] = [] + languageItems: SelectOptionsItem[] = [] categoryItems: SelectOptionsItem[] = [] @@ -101,6 +104,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A { value: 8, label: '8' } ] + this.vodTranscodingProfileOptions = [ 'default' ] + this.liveTranscodingProfileOptions = [ 'default' ] + this.liveMaxDurationOptions = [ { value: -1, label: $localize`No limit` }, { value: 1000 * 3600, label: $localize`1 hour` }, @@ -127,6 +133,14 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A return this.serverConfig.live.rtmp.port } + getAvailableTranscodingProfile (type: 'live' | 'vod') { + if (type === 'live') { + return this.serverConfig.live.transcoding.availableProfiles + } + + return this.serverConfig.transcoding.availableProfiles + } + getTotalTranscodingThreads () { const transcodingEnabled = this.form.value['transcoding']['enabled'] const transcodingThreads = this.form.value['transcoding']['threads'] @@ -247,6 +261,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A threads: TRANSCODING_THREADS_VALIDATOR, allowAdditionalExtensions: null, allowAudioFiles: null, + profile: null, resolutions: {}, hls: { enabled: null @@ -266,6 +281,7 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit, A transcoding: { enabled: null, threads: TRANSCODING_THREADS_VALIDATOR, + profile: null, resolutions: {} } }, -- cgit v1.2.3