From 1f6824c958440ace14f7c7f83c890b848a71f5d9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 16 Jul 2018 16:13:35 +0200 Subject: Improve start time param Can handle 2m42s for example --- client/src/standalone/videos/embed.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'client/src/standalone/videos/embed.ts') diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts index 1275998b8..b2809467d 100644 --- a/client/src/standalone/videos/embed.ts +++ b/client/src/standalone/videos/embed.ts @@ -159,7 +159,7 @@ class PeerTubeEmbed { muted = false loop = false enableApi = false - startTime = 0 + startTime: number | string = 0 scope = 'peertube' static async main () { @@ -246,9 +246,7 @@ class PeerTubeEmbed { this.scope = this.getParamString(params, 'scope', this.scope) const startTimeParamString = params.get('start') - const startTimeParamNumber = parseInt(startTimeParamString, 10) - - if (isNaN(startTimeParamNumber) === false) this.startTime = startTimeParamNumber + if (startTimeParamString) this.startTime = startTimeParamString } catch (err) { console.error('Cannot get params from URL.', err) } -- cgit v1.2.3