You are here

file-video.html.twig in Drupal 9

Default theme implementation to display the file entity as a video tag.

Available variables:

  • attributes: An array of HTML attributes, intended to be added to the video tag.
  • files: And array of files to be added as sources for the video tag. Each element is an array with the following elements:

    • file: The full file object.
    • source_attributes: An array of HTML attributes for to be added to the source tag.

File

core/themes/starterkit_theme/templates/field/file-video.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display the file entity as a video tag.
  5. *
  6. * Available variables:
  7. * - attributes: An array of HTML attributes, intended to be added to the
  8. * video tag.
  9. * - files: And array of files to be added as sources for the video tag. Each
  10. * element is an array with the following elements:
  11. * - file: The full file object.
  12. * - source_attributes: An array of HTML attributes for to be added to the
  13. * source tag.
  14. *
  15. * @ingroup themeable
  16. */
  17. #}
  18. {{ attach_library('starterkit_theme/file') }}
  19. <video {{ attributes }}>
  20. {% for file in files %}
  21. <source {{ file.source_attributes }} />
  22. {% endfor %}
  23. </video>

Related topics