Skip to content

Instantly share code, notes, and snippets.

@lots0logs
Created March 15, 2016 20:52
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lots0logs/66426a98f156484b2bbc to your computer and use it in GitHub Desktop.
Save lots0logs/66426a98f156484b2bbc to your computer and use it in GitHub Desktop.
WordPress :: Divi Builder :: Background Videos :: Mute a video's audio.
<script>
(function($) {
$(document).ready(function() {
var $videos = $('.et_pb_section_video_bg video');
$videos.each(function() {
var $video = $(this)[0];
$video.setMuted();
});
});
})(jQuery);
</script>
@rednoisemedia
Copy link

where would I add this script please?

@cdogden
Copy link

cdogden commented Feb 11, 2017

Anybody get this to work?

@vuongddang
Copy link

vuongddang commented Feb 6, 2018

Adding script to Theme Option -> Integration -> Add code to the < head > of your blog

This works for me (https://stackoverflow.com/questions/42764981/divi-builder-background-video-to-be-muted/45194700#45194700)

<script type="text/javascript">
 jQuery(document).ready(function(){
   jQuery(".et_pb_section_video_bg video").prop('muted', true); 
});
</script>

@RingahDing
Copy link

Script works for me as well

<script type="text/javascript"> jQuery(document).ready(function(){ jQuery(".et_pb_section_video_bg video").prop('muted', true); }); </script>

@aiokaizen
Copy link

This worked for me too, thank you bro.

<script type="text/javascript"> jQuery(document).ready(function(){ jQuery(".et_pb_section_video_bg video").prop('muted', true); }); </script>

@TinyUnicornTeeth
Copy link

This worked for me, thank you so much!

<script type="text/javascript"> jQuery(document).ready(function(){ jQuery(".et_pb_section_video_bg video").prop('muted', true); }); </script>

@Yasintha99
Copy link

@daibangcanhcut Thank you, It worked like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment