You are here

videojs.html.twig in Video.js (HTML5 Video Player) 8

Default theme implementation to display a formatted video field.

Available variables:

  • items: A collection of videos.
  • player_attributes: Player options including the following:
    • width: The width of the video (if known).
    • height: The height of the video (if known).
    • autoplay: Autoplay on or off

File

templates/videojs.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display a formatted video field.
  5. *
  6. * Available variables:
  7. * - items: A collection of videos.
  8. * - player_attributes: Player options including the following:
  9. * - width: The width of the video (if known).
  10. * - height: The height of the video (if known).
  11. * - autoplay: Autoplay on or off
  12. *
  13. * @ingroup themeable
  14. */
  15. #}
  16. <video data-setup="{}" class="video-js vjs-default-skin" preload="{{ player_attributes.preload }}" {{ player_attributes.controls ? 'controls' : '' }} style="width:{{ player_attributes.width }}px;height:{{ player_attributes.height }}px;" {{ player_attributes.autoplay ? 'autoplay' : '' }} {{ player_attributes.loop ? 'loop' : '' }} {{ player_attributes.muted ? 'muted' : '' }}>
  17. {% for user in items %}
  18. <source src="{{ user }}"/>
  19. {% endfor %}
  20. </video>