media-audio.html.twig in Media entity audio 8.3
Default theme implementation for an audio.
Available variables:
- sources: list of audio sources
- attributes: HTML attributes to be applied to the list.
See also
1 theme call to media-audio.html.twig
- AudioStreamHTML5::viewElements in src/
Plugin/ Field/ FieldFormatter/ AudioStreamHTML5.php - Builds a renderable array for a field value.
File
templates/media-audio.html.twigView source
- {#
- /**
- * @file
- * Default theme implementation for an audio.
- *
- * Available variables:
- * - sources: list of audio sources
- * - attributes: HTML attributes to be applied to the list.
- *
- * @see template_preprocess_media_audio()
- *
- * @ingroup themeable
- */
- #}
- <audio {{ attributes }}>
- {%- for source in sources -%}
- {%- if source.type -%}
- <source src="{{ source.url }}" type="{{ source.type }}">
- {%- else -%}
- <source src="{{ source.url }}">
- {%- endif -%}
- {%- endfor -%}
- </audio>