Unverified

Name

Autoplay Videos

About

Use with Divi Builder when adding a video to a page with the vido module

Language

Javascript

Rating

Voted: 0 by 0 user(s)

How to Setup Snippet

Step 1 is to add a code module to the page where the video is. This is for code only and wont be seen on the front end Step 2 - Add CSS Class dm-autoplay-btn in the code module Step 3 - Add this Java code to the code module

Codevault

Captivate-Code

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

Website/ Profile URL:

https://captivatewebsites.com.au/

History

Last modified:

09/12/2023

Important Note

This snippet has the following status:

Unverified

This snippet has not been verified, use with caution and at your own risk. See details provided by author in sidebar and click below to find out more.

Autoplay Videos

 
                    
1<script>
2jQuery(document).ready(function($) {
3 var $videoBoxes = $('.dm-autoplay-btn .et_pb_video_box');
4 
5 if ($videoBoxes.length !== 0) {
6 $videoBoxes.find('video')
7 .prop('muted', true)
8 .prop('loop', true)
9 .prop('playsInline', true);
10 
11 $videoBoxes.each(function() {
12 this.querySelector('video').play();
13 });
14 }
15});
16</script>

0

Related Snippets

Please see some snippets below related to this snippet..

JavaScript

Unverified

0

Text fields makes autocomplete off

Added: 1 year ago

Last Updated: 1 year ago

Make text field autocomplete off using the Fluent forms plugin

JavaScript

Public

1

Popup Keyboard Control

Added: 2 years ago

Last Updated: 2 years ago

Designed to allow visitor to navigate between popups (originally triggered by a button in a Unlimited Elements timeline widget).

JavaScript

Unverified

0

Hide elements where link is empty

Added: 1 year ago

Last Updated: 1 year ago

I usually use this in a template where the theme doesn't support hiding fields for example a social media icon where the link is not set for one network e.g. Facbook but it is set for another e.g. Lin...

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Divi Builder

Unverified

1

Desktop Menu : Make Hamburger Menu on Desktop

Added: 7 months ago

Last Updated: 1 month ago

This CSS makes the Desktop Menu appear as Hamburger

Divi Builder

Unverified

1

Desktop Menu : Make Hamburger Menu on Desktop - Remove Bullets

Added: 7 months ago

Last Updated: 1 month ago

This snippet should be used with Make Hamburger Menu on Desktop.

General

Unverified

0

Jumping Header

Added: 6 months ago

Last Updated: 6 months ago

Use this code to prevent the jumping header. See this guide https://quadlayers.com/fix-jumping-header-in-divi/#:~:text=When%20you%20apply%20changes%20to,creates%20the%20jumping%20header%20illusion....