diff options
| author | Carl Hetherington <cth@carlh.net> | 2026-02-03 00:26:29 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2026-02-16 01:20:39 +0100 |
| commit | edf67efd4662f63c62a1cb524761cc44831c7020 (patch) | |
| tree | 5b833127daca63af302e015b49ceab4ed1461997 /web | |
| parent | 0e057a0fc38586ea55746173ca11446eef6d5865 (diff) | |
Support current playlist in the web interface.
Diffstat (limited to 'web')
| -rw-r--r-- | web/index.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/web/index.html b/web/index.html index 91e3e0bf1..8a078f7ef 100644 --- a/web/index.html +++ b/web/index.html @@ -16,6 +16,21 @@ setInterval(function() { document.getElementById('position').innerHTML = data.position; }); }); + current_playlist = fetch("/api/v1/current-playlist").then(response => { + response.json().then(data => { + var div = document.getElementById('current-playlist'); + if (div && data) { + div.innerHTML = ""; + var ul = document.createElement("ul"); + var list = div.appendChild(ul); + data.forEach(entry => { + var li = document.createElement("li"); + li.appendChild(document.createTextNode(entry)); + list.appendChild(li); + }); + } + }); + }); }, 250); function play() { entries = []; |
