aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-27 15:59:00 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 16:04:06 +0200
commit11b8762f9c815930982599f4ff90c0db60eaf0ca (patch)
treebfca3003c619559284e00fe804d080e66c3ede12 /client/src/assets/player/utils.ts
parentc9d5c64f98c1f1fe7950de60c58edeaf3ace070d (diff)
downloadPeerTube-11b8762f9c815930982599f4ff90c0db60eaf0ca.tar.gz
PeerTube-11b8762f9c815930982599f4ff90c0db60eaf0ca.tar.zst
PeerTube-11b8762f9c815930982599f4ff90c0db60eaf0ca.zip
Add start at checkbox in share modal
Diffstat (limited to 'client/src/assets/player/utils.ts')
-rw-r--r--client/src/assets/player/utils.ts9
1 files changed, 4 insertions, 5 deletions
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts
index c02e19929..cf4f60f55 100644
--- a/client/src/assets/player/utils.ts
+++ b/client/src/assets/player/utils.ts
@@ -23,9 +23,8 @@ function isMobile () {
23 return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent) 23 return /iPhone|iPad|iPod|Android/i.test(navigator.userAgent)
24} 24}
25 25
26function buildVideoLink (time?: number) { 26function buildVideoLink (time?: number, url?: string) {
27 const baseEmbedPath = window.location.pathname.replace('/embed/', '/watch/') 27 if (!url) url = window.location.origin + window.location.pathname.replace('/embed/', '/watch/')
28 const baseEmbedURL = window.location.origin + baseEmbedPath
29 28
30 if (time) { 29 if (time) {
31 const timeInt = Math.floor(time) 30 const timeInt = Math.floor(time)
@@ -33,10 +32,10 @@ function buildVideoLink (time?: number) {
33 const params = new URLSearchParams(window.location.search) 32 const params = new URLSearchParams(window.location.search)
34 params.set('start', secondsToTime(timeInt)) 33 params.set('start', secondsToTime(timeInt))
35 34
36 return baseEmbedURL + '?' + params.toString() 35 return url + '?' + params.toString()
37 } 36 }
38 37
39 return baseEmbedURL 38 return url
40} 39}
41 40
42function timeToInt (time: number | string) { 41function timeToInt (time: number | string) {