From 5f431087cfd28519ea969e4c62c6506a9c05e582 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Thu, 25 Mar 2021 13:26:07 -0700 Subject: added media metadata load to see first frame --- static/ncatalog.html | 8 ++++---- static/posts.html | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'static') diff --git a/static/ncatalog.html b/static/ncatalog.html index c5b6a23..81d31f3 100644 --- a/static/ncatalog.html +++ b/static/ncatalog.html @@ -38,10 +38,10 @@ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "audio"){ var audio = document.createElement("audio") audio.controls = 'controls' - audio.preload = 'none' + audio.preload = 'metadata' audio.src = '{{ (index .Attachment 0).Href }}' audio.type = '{{ (index .Attachment 0).MediaType }}' - audio.style = "margin-right: 10px; margin-bottom: 10px; width: 180px;" + audio.style = "margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" audio.innerText = 'Audio is not supported.' media.appendChild(audio) } @@ -49,11 +49,11 @@ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "video"){ var video = document.createElement("video") video.controls = 'controls' - video.preload = 'none' + video.preload = 'metadata' video.muted = 'muted' video.src = '{{ (index .Attachment 0).Href }}' video.type = '{{ (index .Attachment 0).MediaType }}' - video.style = "margin-right: 10px; margin-bottom: 10px; width: 180px;" + video.style = "margin-right: 10px; margin-bottom: 10px; max-width: 180px; max-height: 180px;" video.innerText = 'Video is not supported.' media.appendChild(video) } diff --git a/static/posts.html b/static/posts.html index 7878a1c..a32d7c5 100644 --- a/static/posts.html +++ b/static/posts.html @@ -39,10 +39,10 @@ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "audio"){ var audio = document.createElement("audio") audio.controls = 'controls' - audio.preload = 'none' + audio.preload = 'metadata' audio.src = '{{ (index .Attachment 0).Href }}' audio.type = '{{ (index .Attachment 0).MediaType }}' - audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; width: 250px;" + audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" audio.innerText = 'Audio is not supported.' media.appendChild(audio) } @@ -50,11 +50,11 @@ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "video"){ var video = document.createElement("video") video.controls = 'controls' - video.preload = 'none' + video.preload = 'metadata' video.muted = 'muted' video.src = '{{ (index .Attachment 0).Href }}' video.type = '{{ (index .Attachment 0).MediaType }}' - video.style = "float: left; margin-right: 10px; margin-bottom: 10px; width: 250px;" + video.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" video.innerText = 'Video is not supported.' media.appendChild(video) } @@ -105,10 +105,10 @@ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "audio"){ var audio = document.createElement("audio") audio.controls = 'controls' - audio.preload = 'none' + audio.preload = 'metadata' audio.src = '{{ (index .Attachment 0).Href }}' audio.type = '{{ (index .Attachment 0).MediaType }}' - audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; width: 250px;" + audio.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" audio.innerText = 'Audio is not supported.' media.appendChild(audio) } @@ -116,11 +116,11 @@ if(getMIMEType({{ (index .Attachment 0).MediaType }}) == "video"){ var video = document.createElement("video") video.controls = 'controls' - video.preload = 'none' + video.preload = 'metadata' video.muted = 'muted' video.src = '{{ (index .Attachment 0).Href }}' video.type = '{{ (index .Attachment 0).MediaType }}' - video.style = "float: left; margin-right: 10px; margin-bottom: 10px; width: 250px;" + video.style = "float: left; margin-right: 10px; margin-bottom: 10px; max-width: 250px; max-height: 250px;" video.innerText = 'Video is not supported.' media.appendChild(video) } -- cgit v1.2.3