import { forkJoin } from 'rxjs'
import { map } from 'rxjs/operators'
-import { SelectChannelItem } from 'src/types/select-options-item.model'
+import { SelectChannelItem, SelectOptionsItem } from 'src/types/select-options-item.model'
import { ChangeDetectorRef, Component, EventEmitter, Input, NgZone, OnDestroy, OnInit, Output, ViewChild } from '@angular/core'
import { AbstractControl, FormArray, FormControl, FormGroup, Validators } from '@angular/forms'
import { HooksService, PluginService, ServerService } from '@app/core'
import {
HTMLServerConfig,
LiveVideo,
+ LiveVideoLatencyMode,
RegisterClientFormFieldOptions,
RegisterClientVideoFieldOptions,
VideoConstant,
videoCategories: VideoConstant<number>[] = []
videoLicences: VideoConstant<number>[] = []
videoLanguages: VideoLanguages[] = []
+ latencyModes: SelectOptionsItem[] = [
+ {
+ id: LiveVideoLatencyMode.SMALL_LATENCY,
+ label: $localize`Small latency`,
+ description: $localize`Reduce latency to ~15s disabling P2P`
+ },
+ {
+ id: LiveVideoLatencyMode.DEFAULT,
+ label: $localize`Default`,
+ description: $localize`Average latency of 30s`
+ },
+ {
+ id: LiveVideoLatencyMode.HIGH_LATENCY,
+ label: $localize`High latency`,
+ description: $localize`Average latency of 60s increasing P2P ratio`
+ }
+ ]
pluginDataFormGroup: FormGroup
originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR,
liveStreamKey: null,
permanentLive: null,
+ latencyMode: null,
saveReplay: null
}
this.trackChannelChange()
this.trackPrivacyChange()
- this.trackLivePermanentFieldChange()
this.formBuilt.emit()
}
return this.form.value['permanentLive'] === true
}
+ isLatencyModeEnabled () {
+ return this.serverConfig.live.latencySetting.enabled
+ }
+
isPluginFieldHidden (pluginField: PluginField) {
if (typeof pluginField.commonOptions.hidden !== 'function') return false
)
}
- private trackLivePermanentFieldChange () {
- // We will update the "support" field depending on the channel
- this.form.controls['permanentLive']
- .valueChanges
- .subscribe(
- permanentLive => {
- const saveReplayControl = this.form.controls['saveReplay']
-
- if (permanentLive === true) {
- saveReplayControl.setValue(false)
- saveReplayControl.disable()
- } else {
- saveReplayControl.enable()
- }
- }
- )
- }
-
private updateSupportField (support: string) {
return this.form.patchValue({ support: support || '' })
}