Compare commits

...

2 Commits

Author SHA1 Message Date
Alex 9ef22376af
Merge 557b3bf3e6 into 9a4d061034 2025-10-27 09:21:59 +00:00
Alex P 557b3bf3e6 Fix: app not loading via HTTP 2025-10-27 11:21:49 +02:00
1 changed files with 19 additions and 15 deletions

View File

@ -534,21 +534,25 @@ export default function KvmIdRoute() {
const audioTransceiver = pc.addTransceiver("audio", { direction: "sendrecv" }); const audioTransceiver = pc.addTransceiver("audio", { direction: "sendrecv" });
navigator.mediaDevices.getUserMedia({ if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
audio: { navigator.mediaDevices.getUserMedia({
echoCancellation: true, audio: {
noiseSuppression: true, echoCancellation: true,
autoGainControl: true, noiseSuppression: true,
channelCount: 2, // Request stereo input if available autoGainControl: true,
} channelCount: 2, // Request stereo input if available
}).then((stream) => { }
const audioTrack = stream.getAudioTracks()[0]; }).then((stream) => {
if (audioTrack && audioTransceiver.sender) { const audioTrack = stream.getAudioTracks()[0];
audioTransceiver.sender.replaceTrack(audioTrack); if (audioTrack && audioTransceiver.sender) {
} audioTransceiver.sender.replaceTrack(audioTrack);
}).catch((err) => { }
console.warn("Microphone access denied or unavailable:", err.message); }).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"); const rpcDataChannel = pc.createDataChannel("rpc");
rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed"); rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed");