fix: serialize WebRTC objects before IPC transfer
RTCSessionDescription and RTCIceCandidate objects lose their properties when sent through Electron's contextBridge IPC. Convert to plain objects with explicit property extraction before sending. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d8a2ec6443
commit
6b47181572
@ -58,13 +58,18 @@ async function handleOffer(clientId, offer, role) {
|
||||
};
|
||||
};
|
||||
|
||||
// ICE candidates
|
||||
// ICE candidates — serialize to plain object (WebRTC objects don't survive IPC)
|
||||
pc.onicecandidate = (event) => {
|
||||
if (event.candidate) {
|
||||
window.capture.sendSignaling({
|
||||
type: 'ice-candidate',
|
||||
clientId,
|
||||
candidate: event.candidate
|
||||
candidate: {
|
||||
candidate: event.candidate.candidate,
|
||||
sdpMid: event.candidate.sdpMid,
|
||||
sdpMLineIndex: event.candidate.sdpMLineIndex,
|
||||
usernameFragment: event.candidate.usernameFragment
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
@ -79,10 +84,11 @@ async function handleOffer(clientId, offer, role) {
|
||||
const answer = await pc.createAnswer();
|
||||
await pc.setLocalDescription(answer);
|
||||
|
||||
// Serialize to plain object (RTCSessionDescription doesn't survive IPC)
|
||||
window.capture.sendSignaling({
|
||||
type: 'answer',
|
||||
clientId,
|
||||
answer: pc.localDescription
|
||||
answer: { type: pc.localDescription.type, sdp: pc.localDescription.sdp }
|
||||
});
|
||||
|
||||
window.capture.notifyClientCount(clients.size);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "multi-hoster-uploader",
|
||||
"version": "2.1.3",
|
||||
"version": "2.1.4",
|
||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user