import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { LoadingBarService } from '@ngx-loading-bar/core'
import { Component, OnInit } from '@angular/core'
import { ActivatedRoute, Router } from '@angular/router'
import { LoadingBarService } from '@ngx-loading-bar/core'
import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos'
import { ServerService } from '../../core'
import { VideoConstant, VideoPrivacy } from '../../../../../shared/models/videos'
import { ServerService } from '../../core'
import { FormReactive } from '../../shared'
import { VideoEdit } from '../../shared/video/video-edit.model'
import { VideoService } from '../../shared/video/video.service'
import { FormReactive } from '../../shared'
import { VideoEdit } from '../../shared/video/video-edit.model'
import { VideoService } from '../../shared/video/video.service'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { VideoCaptionService } from '@app/shared/video-caption'
import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { FormValidatorService } from '@app/shared/forms/form-validators/form-validator.service'
import { VideoCaptionService } from '@app/shared/video-caption'
import { VideoCaptionEdit } from '@app/shared/video-caption/video-caption-edit.model'
userVideoChannels: { id: number, label: string, support: string }[] = []
schedulePublicationPossible = false
videoCaptions: VideoCaptionEdit[] = []
userVideoChannels: { id: number, label: string, support: string }[] = []
schedulePublicationPossible = false
videoCaptions: VideoCaptionEdit[] = []
protected formValidatorService: FormValidatorService,
private route: ActivatedRoute,
private router: Router,
protected formValidatorService: FormValidatorService,
private route: ActivatedRoute,
private router: Router,
private serverService: ServerService,
private videoService: VideoService,
private serverService: ServerService,
private videoService: VideoService,
// We cannot set private a video that was not private
if (this.video.privacy !== VideoPrivacy.PRIVATE) {
// We cannot set private a video that was not private
if (this.video.privacy !== VideoPrivacy.PRIVATE) {
} else { // We can schedule video publication only if it it is private
this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
}
} else { // We can schedule video publication only if it it is private
this.schedulePublicationPossible = this.video.privacy === VideoPrivacy.PRIVATE
}
+ this.videoPrivacies = this.videoService.explainedPrivacyLabels(this.videoPrivacies)
+
+ const videoFiles = (video as VideoDetails).files
+ if (videoFiles.length > 1) { // Already transcoded
+ this.waitTranscodingEnabled = false
+ }
+
// FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout
setTimeout(() => this.hydrateFormFromVideo())
},
err => {
console.error(err)
// FIXME: Angular does not detect the change inside this subscription, so use the patched setTimeout
setTimeout(() => this.hydrateFormFromVideo())
},
err => {
console.error(err)
this.router.navigate([ '/videos/watch', this.video.uuid ])
},
err => {
this.loadingBar.complete()
this.isUpdatingVideo = false
this.router.navigate([ '/videos/watch', this.video.uuid ])
},
err => {
this.loadingBar.complete()
this.isUpdatingVideo = false