feat(05-04): add WebSocket play/pause messages to wireAudio() event listeners

- audio 'play' listener now sends client.send({ type: 'play', position }) to server
- audio 'pause' listener now sends client.send({ type: 'pause', position }) to server
- Server is_playing flag now set correctly on mouse-initiated playback
- UDP cue scheduler fires for both mouse and keyboard playback
This commit is contained in:
Claude
2026-04-07 10:37:18 +00:00
parent 11cd0fce7b
commit ac0f3d52db

View File

@@ -132,8 +132,8 @@ function wireAudio() {
else audio.pause(); else audio.pause();
}); });
audio.addEventListener('play', () => { btn.textContent = '⏸'; startTicks(); }); audio.addEventListener('play', () => { btn.textContent = '⏸'; startTicks(); client.send({ type: 'play', position: audio.currentTime }); });
audio.addEventListener('pause', () => { btn.textContent = '▶'; stopTicks(); }); audio.addEventListener('pause', () => { btn.textContent = '▶'; stopTicks(); client.send({ type: 'pause', position: audio.currentTime }); });
audio.addEventListener('ended', () => { btn.textContent = '▶'; stopTicks(); seek.value = 0; }); audio.addEventListener('ended', () => { btn.textContent = '▶'; stopTicks(); seek.value = 0; });
// Time display + seek bar sync // Time display + seek bar sync