X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-edit%2Fshared%2Fvideo-edit.component.ts;h=26d871e59307484b985916b4aac786bd703804c4;hb=f8c00564e7e66c7c9d65ea044a4c1485df0e4c7c;hp=f04111e69488f7c7a18d8f3866eb4e80ebbc6ba8;hpb=7294aab0c879ef96c0fde15c389a2c4c1463d3c7;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts index f04111e69..26d871e59 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.ts +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.ts @@ -20,10 +20,11 @@ import { import { FormReactiveValidationMessages, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms' import { InstanceService } from '@app/shared/shared-instance' import { VideoCaptionEdit, VideoEdit, VideoService } from '@app/shared/shared-main' -import { ServerConfig, VideoConstant, VideoPrivacy } from '@shared/models' +import { ServerConfig, VideoConstant, LiveVideo, VideoPrivacy } from '@shared/models' import { RegisterClientFormFieldOptions, RegisterClientVideoFieldOptions } from '@shared/models/plugins/register-client-form-field.model' import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' +import { VideoEditType } from './video-edit.type' type VideoLanguages = VideoConstant & { group?: string } @@ -40,7 +41,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { @Input() schedulePublicationPossible = true @Input() videoCaptions: (VideoCaptionEdit & { captionPath?: string })[] = [] @Input() waitTranscodingEnabled = true - @Input() type: 'import-url' | 'import-torrent' | 'upload' | 'update' + @Input() type: VideoEditType + @Input() liveVideo: LiveVideo @ViewChild('videoCaptionAddModal', { static: true }) videoCaptionAddModal: VideoCaptionAddModalComponent @@ -124,7 +126,9 @@ export class VideoEditComponent implements OnInit, OnDestroy { previewfile: null, support: VIDEO_SUPPORT_VALIDATOR, schedulePublicationAt: VIDEO_SCHEDULE_PUBLICATION_AT_VALIDATOR, - originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR + originallyPublishedAt: VIDEO_ORIGINALLY_PUBLISHED_AT_VALIDATOR, + liveStreamKey: null, + saveReplay: null } this.formValidatorService.updateForm( @@ -236,6 +240,10 @@ export class VideoEditComponent implements OnInit, OnDestroy { this.videoCaptionAddModal.show() } + isSaveReplayEnabled () { + return this.serverConfig.live.allowReplay + } + private sortVideoCaptions () { this.videoCaptions.sort((v1, v2) => { if (v1.language.label < v2.language.label) return -1 @@ -320,7 +328,12 @@ export class VideoEditComponent implements OnInit, OnDestroy { const currentSupport = this.form.value[ 'support' ] // First time we set the channel? - if (isNaN(oldChannelId) && !currentSupport) return this.updateSupportField(newChannel.support) + if (isNaN(oldChannelId)) { + // Fill support if it's empty + if (!currentSupport) this.updateSupportField(newChannel.support) + + return + } const oldChannel = this.userVideoChannels.find(c => c.id === oldChannelId) if (!newChannel || !oldChannel) {