aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/video-watch.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-watch/video-watch.component.ts')
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index 4df2c6c5e..7ff860e79 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -53,6 +53,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
53 video: VideoDetails = null 53 video: VideoDetails = null
54 videoCaptions: VideoCaption[] = [] 54 videoCaptions: VideoCaption[] = []
55 55
56 playlistPosition: number
56 playlist: VideoPlaylist = null 57 playlist: VideoPlaylist = null
57 58
58 completeDescriptionShown = false 59 completeDescriptionShown = false
@@ -140,9 +141,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
140 if (playlistId) this.loadPlaylist(playlistId) 141 if (playlistId) this.loadPlaylist(playlistId)
141 }) 142 })
142 143
143 this.queryParamsSub = this.route.queryParams.subscribe(async queryParams => { 144 this.queryParamsSub = this.route.queryParams.subscribe(queryParams => {
144 const videoId = queryParams[ 'videoId' ] 145 this.playlistPosition = queryParams[ 'playlistPosition' ]
145 if (videoId) this.loadVideo(videoId) 146 this.videoWatchPlaylist.updatePlaylistIndex(this.playlistPosition)
146 147
147 const start = queryParams[ 'start' ] 148 const start = queryParams[ 'start' ]
148 if (this.player && start) this.player.currentTime(parseInt(start, 10)) 149 if (this.player && start) this.player.currentTime(parseInt(start, 10))
@@ -335,6 +336,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
335 return genericChannelDisplayName.includes(this.video.channel.displayName) 336 return genericChannelDisplayName.includes(this.video.channel.displayName)
336 } 337 }
337 338
339 onPlaylistVideoFound (videoId: string) {
340 this.loadVideo(videoId)
341 }
342
338 private loadVideo (videoId: string) { 343 private loadVideo (videoId: string) {
339 // Video did not change 344 // Video did not change
340 if (this.video && this.video.uuid === videoId) return 345 if (this.video && this.video.uuid === videoId) return
@@ -392,8 +397,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
392 .subscribe(playlist => { 397 .subscribe(playlist => {
393 this.playlist = playlist 398 this.playlist = playlist
394 399
395 const videoId = this.route.snapshot.queryParams['videoId'] 400 this.videoWatchPlaylist.loadPlaylistElements(playlist, !this.playlistPosition, this.playlistPosition)
396 this.videoWatchPlaylist.loadPlaylistElements(playlist, !videoId)
397 }) 401 })
398 } 402 }
399 403
@@ -458,8 +462,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
458 this.remoteServerDown = false 462 this.remoteServerDown = false
459 this.currentTime = undefined 463 this.currentTime = undefined
460 464
461 this.videoWatchPlaylist.updatePlaylistIndex(video)
462
463 if (this.isVideoBlur(this.video)) { 465 if (this.isVideoBlur(this.video)) {
464 const res = await this.confirmService.confirm( 466 const res = await this.confirmService.confirm(
465 $localize`This video contains mature or explicit content. Are you sure you want to watch it?`, 467 $localize`This video contains mature or explicit content. Are you sure you want to watch it?`,