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