{{- $src := .Get "src" -}} {{- $title := .Get "title" -}} {{- $poster := .Get "poster" -}} {{- $types := split (.Get "types" | default "") "|" -}} {{- /* Process video URL */ -}} {{- if not (strings.Contains $src "://") -}} {{- $src = relURL $src -}} {{- end -}} {{- /* Process poster URL */ -}} {{- $posterAttr := "" -}} {{- if $poster -}} {{- if not (strings.Contains $poster "://") -}} {{- $poster = relURL $poster -}} {{- end -}} {{- $posterAttr = printf `poster="%s"` $poster -}} {{- end -}} {{- /* Build attributes */ -}} {{- $attributes := slice "controls" -}} {{- if .Get "autoplay" -}}{{- $attributes = $attributes | append "autoplay" -}}{{- end -}} {{- if .Get "loop" -}}{{- $attributes = $attributes | append "loop" -}}{{- end -}} {{- if .Get "muted" -}}{{- $attributes = $attributes | append "muted" -}}{{- end -}} {{- $attributes = delimit $attributes " " -}}
{{- if $title -}} {{ $title }} {{- end -}}