<div class="video-container">
    {{ $src := .Get "src" }}
    {{ $poster := .Get "poster" }}
    {{ if and $src (not (hasPrefix $src "http")) (not (hasPrefix $src "/")) }}
        {{ $vid := .Page.Resources.GetMatch $src }}
        {{ if $vid }}{{ $src = $vid.RelPermalink }}{{ end }}
    {{ end }}
    {{ if and $poster (not (hasPrefix $poster "http")) (not (hasPrefix $poster "/")) }}
        {{ $p := .Page.Resources.GetMatch $poster }}
        {{ if $p }}{{ $poster = $p.RelPermalink }}{{ end }}
    {{ end }}
    <video controls muted preload="auto" title='{{ .Get "caption" }}' poster='{{ $poster }}'>
        <source src='{{ $src }}' type="video/webm">
    </video>
    <p>{{ .Get "caption" }}</p>
</div>