fix: autoplay sound overlapping with main window

This created some distortion because while we were hiding the autoplay
window, this would not stop it's media. It's better to stop the media
completely
This commit is contained in:
talksik
2026-04-08 11:06:49 -07:00
parent 5f80bd15d5
commit 382f195847
4 changed files with 15 additions and 0 deletions
+5
View File
@@ -29,6 +29,11 @@ contextBridge.exposeInMainWorld('electronAutoplay', {
ipcRenderer.on('autoplay:play', handler);
return () => { ipcRenderer.removeListener('autoplay:play', handler); };
},
onStop: (callback: () => void) => {
const handler = () => callback();
ipcRenderer.on('autoplay:stop', handler);
return () => { ipcRenderer.removeListener('autoplay:stop', handler); };
},
onNavigate: (callback: (data: { networkId: string; streamId: string }) => void) => {
const handler = (_event: Electron.IpcRendererEvent, data: { networkId: string; streamId: string }) => callback(data);
ipcRenderer.on('autoplay:navigate', handler);