You are here

amp-video.html.twig in Accelerated Mobile Pages (AMP) 8

Same filename and directory in other branches
  1. 8.3 templates/amp-video.html.twig
  2. 8.2 templates/amp-video.html.twig

Template for an amp-video.

Available variables:

  • attributes: The HTML attributes for the containing element.
  • src: A URL for a video file.
  • scheme: A string for the scheme of the video src URL, i.e. http or https.

File

templates/amp-video.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Template for an amp-video.
  5. *
  6. * Available variables:
  7. * - attributes: The HTML attributes for the containing element.
  8. * - src: A URL for a video file.
  9. * - scheme: A string for the scheme of the video src URL, i.e. http or https.
  10. *
  11. * @see template_preprocess_amp_video()
  12. */
  13. #}
  14. {% if scheme == 'https' %}
  15. <amp-video{{ attributes }} src="{{ src }}" layout="responsive" controls>
  16. <div fallback>
  17. <p>Your browser doesn’t support HTML5 video</p>
  18. </div>
  19. </amp-video>
  20. {% endif %}