jumbotron video with different codecs

This commit is contained in:
Gabriele Musco 2021-07-08 09:56:16 +02:00
parent f1ef2f812b
commit ab90184ec5
No known key found for this signature in database
GPG Key ID: 8539FD3454380B83
2 changed files with 11 additions and 1 deletions

View File

@ -206,7 +206,10 @@ subtitle: Some fancy subtitle
image: /jumbotron_image.svg image: /jumbotron_image.svg
imagePosition: left # values: left, right, top, bottom imagePosition: left # values: left, right, top, bottom
background: /img/jumbotron_bg.png background: /img/jumbotron_bg.png
backgroundVideo: /jumbotron_video.webm # will replace the background image backgroundVideo: /jumbotron_video.mp4 # will replace the background image
# it's best to provide both an mp4 and a web source for the video for better compatibility
backgroundVideoMp4: /jumbotron_video.mp4
backgroundVideoWebm: /jumbotron_video.webm
videoOpacity: 1.0 videoOpacity: 1.0
textShadow: false textShadow: false
fullscreen: false fullscreen: false

View File

@ -11,7 +11,14 @@
class="jumbotron_video" class="jumbotron_video"
id="jumbotron_video" id="jumbotron_video"
src="{{ .Site.Data.jumbotron.backgroundVideo }}" src="{{ .Site.Data.jumbotron.backgroundVideo }}"
playsinline
autoplay mute loop> autoplay mute loop>
{{ if .Site.Data.jumbotron.backgroundVideoMp4 }}
<source src="{{ .Site.Data.jumbotron.backgroundVideoMp4 }}" type="video/mp4">
{{ end }}
{{ if .Site.Data.jumbotron.backgroundVideoWebm }}
<source src="{{ .Site.Data.jumbotron.backgroundVideoWebm }}" type="video/webm">
{{ end }}
</video> </video>
</div> </div>
{{ end }} {{ end }}