Browse Source

Fix autoplay for Yuotube videos. Closes #5542

pull/5559/head
Artur Arseniev 2 years ago
parent
commit
b4f5c41e8e
  1. 3
      src/dom_components/model/ComponentVideo.ts

3
src/dom_components/model/ComponentVideo.ts

@ -30,6 +30,7 @@ export default class ComponentVideo extends ComponentImage {
controls: true, controls: true,
color: '', color: '',
list: '', list: '',
src: '',
rel: 1, // YT related videos rel: 1, // YT related videos
modestbranding: 0, // YT modest branding modestbranding: 0, // YT modest branding
sources: [], sources: [],
@ -317,7 +318,7 @@ export default class ComponentVideo extends ComponentImage {
const list = this.get('list'); const list = this.get('list');
url += id + (id.indexOf('?') < 0 ? '?' : ''); url += id + (id.indexOf('?') < 0 ? '?' : '');
url += list ? `&list=${list}` : ''; url += list ? `&list=${list}` : '';
url += this.get('autoplay') ? '&autoplay=1&muted=1' : ''; url += this.get('autoplay') ? '&autoplay=1&mute=1' : '';
url += !this.get('controls') ? '&controls=0&showinfo=0' : ''; url += !this.get('controls') ? '&controls=0&showinfo=0' : '';
// Loop works only with playlist enabled // Loop works only with playlist enabled
// https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work // https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work

Loading…
Cancel
Save