How to make a video autoplay on page load - Divi (Also Let us make the video loop)

Опубликовано: 08 Июнь 2026
на канале: VRYN STUDIOS
572
10

This tutorial teaches you how to autoplay a video inside video module in Divi. Additionally it teaches you to loop too.

#divi #wordpress #autoplay #video #loop

Script used in this video (Please remember to add script tag around it)

document.addEventListener("DOMContentLoaded", function() {
var videoBoxes = document.querySelectorAll('.dm-autoplay-btn .et_pb_video_box');
if (videoBoxes.length !== 0) {
videoBoxes.forEach(function(videoBox) {
var video = videoBox.querySelector('video');
if (video) {
video.muted = true;
video.loop = true;
video.setAttribute('playsInline', '');
video.play();
}
});
}
});