From dd01e0045c83d000de5958615c8c7073d6cc262c Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Tue, 1 Oct 2024 13:20:14 +0200 Subject: [PATCH] fix slideshow --- static/slideshow.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/slideshow.js b/static/slideshow.js index 7f265fc..3b1fd2e 100644 --- a/static/slideshow.js +++ b/static/slideshow.js @@ -25,6 +25,7 @@ function xhr_get(url, callback_func) { // from https://stackoverflow.com/a/12646864 function shuffle_content() { + console.debug("shuffling content"); array = Object.keys(content); for (let i = array.length - 1; i >= 0; i--) { const j = Math.floor(Math.random() * (i + 1)); @@ -102,7 +103,8 @@ window.setInterval(function() { if (next_asset['type'] == 'image') { img = document.createElement("img"); img.onload = function() { - video.stop(); + video.pause(); + video.currentTime = 0; video.style.display = "none"; image.src = this.src; @@ -111,6 +113,7 @@ window.setInterval(function() { img.src = next_asset['url']; } else if (next_asset['type'] == 'video') { image.style.display = "none"; + video.src = next_asset["url"]; video.style.display = "block"; video.play();