Skip to content

Commit

Permalink
Fixes bug with broken autoplay from video component. Closes #5268; (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
SLain123 committed Aug 2, 2023
1 parent 0345dcb commit 68fa1dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dom_components/model/ComponentVideo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,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' : '';
url += this.get('autoplay') ? '&autoplay=1&muted=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 Expand Up @@ -346,7 +346,7 @@ export default class ComponentVideo extends ComponentImage {
getVimeoSrc() {
let url = this.get('viUrl') as string;
url += this.get('videoId') + '?';
url += this.get('autoplay') ? '&autoplay=1' : '';
url += this.get('autoplay') ? '&autoplay=1&muted=1' : '';
url += this.get('loop') ? '&loop=1' : '';
url += !this.get('controls') ? '&title=0&portrait=0&badge=0' : '';
url += this.get('color') ? '&color=' + this.get('color') : '';
Expand Down

0 comments on commit 68fa1dc

Please sign in to comment.