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" });
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");
}
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);
});
const rpcDataChannel = pc.createDataChannel("rpc");
rpcDataChannel.onclose = () => console.log("rpcDataChannel has closed");