summaryrefslogtreecommitdiff
path: root/templates/scripts/slideshow.js
diff options
context:
space:
mode:
Diffstat (limited to 'templates/scripts/slideshow.js')
-rw-r--r--templates/scripts/slideshow.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/templates/scripts/slideshow.js b/templates/scripts/slideshow.js
index ccf7c32..3ab2ada 100644
--- a/templates/scripts/slideshow.js
+++ b/templates/scripts/slideshow.js
@@ -33,11 +33,12 @@ function changeSlide(direction) {
function showSlide(index) {
const file = mediaFiles[index];
const container = document.getElementById('slideshow-media-container');
+ const encodedName = encodeURIComponent(file.name);
if (file.isVideo) {
- container.innerHTML = `<video src="/download/${file.name}" controls autoplay style="max-width: 100%; max-height: 80vh;"></video>`;
+ container.innerHTML = `<video src="/download/${encodedName}" controls autoplay style="max-width: 100%; max-height: 80vh;"></video>`;
} else {
- container.innerHTML = `<img src="/download/${file.name}" alt="${file.name}" style="max-width: 100%; max-height: 80vh;">`;
+ container.innerHTML = `<img src="/download/${encodedName}" alt="${file.name}" style="max-width: 100%; max-height: 80vh;">`;
}
document.getElementById('slideshow-filename').textContent = file.name;