Compare commits

..

1 Commits

Author SHA1 Message Date
Alex 997a5f8bbd
Merge 450836daba into 9a4d061034 2025-10-24 09:58:13 +00:00
1 changed files with 15 additions and 19 deletions

View File

@ -534,25 +534,21 @@ 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, noiseSuppression: true,
noiseSuppression: true, autoGainControl: true,
autoGainControl: true, channelCount: 2, // Request stereo input if available
channelCount: 2, // Request stereo input if available }
} }).then((stream) => {
}).then((stream) => { const audioTrack = stream.getAudioTracks()[0];
const audioTrack = stream.getAudioTracks()[0]; if (audioTrack && audioTransceiver.sender) {
if (audioTrack && audioTransceiver.sender) { audioTransceiver.sender.replaceTrack(audioTrack);
audioTransceiver.sender.replaceTrack(audioTrack); }
} }).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");