aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/shortcodes/video.html
diff options
context:
space:
mode:
Diffstat (limited to 'themes/default/layouts/shortcodes/video.html')
-rw-r--r--themes/default/layouts/shortcodes/video.html36
1 files changed, 36 insertions, 0 deletions
diff --git a/themes/default/layouts/shortcodes/video.html b/themes/default/layouts/shortcodes/video.html
new file mode 100644
index 0000000..7c0c95f
--- /dev/null
+++ b/themes/default/layouts/shortcodes/video.html
@@ -0,0 +1,36 @@
+{{-
+ $source := default
+ "https://raw.githubusercontent.com/benhosmer/HTML5-Test-Videos/9a6c2db46472454c634963cbeb0900fd37901fac/big_buck_bunny"
+ (.Get "source" | default (.Get 0))
+-}}
+{{- $poster := default "" (.Get "poster" | default (.Get 1)) -}}
+{{- $width := default "" (.Get "width" | default (.Get 2)) -}}
+{{- $height := default "" (.Get "height" | default (.Get 3)) -}}
+{{- $preload := default "metadata" (.Get "preload" | default (.Get 4)) -}}
+{{- $controls := default "" (.Get "controls" | default (.Get 5)) -}}
+{{- $caption := default "`HTML5` Video" (.Get "caption" | default (.Get 6)) -}}
+{{- $title := default "HTML5 Video" (.Get "title" | default (.Get 7)) -}}
+{{- $start := default "" (.Get "start" | default (.Get 8)) -}}
+{{- $end := default "" (.Get "end" | default (.Get 9)) -}}
+
+<video-container>
+ <video
+ title="{{ $title }}"
+ preload="{{ $preload }}"
+ poster="{{ $poster }}"
+ width="{{ $width }}"
+ height="{{ $height }}"
+ controls {{ $controls | safeHTMLAttr }}>
+ <source src="{{ $source }}.mp4#t={{ $start }},{{ $end }}" type="video/mp4">
+ <source src="{{ $source }}.webm#t={{ $start }},{{ $end }}" type="video/webm">
+ <source src="{{ $source }}.flv#t={{ $start }},{{ $end }}" type="video/flv">
+ <source src="{{ $source }}.ogv#t={{ $start }},{{ $end }}" type="video/ogv">
+ <p>
+ Sorry, your browser doesn't support embedded videos. Here is a
+ <a href="{{ $source }}.mp4#t={{ $start }},{{ $end }}">
+ link to the video
+ </a> instead.
+ </p>
+ </video>
+ <figcaption>{{ $caption | markdownify }}</figcaption>
+</video-container>