{{ 'section-banner-v9.css' | asset_url | stylesheet_tag }}

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

<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>

{% schema %}
{
  "name": "t:sections.banner_v9.name",
  "settings": [
    {
      "type": "header",
      "content": "Setting layout"
    },
    {
      "type": "select",
      "id": "width",
      "label": "t:sections.all.width.label",
      "default": "box",
      "options": [
        {
          "value": "box",
          "label": "t:sections.all.width.options__1.label"
        },
        {
          "value": "wide",
          "label": "t:sections.all.width.options__2.label"
        },
        {
          "value": "fullwidth",
          "label": "t:sections.all.width.options__3.label"
        }
      ]
    },
    {
      "type": "header",
      "content": "t:sections.banner_v9.settings.header.content"
    },
    {
      "type": "video_url",
      "id": "video",
      "label": "t:sections.banner_v9.settings.video.label",
      "accept": [
        "youtube",
        "vimeo"
      ]
    },
    {
      "type": "video",
      "id": "video_upload",
      "label": "t:sections.banner_v9.settings.video_upload.label",
      "info": "t:sections.banner_v9.settings.video_info.label"
    }
  ],
  "presets": [
    {
      "name": "t:sections.banner_v9.presets.name"
    }
  ]
}
{% endschema %}
