-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathselectDevice.html
32 lines (31 loc) · 1.05 KB
/
selectDevice.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!-- selectDevice.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Select Device</title>
</head>
<body>
<h1>Select Playback Device</h1>
<form action="/play" method="GET">
<label for="devices">Select a device:</label>
<select id="devices" name="deviceNumber">
<!-- JavaScript will populate options here -->
</select>
<input type="hidden" name="uri" value="YOUR_TRACK_URI_HERE">
<button type="submit">Play</button>
</form>
<script>
// JavaScript to populate options dynamically
const devices = JSON.parse(`DEVICE_LIST_JSON_HERE`);
const select = document.getElementById('devices');
devices.forEach(device => {
const option = document.createElement('option');
option.value = device.id;
option.textContent = `${device.name} (${device.type})`;
select.appendChild(option);
});
</script>
</body>
</html>