From 557b3bf3e6a9ed223d83cee78d2d7e3926257a41 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 27 Oct 2025 11:21:49 +0200 Subject: [PATCH] Fix: app not loading via HTTP --- ui/src/routes/devices.$id.tsx | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/ui/src/routes/devices.$id.tsx b/ui/src/routes/devices.$id.tsx index a899a7a3..9b72eae5 100644 --- a/ui/src/routes/devices.$id.tsx +++ b/ui/src/routes/devices.$id.tsx @@ -534,21 +534,25 @@ export default function KvmIdRoute() { const audioTransceiver = pc.addTransceiver("audio", { direction: "sendrecv" }); - navigator.mediaDevices.getUserMedia({ - audio: { - echoCancellation: true, - noiseSuppression: true, - autoGainControl: true, - channelCount: 2, // Request stereo input if available - } - }).then((stream) => { - const audioTrack = stream.getAudioTracks()[0]; - if (audioTrack && audioTransceiver.sender) { - audioTransceiver.sender.replaceTrack(audioTrack); - } - }).catch((err) => { - console.warn("Microphone access denied or unavailable:", err.message); - }); + if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { + navigator.mediaDevices.getUserMedia({ + audio: { + echoCancellation: true, + noiseSuppression: true, + autoGainControl: true, + channelCount: 2, // Request stereo input if available + } + }).then((stream) => { + const audioTrack = stream.getAudioTracks()[0]; + if (audioTrack && audioTransceiver.sender) { + audioTransceiver.sender.replaceTrack(audioTrack); + } + }).catch((err) => { + console.warn("Microphone access denied or unavailable:", err.message); + }); + } else { + console.warn("navigator.mediaDevices.getUserMedia is not available in this browser/context"); + } const rpcDataChannel = pc.createDataChannel("rpc"); rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed");