{% if data.select == "document" %}
{% if data.document is defined and data.document is not empty %}
{% include "blocks/file.html.twig" with {file: data.document} %}
{% endif %}
{% endif %}
{% if data.select == "image" %}
<div class="article-img-container mt-1em">
{% if data.image is defined and data.image is not empty %}
<img src="{{ data.image.formats['600x.webp'] }}" srcset="{{ data.image.formats['300x.webp'] }} 300w, {{ data.image.formats['600x.webp'] }} 600w, {{ data.image.formats['1000x.webp'] }} 1000w" sizes="600px" alt="{{ data.image | copyright_or_description_or_title }}" loading="lazy" width="{{ data.image.fileVersion.properties.width }}" height="{{ data.image.fileVersion.properties.height }}">
{% if data.image.credits and data.image is not null %}
<div class="cgrey fs12 lh16 credit mt-8px">© Crédit Photo
{{ data.image.credits }}</div>
{% endif %}
{% endif %}
</div>
{% endif %}
{% if data.select == "audio" %}
<div class="audio-container br8 mt-1em">
<div>
{{ source("svg/audio-icon.html.twig") }}
</div>
{% if data.audio %}
<audio controls class="mt-24px br8">
<source src="{{ data.audio }}">
Votre navigateur ne supporte pas ce type de fichier.
</audio>
<br>
Voici
<a href="{{ data.audio }}">un lien de téléchargement</a>
{% endif %}
{% if data.audio_credit and data.audio %}
<div class="cgrey fs12 lh16 credit mt-8px">© Crédit Audio
{{ data.audio_credit }}</div>
{% endif %}
</div>
{% endif %}
{# A GARDER AU CAS OU #}
{# {% if data.select == "video" %}
<div class="video-container">
<video width="320" height="240" controls>
<source src="{{ data.video.url }}" type="{{ data.video.fileVersion.mimeType }}">
Votre navigateur ne supporte pas ce type de fichier.
</video>
</div>
{% endif %} #}
{% if data.select == "youtube_link" %}
{% set embed_link = data.youtube_link|replace({'watch?v=' : 'embed/'}) %}
{% set embed_link_splitted = embed_link|split('/') %}
{% set videoID = embed_link_splitted|last %}
{# <div class="youtube_player" videoid="{{ videoID }}" width="560" height="315" theme="theme light" rel="rel 1" controls="controls 1" showinfo="showinfo 1 " autoplay="autoplay 0" mute="mute 1" loop="loop 0" loading="loading 0"></div> TAC #}
<div class="video-responsive mt-1em">
<lite-youtube videoid="{{ videoID }}" class="br8" params="controls=1&start={{ data.timestamp }}&modestbranding=2&rel=0&enablejsapi=1"></lite-youtube>
</div>
{% endif %}