aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/standalone/videos/embed.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/standalone/videos/embed.ts')
-rw-r--r--client/src/standalone/videos/embed.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/client/src/standalone/videos/embed.ts b/client/src/standalone/videos/embed.ts
index 964ec56f3..08f2955cf 100644
--- a/client/src/standalone/videos/embed.ts
+++ b/client/src/standalone/videos/embed.ts
@@ -24,9 +24,18 @@ loadVideoInfo(videoId)
24 const previewUrl = window.location.origin + videoInfo.previewPath 24 const previewUrl = window.location.origin + videoInfo.previewPath
25 videoElement.poster = previewUrl 25 videoElement.poster = previewUrl
26 26
27 let autoplay = false
28
29 try {
30 let params = new URL(window.location.toString()).searchParams
31 autoplay = params.has('autoplay') && (params.get('autoplay') === '1' || params.get('autoplay') === 'true')
32 } catch (err) {
33 console.error('Cannot get params from URL.', err)
34 }
35
27 const videojsOptions = { 36 const videojsOptions = {
28 controls: true, 37 controls: true,
29 autoplay: false, 38 autoplay,
30 inactivityTimeout: 500, 39 inactivityTimeout: 500,
31 plugins: { 40 plugins: {
32 peertube: { 41 peertube: {