aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-04-05 17:06:59 +0200
committerChocobozzz <me@florianbigard.com>2018-04-05 17:12:22 +0200
commitf37bad639b36d35c29a464dc52123a1e7c9cd28a (patch)
tree376ff9d09b091610cb943ee5fd4eebc7a17e4c22 /client/src/app/videos
parent7ee4a4af0b01040e3896453ee68b3d429dc45cd4 (diff)
downloadPeerTube-f37bad639b36d35c29a464dc52123a1e7c9cd28a.tar.gz
PeerTube-f37bad639b36d35c29a464dc52123a1e7c9cd28a.tar.zst
PeerTube-f37bad639b36d35c29a464dc52123a1e7c9cd28a.zip
Add ability to set a start time
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts11
1 files changed, 8 insertions, 3 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 b595ddcb7..df5b8d02d 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -102,7 +102,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
102 if (this.video && this.video.uuid === uuid) return 102 if (this.video && this.video.uuid === uuid) return
103 103
104 this.videoService.getVideo(uuid).subscribe( 104 this.videoService.getVideo(uuid).subscribe(
105 video => this.onVideoFetched(video), 105 video => {
106 const startTime = this.route.snapshot.queryParams.start
107 this.onVideoFetched(video, startTime)
108 .catch(err => this.handleError(err))
109 },
106 110
107 error => { 111 error => {
108 this.videoNotFound = true 112 this.videoNotFound = true
@@ -315,7 +319,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
315 ) 319 )
316 } 320 }
317 321
318 private async onVideoFetched (video: VideoDetails) { 322 private async onVideoFetched (video: VideoDetails, startTime = 0) {
319 this.video = video 323 this.video = video
320 324
321 // Re init attributes 325 // Re init attributes
@@ -350,7 +354,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
350 videoDuration: this.video.duration, 354 videoDuration: this.video.duration,
351 enableHotkeys: true, 355 enableHotkeys: true,
352 peertubeLink: false, 356 peertubeLink: false,
353 poster: this.video.previewUrl 357 poster: this.video.previewUrl,
358 startTime
354 }) 359 })
355 360
356 const self = this 361 const self = this