{{ $video := .video }}
{{ $class := .class }}
{{ $lazy := .lazy }}
{{ $alt := .alt }}
{{ $autoplay := .autoplay | default true }}
{{ $loop := .loop | default true }}
{{ $muted := .muted | default true }}

{{ with $video }}
  <video
    {{ with $class }}class="{{ . }}"{{ end }}
    {{ if $autoplay }}autoplay{{ end }}
    {{ if $loop }}loop{{ end }}
    {{ if $muted }}muted{{ end }}
    playsinline
    {{ with $lazy }}loading="lazy"{{ end }}
    {{ with $alt }}aria-label="{{ . }}"{{ end }}
  >
    <source src="{{ .RelPermalink }}" type="{{ .MediaType }}">
    {{ with $alt }}{{ . }}{{ end }}
  </video>
{{ end }}

