From ac0f3d52dbe6673dcf5adf7dd2cf43cd5986f605 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 7 Apr 2026 10:37:18 +0000 Subject: [PATCH] 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 --- lightsync/frontend/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lightsync/frontend/app.js b/lightsync/frontend/app.js index 8e253a5..69267f9 100644 --- a/lightsync/frontend/app.js +++ b/lightsync/frontend/app.js @@ -132,8 +132,8 @@ function wireAudio() { else audio.pause(); }); - audio.addEventListener('play', () => { btn.textContent = '⏸'; startTicks(); }); - audio.addEventListener('pause', () => { btn.textContent = '▶'; stopTicks(); }); + audio.addEventListener('play', () => { btn.textContent = '⏸'; startTicks(); client.send({ type: 'play', position: audio.currentTime }); }); + audio.addEventListener('pause', () => { btn.textContent = '▶'; stopTicks(); client.send({ type: 'pause', position: audio.currentTime }); }); audio.addEventListener('ended', () => { btn.textContent = '▶'; stopTicks(); seek.value = 0; }); // Time display + seek bar sync