audioplayer.html.twig 854 B

1234567891011121314151617181920212223
  1. {#
  2. /**
  3. * @file
  4. * Default implementation for Audiofield audio players.
  5. *
  6. * Available variables:
  7. * - plugin_id: the name of the plugin being used for templating.
  8. * - plugin_theme: the name of the specific plugin theme, if it exists.
  9. * - files: array of render info for each file.
  10. * - settings: array of settings for thie player.
  11. *
  12. * @ingroup themeable
  13. */
  14. #}
  15. <div class="audiofield">
  16. {% for file in files %}
  17. <audio preload="{% if settings.audio_player_lazyload == 1 %}none{% else %}auto{% endif %}" controls {% if settings.audio_player_autoplay == 1 %} autoplay {% endif %} {% if settings.download_button != 1 %} controlsList="nodownload" {% endif %}>
  18. <source src="{{ file.url }}" type="audio/mpeg">
  19. Your browser does not support the audio element.
  20. </audio>
  21. <label>{{ file.description }}</label>
  22. {% endfor %}
  23. </div>