1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 14:26:41 -04:00

don't always show amp-video fallback message

This commit is contained in:
2019-11-20 17:19:44 -05:00
parent e3359f8690
commit 8907e456c4
4 changed files with 19 additions and 20 deletions

View File

@ -31,6 +31,7 @@ body#notes {
img,
svg {
width: 30px;
height: 45px;
width: auto;
}
@ -328,8 +329,8 @@ body#notes {
img,
svg {
width: 40px;
height: 60px;
width: auto;
}
span#name {

View File

@ -55,7 +55,7 @@
text-decoration: none;
color: #444444;
}
p.center, p.image, p.caption, p.video {
p.center, p.image, p.caption {
text-align: center;
}
header {

View File

@ -1,4 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 144.1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 144.1" width="30" height="45">
<g id="c1" fill="#6fbc4e">
<polygon points="57.6 0 38.4 11.1 38.4 11.1 76.8 33.2 96 22.1 96 22.1 57.6 0 57.6 0"/>
<polygon points="19.2 66.5 0 77.6 0 77.6 19.2 88.7 38.4 77.6 38.4 77.6 19.2 66.5 19.2 66.5"/>

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -3,21 +3,19 @@
{{- $video_ogg := .Page.Resources.GetMatch (.Get "ogg") -}}
{{- $img_poster := .Page.Resources.GetMatch (.Get "poster") -}}
<p class="video">
<amp-video
layout="responsive"
width="{{ if .Get "width" }}{{ .Get "width" }}{{ else }}910{{ end }}"
height="{{ if .Get "height" }}{{ .Get "height" }}{{ else }}600{{ end }}"
{{- if .Get "poster" }} poster="{{ $img_poster.Permalink }}"{{ end }}
{{- if .Get "autoplay" }} autoplay{{ end }}
{{- if .Get "loop" }} loop{{ end }}
{{- if ne (.Get "nocontrols") "1" }} controls{{ end }}>
{{ if .Get "webm" }}<source src="{{ $video_webm.Permalink }}" type="video/webm">{{ end }}
{{ if .Get "mp4" }}<source src="{{ $video_mp4.Permalink }}" type="video/mp4">{{ end }}
{{ if .Get "ogg" }}<source src="{{ $video_ogg.Permalink }}" type="video/ogg">{{ end }}
<amp-video
layout="responsive"
width="{{ if .Get "width" }}{{ .Get "width" }}{{ else }}910{{ end }}"
height="{{ if .Get "height" }}{{ .Get "height" }}{{ else }}600{{ end }}"
{{- if .Get "poster" }} poster="{{ $img_poster.Permalink }}"{{ end }}
{{- if .Get "autoplay" }} autoplay{{ end }}
{{- if .Get "loop" }} loop{{ end }}
{{- if ne (.Get "nocontrols") "1" }} controls{{ end }}>
{{ if .Get "webm" }}<source src="{{ $video_webm.Permalink }}" type="video/webm">{{ end }}
{{ if .Get "mp4" }}<source src="{{ $video_mp4.Permalink }}" type="video/mp4">{{ end }}
{{ if .Get "ogg" }}<source src="{{ $video_ogg.Permalink }}" type="video/ogg">{{ end }}
<div fallback>
Your browser does not support HTML5 video. <a href="{{ $video_mp4.Permalink }}">Load the .mp4 video directly.</a>
</div>
</amp-video>
</p>
<div fallback>
<p>Your browser does not support HTML5 video. <a href="{{ $video_mp4.Permalink }}">Load the .mp4 video directly.</a></p>
</div>
</amp-video>