update video shortcodes

main
Dominic Reich 10 months ago
parent 75cda3a256
commit c6fa6b7cd6
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -0,0 +1,7 @@
{{- $id := .Get "id" | default (.Get 0) -}}
{{- $class := .Get "class" | default (.Get 1) -}}
{{- $title := .Get "title" | default "Shared video" }}
<div {{ with $class }}class="{{ . }}"{{ else }}style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"{{ end }}>
<iframe title="{{ $title }}" width="560" height="315" src="https://video.infosec.exchange/videos/embed/{{ $id }}" frameborder="0" allowfullscreen="" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}sandbox="allow-same-origin allow-scripts allow-popups"></iframe>
</div>

@ -1,7 +1,15 @@
{{- $id := .Get "id" | default (.Get 0) -}}
{{- $class := .Get "class" | default (.Get 1) -}}
{{- $src := .Get "src" | default (.Get 0) -}}
{{- $title := .Get "title" | default "Shared video" }}
<div {{ with $class }}class="{{ . }}"{{ else }}style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"{{ end }}>
<iframe title="{{ $title }}" width="560" height="315" src="https://video.infosec.exchange/videos/embed/{{ $id }}" frameborder="0" allowfullscreen="" {{ if not $class }}style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" {{ end }}sandbox="allow-same-origin allow-scripts allow-popups"></iframe>
<div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
<video controls controlslist="noremoteplayback" preload="metadata" poster="{{ .Page.Permalink }}{{ $src }}.jpg">
<source src="{{ .Page.Permalink }}{{ $src }}.webm" type="video/webm" />
<source src="{{ .Page.Permalink }}{{ $src }}.ogv" type="video/ogv" />
<source src="{{ .Page.Permalink }}{{ $src }}.mp4" type="video/mp4" />
Oh sorry, we could not show you the video!<br />
We had the following sources:
<a href="{{ .Page.Permalink }}{{ $src }}.webm">webm</a>,
<a href="{{ .Page.Permalink }}{{ $src }}.ogv">ogv</a>,
<a href="{{ .Page.Permalink }}{{ $src }}.mp4">mp4</a>
</video>
</div>

Loading…
Cancel
Save