aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-08-18 16:04:03 +0200
committerChocobozzz <chocobozzz@cpy.re>2020-08-19 11:30:21 +0200
commit3c6a44a18175b85d2a3e0b7c3e975718833e5345 (patch)
tree3f9f11d9aa25bafc1b57b5d4d58656efa18701ae /client/src/app/+videos
parente79df4eefbeba3e7ab74e17cae1369c80c94b848 (diff)
downloadPeerTube-3c6a44a18175b85d2a3e0b7c3e975718833e5345.tar.gz
PeerTube-3c6a44a18175b85d2a3e0b7c3e975718833e5345.tar.zst
PeerTube-3c6a44a18175b85d2a3e0b7c3e975718833e5345.zip
Fix video playlist resuming
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts14
1 files changed, 7 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 fb89bf6cd..4df2c6c5e 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -362,6 +362,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
362 const queryParams = this.route.snapshot.queryParams 362 const queryParams = this.route.snapshot.queryParams
363 363
364 const urlOptions = { 364 const urlOptions = {
365 resume: queryParams.resume,
366
365 startTime: queryParams.start, 367 startTime: queryParams.start,
366 stopTime: queryParams.stop, 368 stopTime: queryParams.stop,
367 369
@@ -657,16 +659,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
657 const byUrl = urlOptions.startTime !== undefined 659 const byUrl = urlOptions.startTime !== undefined
658 const byHistory = video.userHistory && (!this.playlist || urlOptions.resume !== undefined) 660 const byHistory = video.userHistory && (!this.playlist || urlOptions.resume !== undefined)
659 661
660 if (byUrl) { 662 if (byUrl) return timeToInt(urlOptions.startTime)
661 return timeToInt(urlOptions.startTime) 663 if (byHistory) return video.userHistory.currentTime
662 } else if (byHistory) { 664
663 return video.userHistory.currentTime 665 return 0
664 } else {
665 return 0
666 }
667 } 666 }
668 667
669 let startTime = getStartTime() 668 let startTime = getStartTime()
669
670 // If we are at the end of the video, reset the timer 670 // If we are at the end of the video, reset the timer
671 if (video.duration - startTime <= 1) startTime = 0 671 if (video.duration - startTime <= 1) startTime = 0
672 672