
The latest Chrome version has stopped video autoplay if the video is not muted. Firefox and the other browsers will soon follow suit. Here’s a quick way to mute the video and autoplay it when the page has loaded:
function toggleMute(element) {
element.muted = true;
element.play()
}
window.addEventListener('load', () => {
setTimeout(() => {
toggleMute(document.querySelector('video'));
}, 1000);
});
That’s it! Enjoy!

Technical SEO Specialist, JavaScript Programmer and Senior Full Stack Developer. On a quest to experiment with Canvas, WebGL, JavaScript, SEO and WordPress, among many other things. Founder of WPDublin and SpeedFactor, co-organizer of Dublin WordPress Meetup group.
If you like this article, go ahead and follow me on Twitter or buy me a coffee to support my work!