import { VideoReportComponent } from './modal/video-report.component'
import { VideoShareComponent } from './modal/video-share.component'
import { getVideojsOptions } from '../../../assets/player/peertube-player'
+import { ServerService } from '@app/core'
@Component({
selector: 'my-video-watch',
otherVideosDisplayed: Video[] = []
+ syndicationItems = {}
+
player: videojs.Player
playerElement: HTMLVideoElement
userRating: UserVideoRateType = null
private confirmService: ConfirmService,
private metaService: MetaService,
private authService: AuthService,
+ private serverService: ServerService,
private notificationsService: NotificationsService,
private markdownService: MarkdownService,
private zone: NgZone,
}
const uuid = routeParams['uuid']
- // Video did not changed
+ // Video did not change
if (this.video && this.video.uuid === uuid) return
-
+ // Video did change
this.videoService.getVideo(uuid).subscribe(
- video => this.onVideoFetched(video),
+ video => {
+ const startTime = this.route.snapshot.queryParams.start
+ this.onVideoFetched(video, startTime)
+ .catch(err => this.handleError(err))
+ this.generateSyndicationList()
+ },
error => {
this.videoNotFound = true
return this.video.tags.join(', ')
}
+ generateSyndicationList () {
+ this.syndicationItems = this.videoService.getAccountFeedUrls(this.video.account.id)
+ }
+
isVideoRemovable () {
return this.video.isRemovableBy(this.authService.getUser())
}
)
}
- private async onVideoFetched (video: VideoDetails) {
+ private async onVideoFetched (video: VideoDetails, startTime = 0) {
this.video = video
// Re init attributes
this.updateOtherVideosDisplayed()
- if (this.video.isVideoNSFWForUser(this.user)) {
+ if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) {
const res = await this.confirmService.confirm(
'This video contains mature or explicit content. Are you sure you want to watch it?',
'Mature or explicit content'
videoDuration: this.video.duration,
enableHotkeys: true,
peertubeLink: false,
- poster: this.video.previewUrl
+ poster: this.video.previewUrl,
+ startTime
})
const self = this