This commit is contained in:
2026-10-18 19:17:40 +07:00
parent 9542330125
commit c10ed2db01
10 changed files with 283 additions and 9 deletions
+8
View File
@@ -3,6 +3,8 @@ import { contextBridge, ipcRenderer } from 'electron'
import type { Command, Report, SceneReport, State } from '../src/types/screen.js'
contextBridge.exposeInMainWorld('screenBridge', {
selectAudioOutput: (id: string) => ipcRenderer.invoke('select-audio-output', id),
prepareAudioOutput: () => ipcRenderer.invoke('prepare-audio-output'),
planStatus: () => ipcRenderer.invoke('plan-status'),
onlineState: () => ipcRenderer.invoke('online-state'),
onlineAction: (intent: OnlineIntent) => ipcRenderer.invoke('online-action', intent),
@@ -23,3 +25,9 @@ contextBridge.exposeInMainWorld('screenBridge', {
selectPackage: (key: string | null) => ipcRenderer.invoke('select-package', key),
openMaterialsFolder: (key: string) => ipcRenderer.invoke('open-materials-folder', key),
})
if (new URLSearchParams(location.search).has('audio-devices')) {
navigator.mediaDevices.addEventListener('devicechange', () => {
ipcRenderer.send('audio-devices-changed')
})
}