From 6e46de095d7169355dd83030f6ce4a582304153a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 5 Oct 2018 11:15:06 +0200 Subject: Add user history and resume videos --- client/src/app/shared/video/video-thumbnail.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'client/src/app/shared/video/video-thumbnail.component.ts') diff --git a/client/src/app/shared/video/video-thumbnail.component.ts b/client/src/app/shared/video/video-thumbnail.component.ts index 86d8f6f74..ca43700c7 100644 --- a/client/src/app/shared/video/video-thumbnail.component.ts +++ b/client/src/app/shared/video/video-thumbnail.component.ts @@ -22,4 +22,12 @@ export class VideoThumbnailComponent { return this.video.thumbnailUrl } + + getProgressPercent () { + if (!this.video.userHistory) return 0 + + const currentTime = this.video.userHistory.currentTime + + return (currentTime / this.video.duration) * 100 + } } -- cgit v1.2.3