- getResolutionKey (resolution: string) {
- return 'transcodingResolution' + resolution
- }
-
- ngOnInit () {
- const formGroupData = {
- instanceName: this.customConfigValidatorsService.INSTANCE_NAME,
- instanceShortDescription: this.customConfigValidatorsService.INSTANCE_SHORT_DESCRIPTION,
- instanceDescription: null,
- instanceTerms: null,
- instanceDefaultClientRoute: null,
- instanceDefaultNSFWPolicy: null,
- servicesTwitterUsername: this.customConfigValidatorsService.SERVICES_TWITTER_USERNAME,
- servicesTwitterWhitelisted: null,
- cachePreviewsSize: this.customConfigValidatorsService.CACHE_PREVIEWS_SIZE,
- cacheCaptionsSize: this.customConfigValidatorsService.CACHE_CAPTIONS_SIZE,
- signupEnabled: null,
- signupLimit: this.customConfigValidatorsService.SIGNUP_LIMIT,
- adminEmail: this.customConfigValidatorsService.ADMIN_EMAIL,
- userVideoQuota: this.userValidatorsService.USER_VIDEO_QUOTA,
- transcodingThreads: this.customConfigValidatorsService.TRANSCODING_THREADS,
- transcodingEnabled: null,
- customizationJavascript: null,
- customizationCSS: null
- }
-
- const defaultValues: BuildFormDefaultValues = {}
- for (const resolution of this.resolutions) {
- const key = this.getResolutionKey(resolution)
- defaultValues[key] = 'false'
- formGroupData[key] = null
- }
-
- this.buildForm(formGroupData)
-
- this.configService.getCustomConfig()
- .subscribe(
- res => {
- this.customConfig = res
+ this.resolutions = [
+ {
+ id: '0p',
+ label: this.i18n('Audio-only'),
+ description: this.i18n('A <code>.mp4</code> that keeps the original audio track, with no video')
+ },
+ {
+ id: '240p',
+ label: this.i18n('240p')
+ },
+ {
+ id: '360p',
+ label: this.i18n('360p')
+ },
+ {
+ id: '480p',
+ label: this.i18n('480p')
+ },
+ {
+ id: '720p',
+ label: this.i18n('720p')
+ },
+ {
+ id: '1080p',
+ label: this.i18n('1080p')
+ },
+ {
+ id: '2160p',
+ label: this.i18n('2160p')
+ }
+ ]