{% set video = block.videoAsset.one() %}
{% set poster = block.poster.one() %}
{% set width = block.width.value ?? block.width ?? 'textColumnWidth' %}
{% set widthClass = width == 'columnWidth' ? 'max-w-[1180px]' : 'max-w-[980px]' %}

{% if video %}
<section class="py-m">
    <div class="container">
        <div class="mx-auto w-full {{ widthClass }}">
            <video class="aspect-video w-full rounded-sm bg-navy object-cover"
                {% if poster %}poster="{{ poster.getUrl({ width: 1200 }) }}"{% endif %}
                {% if block.autoplay %}autoplay muted playsinline{% endif %}
                {% if block.showControls %}controls{% endif %}
                {% if block.loop %}loop{% endif %}>
                <source src="{{ video.url }}" type="{{ video.mimeType ?? 'video/mp4' }}">
            </video>
        </div>
    </div>
</section>
{% endif %}
