Add poster field to video artwork blueprints
This commit is contained in:
parent
c0e9465298
commit
f4d9653fe6
3 changed files with 30 additions and 6 deletions
|
@ -9,6 +9,24 @@ fields:
|
|||
en: Alternative text
|
||||
fr: Texte alternatif
|
||||
type: text
|
||||
poster:
|
||||
when:
|
||||
file_type: video
|
||||
label:
|
||||
en: Poster
|
||||
fr: Vignette
|
||||
type: files
|
||||
uploads: image
|
||||
layout: cards
|
||||
image:
|
||||
ratio: 16/9
|
||||
cover: true
|
||||
back: white
|
||||
multiple: false
|
||||
help:
|
||||
en: "Image displayed before video playback (format: JPEG or PNG). The first image of the video is used if this field is empty."
|
||||
fr: "Image affichée avant la lecture de la vidéo (format : JPEG ou PNG). La première image de la vidéo est utilisée si ce champ est vide."
|
||||
width: 1/4
|
||||
caption:
|
||||
label:
|
||||
en: Caption
|
||||
|
|
|
@ -20,9 +20,15 @@
|
|||
{% for artwork in artworks %}
|
||||
<figure class="gallery__artwork">
|
||||
{% if artwork.type == 'video' %}
|
||||
<video class="gallery__video" controls playsinline preload="metadata">
|
||||
{% 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 }}">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue