+ isVideoRemovable () {
+ return this.video.isRemovableBy(this.authService.getUser())
+ }
+
+ async removeVideo (event: Event) {
+ event.preventDefault()
+
+ const res = await this.confirmService.confirm(this.i18n('Do you really want to delete this video?'), this.i18n('Delete'))
+ if (res === false) return
+
+ this.videoService.removeVideo(this.video.id)
+ .subscribe(
+ status => {
+ this.notificationsService.success(
+ this.i18n('Success'),
+ this.i18n('Video {{videoName}} deleted.', { videoName: this.video.name })
+ )
+
+ // Go back to the video-list.
+ this.redirectService.redirectToHomepage()
+ },
+
+ error => this.notificationsService.error(this.i18n('Error'), error.message)
+ )
+ }
+
+ acceptedPrivacyConcern () {
+ peertubeLocalStorage.setItem(VideoWatchComponent.LOCAL_STORAGE_PRIVACY_CONCERN_KEY, 'true')
+ this.hasAlreadyAcceptedPrivacyConcern = true
+ }
+
+ isVideoToTranscode () {
+ return this.video && this.video.state.id === VideoState.TO_TRANSCODE
+ }
+
+ hasVideoScheduledPublication () {
+ return this.video && this.video.scheduledUpdate !== undefined
+ }
+