aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-16 16:13:35 +0200
committerChocobozzz <me@florianbigard.com>2018-07-16 16:13:35 +0200
commit1f6824c958440ace14f7c7f83c890b848a71f5d9 (patch)
treef8bd7853f4283bfe72745f5ac491b93a3e618276 /client/src/standalone/videos
parent329d9086601b7ae2127be12166ee8c892c289c6e (diff)
downloadPeerTube-1f6824c958440ace14f7c7f83c890b848a71f5d9.tar.gz
PeerTube-1f6824c958440ace14f7c7f83c890b848a71f5d9.tar.zst
PeerTube-1f6824c958440ace14f7c7f83c890b848a71f5d9.zip
Improve start time param
Can handle 2m42s for example
Diffstat (limited to 'client/src/standalone/videos')
-rw-r--r--client/src/standalone/videos/embed.ts6
1 files changed, 2 insertions, 4 deletions
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 {
159 muted = false 159 muted = false
160 loop = false 160 loop = false
161 enableApi = false 161 enableApi = false
162 startTime = 0 162 startTime: number | string = 0
163 scope = 'peertube' 163 scope = 'peertube'
164 164
165 static async main () { 165 static async main () {
@@ -246,9 +246,7 @@ class PeerTubeEmbed {
246 this.scope = this.getParamString(params, 'scope', this.scope) 246 this.scope = this.getParamString(params, 'scope', this.scope)
247 247
248 const startTimeParamString = params.get('start') 248 const startTimeParamString = params.get('start')
249 const startTimeParamNumber = parseInt(startTimeParamString, 10) 249 if (startTimeParamString) this.startTime = startTimeParamString
250
251 if (isNaN(startTimeParamNumber) === false) this.startTime = startTimeParamNumber
252 } catch (err) { 250 } catch (err) {
253 console.error('Cannot get params from URL.', err) 251 console.error('Cannot get params from URL.', err)
254 } 252 }