Skip to content

Commit

Permalink
Fix autoplay for Yuotube videos. Closes #5542
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Dec 7, 2023
1 parent 3faf907 commit b4f5c41
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dom_components/model/ComponentVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class ComponentVideo extends ComponentImage {
controls: true,
color: '',
list: '',
src: '',
rel: 1, // YT related videos
modestbranding: 0, // YT modest branding
sources: [],
Expand Down Expand Up @@ -317,7 +318,7 @@ export default class ComponentVideo extends ComponentImage {
const list = this.get('list');
url += id + (id.indexOf('?') < 0 ? '?' : '');
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' : '';
// Loop works only with playlist enabled
// https://stackoverflow.com/questions/25779966/youtube-iframe-loop-doesnt-work
Expand Down

0 comments on commit b4f5c41

Please sign in to comment.