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.ts13
1 files changed, 11 insertions, 2 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 d9c88e972..3a7629cc6 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -38,6 +38,7 @@ import { HooksService } from '@app/core/plugins/hooks.service'
38import { PlatformLocation } from '@angular/common' 38import { PlatformLocation } from '@angular/common'
39import { randomInt } from '@shared/core-utils/miscs/miscs' 39import { randomInt } from '@shared/core-utils/miscs/miscs'
40import { RecommendedVideosComponent } from '../recommendations/recommended-videos.component' 40import { RecommendedVideosComponent } from '../recommendations/recommended-videos.component'
41import { scrollToTop } from '@app/shared/misc/utils'
41 42
42@Component({ 43@Component({
43 selector: 'my-video-watch', 44 selector: 'my-video-watch',
@@ -138,9 +139,12 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
138 if (playlistId) this.loadPlaylist(playlistId) 139 if (playlistId) this.loadPlaylist(playlistId)
139 }) 140 })
140 141
141 this.queryParamsSub = this.route.queryParams.subscribe(queryParams => { 142 this.queryParamsSub = this.route.queryParams.subscribe(async queryParams => {
142 const videoId = queryParams[ 'videoId' ] 143 const videoId = queryParams[ 'videoId' ]
143 if (videoId) this.loadVideo(videoId) 144 if (videoId) await this.loadVideo(videoId)
145
146 const start = queryParams[ 'start' ]
147 if (this.player && start) this.player.currentTime(parseInt(start, 10))
144 }) 148 })
145 149
146 this.initHotkeys() 150 this.initHotkeys()
@@ -284,6 +288,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
284 ) 288 )
285 } 289 }
286 290
291 handleTimestampClicked (timestamp: number) {
292 if (this.player) this.player.currentTime(timestamp)
293 scrollToTop()
294 }
295
287 isPlaylistAutoPlayEnabled () { 296 isPlaylistAutoPlayEnabled () {
288 return ( 297 return (
289 (this.user && this.user.autoPlayNextVideoPlaylist) || 298 (this.user && this.user.autoPlayNextVideoPlaylist) ||