)
}
- private async onVideoFetched (video: VideoDetails, videoCaptions: VideoCaption[], startTime = 0) {
+ private async onVideoFetched (video: VideoDetails, videoCaptions: VideoCaption[], startTimeFromUrl: number) {
this.video = video
// Re init attributes
this.completeDescriptionShown = false
this.remoteServerDown = false
+ let startTime = startTimeFromUrl || (this.video.userHistory ? this.video.userHistory.currentTime : 0)
+ // Don't start the video if we are at the end
+ if (this.video.duration - startTime <= 1) startTime = 0
+
if (this.video.isVideoNSFWForUser(this.user, this.serverService.getConfig())) {
const res = await this.confirmService.confirm(
this.i18n('This video contains mature or explicit content. Are you sure you want to watch it?'),
poster: this.video.previewUrl,
startTime,
theaterMode: true,
- language: this.localeId
+ language: this.localeId,
+
+ userWatching: this.user ? {
+ url: this.videoService.getUserWatchingVideoUrl(this.video.uuid),
+ authorizationHeader: this.authService.getRequestHeaderValue()
+ } : undefined
})
if (this.videojsLocaleLoaded === false) {