import * as videojs from 'video.js'
import 'videojs-hotkeys'
import * as WebTorrent from 'webtorrent'
-import { ResultList, UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared'
+import { UserVideoRateType, VideoPrivacy, VideoRateType, VideoState } from '../../../../../shared'
import '../../../assets/player/peertube-videojs-plugin'
import { AuthService, ConfirmService } from '../../core'
import { RestExtractor, VideoBlacklistService } from '../../shared'
import { VideoDownloadComponent } from './modal/video-download.component'
import { VideoReportComponent } from './modal/video-report.component'
import { VideoShareComponent } from './modal/video-share.component'
+import { VideoBlacklistComponent } from './modal/video-blacklist.component'
import { addContextMenu, getVideojsOptions, loadLocale } from '../../../assets/player/peertube-player'
import { ServerService } from '@app/core'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
import { VideoCaptionService } from '@app/shared/video-caption'
import { VideoCaption } from '../../../../../shared/models/videos/video-caption.model'
-import { VideoJSCaption } from '../../../assets/player/peertube-videojs-typings'
@Component({
selector: 'my-video-watch',
@ViewChild('videoShareModal') videoShareModal: VideoShareComponent
@ViewChild('videoReportModal') videoReportModal: VideoReportComponent
@ViewChild('videoSupportModal') videoSupportModal: VideoSupportComponent
+ @ViewChild('videoBlacklistModal') videoBlacklistModal: VideoBlacklistComponent
otherVideosDisplayed: Video[] = []
}
}
- async blacklistVideo (event: Event) {
- event.preventDefault()
-
- const res = await this.confirmService.confirm(this.i18n('Do you really want to blacklist this video?'), this.i18n('Blacklist'))
- if (res === false) return
-
- this.videoBlacklistService.blacklistVideo(this.video.id)
- .subscribe(
- () => {
- this.notificationsService.success(
- this.i18n('Success'),
- this.i18n('Video {{videoName}} had been blacklisted.', { videoName: this.video.name })
- )
- this.redirectService.redirectToHomepage()
- },
-
- error => this.notificationsService.error(this.i18n('Error'), error.message)
- )
- }
-
showMoreDescription () {
if (this.completeVideoDescription === undefined) {
return this.loadCompleteDescription()
this.videoDownloadModal.show()
}
+ showBlacklistModal (event: Event) {
+ event.preventDefault()
+ this.videoBlacklistModal.show()
+ }
+
isUserLoggedIn () {
return this.authService.isLoggedIn()
}
return this.video && this.video.state.id === VideoState.TO_TRANSCODE
}
+ isVideoToImport () {
+ return this.video && this.video.state.id === VideoState.TO_IMPORT
+ }
+
hasVideoScheduledPublication () {
return this.video && this.video.scheduledUpdate !== undefined
}