I would like to change this of the click with a button. I would like it to be lige a toggle so that the sound can be muted and unmuted:
<div class="video-player" data-property="{videoURL:'<?php echo $shop_isle_yt_link; ?>', containment:'.module-video', startAt:0, **mute:false**, autoPlay:true, loop:true, opacity:1, showControls:false, showYTLogo:false, vol:25}"></div>
to
<div class="video-player" data-property="{videoURL:'<?php echo $shop_isle_yt_link; ?>', containment:'.module-video', startAt:0, **mute:true**, autoPlay:true, loop:true, opacity:1, showControls:false, showYTLogo:false, vol:25}"></div>
I tried like this:
?>
<!-- Youtube player start-->
<div class="video-player" data-property="{videoURL:'<?php echo $shop_isle_yt_link; ?>', containment:'.module-video', startAt:0, mute:true, autoPlay:true, loop:true, opacity:1, showControls:false, showYTLogo:false, vol:25}"></div>
<!-- Youtube player end -->
<?php
echo '</section>';
endif; /* END VIDEO */
?>
<script>
$(document).ready(function(){
$("#mutebutton").click(function(){
$(".video-player").replaceWith('<div class="video-player" data-property="{videoURL:'<?php echo $shop_isle_yt_link; ?>', containment:'.module-video', startAt:0, mute:false, autoPlay:true, loop:true, opacity:1, showControls:false, showYTLogo:false, vol:25}"></div>');
});
});
</script>
<button id="mutebutton">Mute / unmute</button>