import { Component, HostListener, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { Notifier } from '@app/core'
-import { FormReactive, FormValidatorService } from '@app/shared/shared-forms'
+import { FormReactive, FormValidatorService, SelectChannelItem } from '@app/shared/shared-forms'
import { VideoCaptionEdit, VideoCaptionService, VideoDetails, VideoEdit, VideoService } from '@app/shared/shared-main'
import { LoadingBarService } from '@ngx-loading-bar/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
video: VideoEdit
isUpdatingVideo = false
- userVideoChannels: { id: number, label: string, support: string }[] = []
+ userVideoChannels: SelectChannelItem[] = []
schedulePublicationPossible = false
videoCaptions: VideoCaptionEdit[] = []
waitTranscodingEnabled = true
this.video.patch(this.form.value)
- this.loadingBar.start()
+ this.loadingBar.useRef().start()
this.isUpdatingVideo = true
// Update the video
() => {
this.updateDone = true
this.isUpdatingVideo = false
- this.loadingBar.complete()
+ this.loadingBar.useRef().complete()
this.notifier.success(this.i18n('Video updated.'))
this.router.navigate([ '/videos/watch', this.video.uuid ])
},
err => {
- this.loadingBar.complete()
+ this.loadingBar.useRef().complete()
this.isUpdatingVideo = false
this.notifier.error(err.message)
console.error(err)