diff options
Diffstat (limited to 'client/src/app/+videos/+video-edit/shared/video-edit.component.ts')
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.ts | 14 |
1 files changed, 11 insertions, 3 deletions
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 99f8c9034..0275f66f5 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 | |||
@@ -35,10 +35,11 @@ import { | |||
35 | } from '@shared/models' | 35 | } from '@shared/models' |
36 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' | 36 | import { I18nPrimengCalendarService } from './i18n-primeng-calendar.service' |
37 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' | 37 | import { VideoCaptionAddModalComponent } from './video-caption-add-modal.component' |
38 | import { VideoCaptionEditModalComponent } from './video-caption-edit-modal/video-caption-edit-modal.component' | 38 | import { VideoCaptionEditModalContentComponent } from './video-caption-edit-modal-content/video-caption-edit-modal-content.component' |
39 | import { VideoEditType } from './video-edit.type' | 39 | import { VideoEditType } from './video-edit.type' |
40 | import { VideoSource } from '@shared/models/videos/video-source' | 40 | import { VideoSource } from '@shared/models/videos/video-source' |
41 | import { logger } from '@root-helpers/logger' | 41 | import { logger } from '@root-helpers/logger' |
42 | import { NgbModal } from '@ng-bootstrap/ng-bootstrap' | ||
42 | 43 | ||
43 | type VideoLanguages = VideoConstant<string> & { group?: string } | 44 | type VideoLanguages = VideoConstant<string> & { group?: string } |
44 | type PluginField = { | 45 | type PluginField = { |
@@ -70,7 +71,6 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
70 | @Input() liveVideo: LiveVideo | 71 | @Input() liveVideo: LiveVideo |
71 | 72 | ||
72 | @ViewChild('videoCaptionAddModal', { static: true }) videoCaptionAddModal: VideoCaptionAddModalComponent | 73 | @ViewChild('videoCaptionAddModal', { static: true }) videoCaptionAddModal: VideoCaptionAddModalComponent |
73 | @ViewChild('videoCaptionEditModal', { static: true }) editCaptionModal: VideoCaptionEditModalComponent | ||
74 | 74 | ||
75 | @Output() formBuilt = new EventEmitter<void>() | 75 | @Output() formBuilt = new EventEmitter<void>() |
76 | @Output() pluginFieldsAdded = new EventEmitter<void>() | 76 | @Output() pluginFieldsAdded = new EventEmitter<void>() |
@@ -128,7 +128,8 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
128 | private i18nPrimengCalendarService: I18nPrimengCalendarService, | 128 | private i18nPrimengCalendarService: I18nPrimengCalendarService, |
129 | private ngZone: NgZone, | 129 | private ngZone: NgZone, |
130 | private hooks: HooksService, | 130 | private hooks: HooksService, |
131 | private cd: ChangeDetectorRef | 131 | private cd: ChangeDetectorRef, |
132 | private modalService: NgbModal | ||
132 | ) { | 133 | ) { |
133 | this.calendarTimezone = this.i18nPrimengCalendarService.getTimezone() | 134 | this.calendarTimezone = this.i18nPrimengCalendarService.getTimezone() |
134 | this.calendarDateFormat = this.i18nPrimengCalendarService.getDateFormat() | 135 | this.calendarDateFormat = this.i18nPrimengCalendarService.getDateFormat() |
@@ -286,6 +287,13 @@ export class VideoEditComponent implements OnInit, OnDestroy { | |||
286 | this.videoCaptionAddModal.show() | 287 | this.videoCaptionAddModal.show() |
287 | } | 288 | } |
288 | 289 | ||
290 | openEditCaptionModal (videoCaption: VideoCaptionWithPathEdit) { | ||
291 | const modalRef = this.modalService.open(VideoCaptionEditModalContentComponent, { centered: true, keyboard: false }) | ||
292 | modalRef.componentInstance.videoCaption = videoCaption | ||
293 | modalRef.componentInstance.serverConfig = this.serverConfig | ||
294 | modalRef.componentInstance.captionEdited.subscribe(this.onCaptionEdited.bind(this)) | ||
295 | } | ||
296 | |||
289 | isSaveReplayEnabled () { | 297 | isSaveReplayEnabled () { |
290 | return this.serverConfig.live.allowReplay | 298 | return this.serverConfig.live.allowReplay |
291 | } | 299 | } |