mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add autoplay parameter in embed
This commit is contained in:
@@ -24,9 +24,18 @@ loadVideoInfo(videoId)
|
||||
const previewUrl = window.location.origin + videoInfo.previewPath
|
||||
videoElement.poster = previewUrl
|
||||
|
||||
let autoplay = false
|
||||
|
||||
try {
|
||||
let params = new URL(window.location.toString()).searchParams
|
||||
autoplay = params.has('autoplay') && (params.get('autoplay') === '1' || params.get('autoplay') === 'true')
|
||||
} catch (err) {
|
||||
console.error('Cannot get params from URL.', err)
|
||||
}
|
||||
|
||||
const videojsOptions = {
|
||||
controls: true,
|
||||
autoplay: false,
|
||||
autoplay,
|
||||
inactivityTimeout: 500,
|
||||
plugins: {
|
||||
peertube: {
|
||||
|
||||
Reference in New Issue
Block a user