You are here

uikit-video.html.twig in UIkit Components 8.3

Default theme implementation for a UIkit Video.

Available variables:

  • attributes: HTML attributes to be applied to the video.
  • embed_iframe: A boolean indicating whether to display an iframe for the video.
  • sources: An array of video sources to display. Each video source contains the attributes using the source.attributes variable.

File

templates/components/uikit-video.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for a UIkit Video.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes to be applied to the video.
  8. * - embed_iframe: A boolean indicating whether to display an iframe for the
  9. * video.
  10. * - sources: An array of video sources to display. Each video source contains
  11. * the attributes using the source.attributes variable.
  12. *
  13. * @see \Drupal\uikit_components\Element\UIkitVideo
  14. * @see template_preprocess_uikit_video()
  15. * @see https://getuikit.com/docs/utility#video
  16. *
  17. * @ingroup uikit_components_theme_render
  18. */
  19. #}
  20. {% if embed_iframe %}
  21. <iframe{{ attributes }}></iframe>
  22. {% elseif sources %}
  23. <video{{ attributes }}>
  24. {% for source in sources %}
  25. <source{{ source.attributes }}>
  26. {% endfor %}
  27. </video>
  28. {% endif %}

Related topics