add video subtitles and poster support

This commit is contained in:
Gabriel 2024-09-01 03:07:39 -04:00
parent 5c5febf40f
commit 98ec2bb929

View file

@ -67,8 +67,12 @@
<div class="video-container">
<div class="video-player">
<video preload="metadata" onclick="playthis(event)" onloadedmetadata="setup_video_metadata(event)"
ontimeupdate="setup_video_metadata(event)">
ontimeupdate="setup_video_metadata(event)"
{{if .Get "poster"}} poster='{{.Get "poster"}}'{{end}} >
<source src='{{.Site.BaseURL}}{{.Get "src" }}'>
{{if .Get "vtt"}}
<track label="English" kind="subtitles" src='{{.Get "vtt"}}' default>
{{end}}
</video>
<div class="video-controls">
<div onclick="toggle_video_play(event)" class="icon">