Update video placeholder image processing in js.

This commit is contained in:
Captain ALM 2023-09-19 23:01:46 +01:00
parent c12fc92f71
commit 39b37b5f56
Signed by: alfred
GPG Key ID: 4E4ADD02609997B1
2 changed files with 4 additions and 5 deletions

View File

@ -19,7 +19,6 @@
var CssDarkURL = "{{ .Data.CSSDarkURL }}"
var SunImageURL = "{{ .Data.SunImageLocation }}"
var MoonImageURL = "{{ .Data.MoonImageLocation }}"
var PlayImageURL = "{{ .Data.PlayVideoImageLocation }}"
</script>
<script type="application/javascript" src="{{ .Data.JScriptURL }}"></script>
</head>
@ -155,7 +154,7 @@
<div class="item-table-360">
<div id="video-{{ $c }}">
{{ if eq .VideoLocation "" }}
<img src="{{.GetVideoThumbnail $.Data.NoVideoImageLocation }}" alt="No Video" width="360px">
<img src="{{ .GetVideoThumbnail $.Data.NoVideoImageLocation }}" alt="No Video" width="360px">
{{ else }}
{{ if .IsVideoLink }}
<a href="{{ .VideoLocation }}">
@ -163,7 +162,7 @@
</a>
{{ else }}
<script type="application/javascript">
CreateVideoPlaceholder({{ $c }})
CreateVideoPlaceholder({{ $c }}, "{{ .GetVideoThumbnail $.Data.PlayVideoImageLocation }}")
</script>
<noscript>
<video controls width="360px">

View File

@ -26,9 +26,9 @@ function CreateEntry(id, name, videourl, videotype, start, end, duration) {
duration : parseInt(duration, 10)
};
}
function CreateVideoPlaceholder(id) {
function CreateVideoPlaceholder(id,phImageURL) {
var imgPH = document.createElement("img")
imgPH.src = PlayImageURL
imgPH.src = phImageURL
imgPH.id = "play-"+id
imgPH.alt = "Play Video"
imgPH.title = "Play"