Autoplay and Loop an MP4 with no controls showing.
Using the latest Beta version of Divi 5, I am attempting to show an MP4 product video that autoplays, loops continously, and no shown controls. Only the video should be running continously. I realize that I can just place a background video within a module and have done this technique, but wanted to see if there is a more proper way to do this simple task.
I attempted to follow instructions in a YouTube tutorial from System22 (https://www.youtube.com/watch?v=Q_0TzEoYIGA) using the Video Module and the Code Module along with some Javascript Code. Unfortunately, the video is dated and is designed for Divi 4. I followed the steps anyway to see if it would work. Basically, it involves placing the Divi 5 Video Module in a column, then upload and connect the MP4 video. Once that is done, the video will show on the page with the controls showing. Then to set up proper functions, a Code Module is set up in the same column just below the Video Module, and the javascript is put in as follows:
https://www.learnhowwp.com/how-to-autoplay-videos-in-divi-video-module-and-hide-controls/
<script>
jQuery(document).ready(function() {
    if (jQuery('.lwp-video-autoplay .et_pb_video_box').length !== 0) {
        jQuery('.lwp-video-autoplay .et_pb_video_box').find('video').prop('muted', true);
        jQuery(".lwp-video-autoplay .et_pb_video_box").find('video').attr('loop', 'loop');
        jQuery(".lwp-video-autoplay .et_pb_video_box").find('video').attr('playsInline', '');
Â
        jQuery(".lwp-video-autoplay .et_pb_video_box").each(function() {
            jQuery(this).find('video').get(0).play();
        });
        jQuery('.lwp-video-autoplay .et_pb_video_box').find('video').removeAttr('controls');
    }
});
</script>
I followed the instructions to the letter, but the script does not seem to be working. The video appears in the page as normal, but shows the controls, and does not autoplay or loop.
Any idea what I'm doing wrong?
Mark