Omphaloskepsis-2/layouts/partials/media/video.html.tmpl
2024-07-23 10:08:36 +02:00

27 lines
817 B
Cheetah

<!--
Render a video in an interactive player.
@params context Video media file.
@params page_file_path Filepath of the calling file for error messages.
-->
{{- $src := .src -}}
<video
class="u-video figure__video"
controls
itemprop="video"
src="{{ $src.RelPermalink }}"
poster="
{{- if $src.Params.poster -}}
{{- $posterSrc := $.Page.Resources.GetMatch ( .Get $src.Params.poster ) -}}
{{- with $posterSrc.Resize "1200x webp" -}}
{{- .RelPermalink -}}
{{- end -}}
{{- else -}}
{{- erroridf "a11y-video-poster" "No poster defined for resource %q (%q)" $src.RelPermalink .page_file_path -}}
{{- end -}}
"
>
Your browser doesn't support embedded video, <a href="{{ $src.RelPermalink }}">view the video here</a>.
</video>