summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2026-01-31 00:59:50 +0100
committerCarl Hetherington <cth@carlh.net>2026-02-03 21:37:04 +0100
commitabfbd4d2b4b9a9a9cc8b566db5e4377030823592 (patch)
treee659dc6a3df21d65a92b77837aac32650064d433 /web
parentf122cc879e5824cd93782dba1bdd207239f294ce (diff)
Support playlist load from the web interface.
Diffstat (limited to 'web')
-rw-r--r--web/index.html10
-rw-r--r--web/playlists.html4
2 files changed, 13 insertions, 1 deletions
diff --git a/web/index.html b/web/index.html
index b0b5b4505..91e3e0bf1 100644
--- a/web/index.html
+++ b/web/index.html
@@ -18,6 +18,13 @@ setInterval(function() {
});
}, 250);
function play() {
+ entries = [];
+ var nextPlaylist = document.getElementById('next-playlist').children[0].children;
+ for (var i = 0; i < nextPlaylist.length; i++) {
+ entries.push({"uuid": nextPlaylist[i].uuid, "crop_to_ratio": nextPlaylist[i].crop_to_ratio});
+ }
+ console.log(JSON.stringify({"entries": entries}));
+ fetch("/api/v1/load-playlist", { method: "POST", body: JSON.stringify({"entries": entries}) });
fetch("/api/v1/play", { method: "POST" });
}
function stop() {
@@ -49,9 +56,10 @@ function showPlaylists()
data.content.forEach(content => {
var li = document.createElement("li");
li.appendChild(document.createTextNode(content.name));
+ li.uuid = content.uuid;
+ li.crop_to_ratio = content.crop_to_ratio;
ul.appendChild(li);
});
- console.log(data);
})
});
};
diff --git a/web/playlists.html b/web/playlists.html
index 3d2e37f41..723b2ec6c 100644
--- a/web/playlists.html
+++ b/web/playlists.html
@@ -306,6 +306,8 @@ ul#content {
SIDEBAR
+<div style="margin-left: 15%;">
+
<div style="width: 45%; display: inline-block; margin-right: 3em;">
<p>Playlists: <button onclick="newPlaylist();">Add</button> <button id="remove-playlist" onclick="removeSelectedPlaylist();">Remove</button>
<ul id="playlists">
@@ -324,6 +326,8 @@ SIDEBAR
</ul>
</div>
+</div>
+
</body>
</html>