making ice candidates write to DB properly

This commit is contained in:
2026-04-08 18:48:15 -04:00
parent dff05dd596
commit cec2d7593f
6 changed files with 58 additions and 18 deletions

View File

@@ -24,7 +24,7 @@ window.setChannelId = function(channelId) {
currentChannelId = channelId;
LogMessage("Channel set to: " + currentChannelId);
};
let userMedia = getUserMedia()
function LogMessage(msg) {
const messageLog = document.getElementById("messageLog");
messageLog.value += '\r\n' + msg;
@@ -212,9 +212,10 @@ async function ensurePeerConnection2()
console.log(`ICE connection state change: ${peerConnection.iceConnectionState}`);
};
peerConnection.onicecandidate = (event) => {
peerConnection.onicecandidate = async (event) => {
console.log(`Ice Candidate: ${JSON.stringify(event.candidate)}`);
LogMessage(`Ice Candidate: ${JSON.stringify(event.candidate)}`);
await window.HybridWebView.InvokeDotNet("WriteIceCandidate", [JSON.stringify(event.candidate)]);
};
peerConnection.ontrack = (event) => {