Sound Enable/Disable Setting For Video

Tourist
16 0 1

Hello,

I'm trying to figure out how to get the sound enable checkbox to work for my video section. I want to use my youtube video which contains sound, and toggle the sound off via the section setting. Currently the video plays with sound and the checkbox doesn't work. Attached is a photo of the settings section and code. I'm not sure what part I should be modifying to make it work.

 

<div class="item-onepage-background">
      <div class="video">
        <div class="video__iframe loaded">
          <iframe class="slideshow__video" tabindex="-1" frameborder="0" allowfullscreen="1" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" title="YouTube video player" width="640" height="360" src="https://www.youtube.com/embed/{{ block.settings.id_link_video }}?iv_load_policy=3&amp;modestbranding=1&amp;autoplay=1&amp;loop=1&amp;controls=0&amp;showinfo=0&amp;wmode=opaque&amp;branding=0&amp;autohide=0&amp;rel=0&amp;enablejsapi=1&amp;playlist={{ block.settings.id_link_video }}" data-enable-sound="{{ block.settings.enable_sound }}" style="visibility: visible;"></iframe>
        </div>
      </div>
  	</div>
{
        "type": "block_video_onepage",
        "name": "Add block video",
        "settings": [
          {
            "type": "text",
            "id": "id_link_video",
            "label": "ID Link Video Embed",
            "default": "",
	    	"info": "Video youtube"
          },
    	  {
      		"type": "checkbox",
      		"id": "enable_sound",
      		"label": "Enable sound",
      		"default": false
    	  }

 

Screen Shot 2020-01-08 at 2.20.25 AM.jpg

0 Likes