Skip to content

Commit

Permalink
fix: Video Autoplay
Browse files Browse the repository at this point in the history
  • Loading branch information
andreituicu committed Apr 3, 2024
1 parent a8a2cf0 commit 9851657
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion blocks/video/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ function getVideoElement(source, autoplay) {
video.setAttribute('controls', '');
video.dataset.loading = 'true';
video.addEventListener('loadedmetadata', () => delete video.dataset.loading);
if (autoplay) video.setAttribute('autoplay', '');
if (autoplay) {
video.muted = true;
video.setAttribute('autoplay', '');
}

const sourceEl = document.createElement('source');
sourceEl.setAttribute('src', source);
Expand Down

0 comments on commit 9851657

Please sign in to comment.