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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user