diff options
Diffstat (limited to 'templates/media.qtpl')
-rw-r--r-- | templates/media.qtpl | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/templates/media.qtpl b/templates/media.qtpl index 18eac0d..6217899 100644 --- a/templates/media.qtpl +++ b/templates/media.qtpl @@ -2,8 +2,16 @@ {% code type MediaPage struct { - Medias []*repository.Media - Next *repository.Pagination + Medias []*repository.Media + Next *repository.Pagination + Settings *repository.Settings +} + +func (m *MediaPage) PreloadAttr() string { + if m.Settings.PreloadVideoMetadata { + return "metadata" + } + return "none" } %} @@ -14,7 +22,7 @@ type MediaPage struct { {% for _, media := range p.Medias %} <div class="card-image"> {% if media.IsVideo() %} - <video class="image is-fit" controls muted="true" poster="/media/thumbnail?path_hash={%s media.PathHash %}" preload="metadata"> + <video class="image is-fit" controls muted="true" poster="/media/thumbnail?path_hash={%s media.PathHash %}" preload="{%s p.PreloadAttr() %}"> <source src="/media/image?path_hash={%s media.PathHash %}" type="{%s media.MIMEType %}"> </video> {% else %} |