diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-01-31 00:59:50 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-02-16 01:20:39 +0100 |
| commit | 0e057a0fc38586ea55746173ca11446eef6d5865 (patch) | |
| tree | 93cb177c37436ae5dbab075c05ee9fa7da939006 /web/index.html | |
| parent | 651722fb46269ff06e5ff41227fd874ed5fd9854 (diff) | |
Support playlist load from the web interface.
Diffstat (limited to 'web/index.html')
| -rw-r--r-- | web/index.html | 10 |
1 files changed, 9 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); }) }); }; |
