{% load i18n cms_tags %}
{% comment %}
This is a copy of original template from plugin just to clean <iframe> from
obsolete attribute "frameborder" and invalid "allowfullscreen" attribute value.
{% endcomment %}

{% if instance.embed_link %}
    {# show iframe if embed_link is provided #}
    <div class="aspect-ratio">
        <iframe src="{{ instance.embed_link_with_parameters }}" {{ instance.attributes_str }} allowfullscreen></iframe>
    </div>
    {% with disabled=instance.embed_link %}
        {% for plugin in instance.child_plugin_instances %}
            {% render_plugin plugin %}
        {% endfor %}
    {% endwith %}
{% else %}
    {# render <source> or <track> plugins #}
    <video controls {{ instance.attributes_str }}
        {% if instance.poster %} poster="{{ instance.poster.url }}"{% endif %}>
        {% for plugin in instance.child_plugin_instances %}
            {% render_plugin plugin %}
        {% endfor %}
        {% trans "Your browser doesn't support this video format." %}
    </video>
{% endif %}

{% comment %}
    # Available variables:
    {{ instance.template }}
    {{ instance.label }}
    {{ instance.embed_link }}
    {{ instance.poster }}
    {{ instance.attributes_str }}
{% endcomment %}
