{{ 'section-banner-video-v1.css' | asset_url | stylesheet_tag }}

{%- assign video = section.settings.video -%}

<div {% render 'section-attr' %}>
  <div class='banner-v212'>
    {%- if video != blank -%}
      <xo-video-cover muted loop autoplay class='video' xo-src='{{ video }}'></xo-video-cover>
    {%- else -%}
      <video class='banner-v212__video' src='{{section.settings.video_upload.sources[1].url}}' loop muted playsinline autoplay></video>
    {%- endif -%}
  </div>
</div>

{% schema %}
{
  "name": "t:sections.banner_video_v1.name",
  "settings": [
    {
      "type": "header",
      "content": "t:sections.banner_video_v1.settings.header.content"
    },
    {
      "type": "video_url",
      "id": "video",
      "label": "t:sections.banner_video_v1.settings.video.label",
      "accept": [
        "youtube",
        "vimeo"
      ]
    },
    {
      "type": "video",
      "id": "video_upload",
      "label": "t:sections.banner_video_v1.settings.video_upload.label",
      "info": "t:sections.banner_video_v1.settings.video_info.label"
    },
    {
      "type": "header",
      "content": "t:sections.all.heading.content"
    },
    {
      "type": "color_scheme",
      "id": "color_scheme",
      "label": "t:sections.all.color_scheme.label"
    },
    {
      "type": "color",
      "id": "background_color",
      "label": "t:sections.all.bg_color.label"
    },
    {
      "type": "color_background",
      "id": "background_gradient",
      "label": "t:sections.all.bg_gradient.label"
    },
    {
      "type": "number",
      "id": "padding_top",
      "label": "t:sections.all.padding_top.label",
      "default": 50
    },
    {
      "type": "number",
      "id": "padding_bottom",
      "label": "t:sections.all.padding_bottom.label",
      "default": 50
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_video_v1.presets.name"
    }
  ]
}
{% endschema %}
