amp-video.tpl.php in Accelerated Mobile Pages (AMP) 7
Template for an amp-video.
Available variables:
- video_attributes: The HTML attributes for the amp-video element.
- src: A URL for a video file.
- scheme: A string for the scheme of the video src URL, i.e. http or https.
- fallback_text: A string that will render if the browser is incompatible with the HTML5 video element.
See also
template_preprocess_amp_video()
1 theme call to amp-video.tpl.php
- amp_field_formatter_view in ./
amp.module - Implements hook_field_formatter_view().
File
templates/amp-video.tpl.phpView source
<?php
/**
* @file
* Template for an amp-video.
*
* Available variables:
* - video_attributes: The HTML attributes for the amp-video element.
* - src: A URL for a video file.
* - scheme: A string for the scheme of the video src URL, i.e. http or https.
* - fallback_text: A string that will render if the browser is incompatible
* with the HTML5 video element.
*
* @see template_preprocess_amp_video()
*/
if ($scheme == 'https') {
?>
<amp-video <?php
print $video_attributes;
?> src="<?php
print $src;
?>" layout="responsive" controls>
<div fallback>
<p><?php
print $fallback_text;
?></p>
</div>
</amp-video>
<?php
}