import { PlatformLocation } from '@angular/common'
import { randomInt } from '@shared/core-utils/miscs/miscs'
import { RecommendedVideosComponent } from '../recommendations/recommended-videos.component'
+import { scrollToTop } from '@app/shared/misc/utils'
@Component({
selector: 'my-video-watch',
if (playlistId) this.loadPlaylist(playlistId)
})
- this.queryParamsSub = this.route.queryParams.subscribe(queryParams => {
+ this.queryParamsSub = this.route.queryParams.subscribe(async queryParams => {
const videoId = queryParams[ 'videoId' ]
- if (videoId) this.loadVideo(videoId)
+ if (videoId) await this.loadVideo(videoId)
+
+ const start = queryParams[ 'start' ]
+ if (this.player && start) this.player.currentTime(parseInt(start, 10))
})
this.initHotkeys()
)
}
+ handleTimestampClicked (timestamp: number) {
+ if (this.player) this.player.currentTime(timestamp)
+ scrollToTop()
+ }
+
isPlaylistAutoPlayEnabled () {
return (
(this.user && this.user.autoPlayNextVideoPlaylist) ||