Add poster field to video artwork blueprints

This commit is contained in:
Paul Nicoué 2022-06-03 17:35:16 +02:00
parent c0e9465298
commit f4d9653fe6
3 changed files with 30 additions and 6 deletions

View file

@ -20,9 +20,15 @@
{% for artwork in artworks %}
<figure class="gallery__artwork">
{% if artwork.type == 'video' %}
<video class="gallery__video" controls playsinline preload="metadata">
<source src="{{ artwork.url }}" type="video/mp4" />
</video>
{% if artwork.poster is not empty %}
<video class="gallery__video" data-poster="{{ artwork.poster.toFile.url }}" preload="metadata" controls playsinline>
<source src="{{ artwork.url }}" type="video/mp4"/>
</video>
{% else %}
<video class="gallery__video" preload="metadata" controls playsinline>
<source src="{{ artwork.url }}" type="video/mp4"/>
</video>
{% endif %}
{% endif %}
{% if artwork.type == 'image' %}
<img class="gallery__image" src="{{ artwork.url }}" srcset="{{ artwork.srcset() }}" alt="{{ artwork.alt_text }}">