From 21125fb028beb0b4895249ad41641c2e41d0b444 Mon Sep 17 00:00:00 2001 From: Artem <59014136+SLain123@users.noreply.github.com> Date: Wed, 2 Aug 2023 16:14:50 +0300 Subject: [PATCH] Fixes bug with broken autoplay from video component. Closes #5268; (#5270) --- src/dom_components/model/ComponentVideo.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dom_components/model/ComponentVideo.ts b/src/dom_components/model/ComponentVideo.ts index a7056d4529..4147df9bf1 100644 --- a/src/dom_components/model/ComponentVideo.ts +++ b/src/dom_components/model/ComponentVideo.ts @@ -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 @@ -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') : '';