{# TEMPLATE #}
{% set video_attributes = create_attribute() %}
{% set video_class = ['video', 'w-100','h-100', 'vid-upload'] %}
{# {% if controls %} #}
{# {% set video_attributes = video_attributes.setAttribute('isControlled', 'controls') %} #}
{# {% else %} #}
{# {% set video_attributes = video_attributes.setAttribute('isControlled', '') %} #}
{# {% endif %} #}


{% if video is empty and src is not empty %}

  {% if controls %}
  <video controls {{ video_attributes.addClass(video_class) }}>
  {% else %}
  <video {{ video_attributes.addClass(video_class) }}>
  {% endif %}
    <source src="{{ file_url('ws-assets://videos/' ~ src ) }}" type="video/mp4">
    Your browser does not support the video tag.
  </video>

{% else %}
  {{ video }}
{% endif %}

{% if caption is not empty %}
  <div>{{ caption }}</div>
{% endif %}
