Why isn't my custom section video playing on Dawn theme?

PrimeMeats
Tourist
4 0 1

my video player is not playing videos and the controls seem to be greyed out

PrimeMeats_0-1715218479651.png

 

 

 

 

{% schema %}
{
  "name": "VideoHeaderPersonalizado",
  "settings": [
    {
  "type": "video",
  "id": "video",
  "label": "self-hosted video"
},
    {
      "type": "url",
      "id": "VideoLink",
      "label": "Video Link"
    }
  ],
  "presets": [
    {
      "name": "VideoHeaderPersonalizado"
    }
  ]
}
{% endschema %}

  <div class="videoContainer">
<a href="{{ section.settings.VideoLink}}" {% if section.settings.VideoLink == blank %}style="pointer-events: none;"{% endif %}>
  <video class="HeaderVideo" src="{{ section.settings.video | video_tag: autoplay: false, loop: false, muted: true, controls: true, image_size:'1902x684' }}"></video>
</a>
  </div>

<style>
.videoContainer{
border: 2px solid white;
}

video.HeaderVideo {
    width: 100%;
    object-fit: cover;
    height: 800px;
}


</style>

 

 

 

 

Reply 1 (1)

Made4uo-Ribe
Shopify Partner
6104 1467 1808

Hi @PrimeMeats 

 

The problem was you were adding two video tags in your code. I fix the code, please see below. I am not sure what the a tag for but I comment it out. 

 

<style>
  .videoContainer{
  border: 2px solid white;
  }

  video.HeaderVideo {
      width: 100%;
      object-fit: cover;
      height: 800px;
  }
</style>

<div class="videoContainer">
  <!--
    <a
      href="{{ section.settings.VideoLink}}"
      {% if section.settings.VideoLink == blank %}
        style="pointer-events: none;"
      {% endif %}
    >
    </a>
  -->
  {{
    section.settings.video
    | video_tag: autoplay: false, loop: false, muted: true, controls: true, image_size: '1902x684', class: 'HeaderVideo'
  }}
</div>

{% schema %}
{
  "name": "VideoHeaderPersonalizado",
  "settings": [
    {
  "type": "video",
  "id": "video",
  "label": "self-hosted video"
},
    {
      "type": "url",
      "id": "VideoLink",
      "label": "Video Link"
    }
  ],
  "presets": [
    {
      "name": "VideoHeaderPersonalizado"
    }
  ]
}
{% endschema %}
Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com