Fix: app not loading via HTTP

This commit is contained in:
Alex P 2025-10-27 11:21:49 +02:00
parent 450836daba
commit 557b3bf3e6
1 changed files with 19 additions and 15 deletions

View File

@ -534,6 +534,7 @@ export default function KvmIdRoute() {
const audioTransceiver = pc.addTransceiver("audio", { direction: "sendrecv" }); const audioTransceiver = pc.addTransceiver("audio", { direction: "sendrecv" });
if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
navigator.mediaDevices.getUserMedia({ navigator.mediaDevices.getUserMedia({
audio: { audio: {
echoCancellation: true, echoCancellation: true,
@ -549,6 +550,9 @@ export default function KvmIdRoute() {
}).catch((err) => { }).catch((err) => {
console.warn("Microphone access denied or unavailable:", err.message); 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"); const rpcDataChannel = pc.createDataChannel("rpc");
rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed"); rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed");