Merge pull request 'LINXD-2850: Add handler on icestatechange failed/disconnected to send 'connection-failed' event to participants' (#39) from LINXD-2850-connection-failed-handler into develop
Reviewed-on: #39 Reviewed-by: Cristi Ene <cristi.ene@safemobile.com>
This commit is contained in:
commit
755df1ec5a
10
app.js
10
app.js
@ -542,6 +542,15 @@ const isInitiator = (callId, socketId) => {
|
||||
return videoCalls[callId]?.initiatorSocket?.id === socketId;
|
||||
};
|
||||
|
||||
const emitToParticipants = (callId, event, message) => {
|
||||
try {
|
||||
videoCalls[callId].receiverSocket.emit(event, message);
|
||||
videoCalls[callId].initiatorSocket.emit(event, message);
|
||||
} catch (error) {
|
||||
console.error(`[emitToParticipants] | ERROR | callId: ${callId} | error: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
- Called from at event 'createWebRtcTransport' and assigned to the consumer or producer transport
|
||||
- It will return parameters, these are required for the client to create the RecvTransport
|
||||
@ -584,6 +593,7 @@ const createWebRtcTransportLayer = async (callId, callback) => {
|
||||
console.log(`[ICE STATE CHANGE] callId: ${callId} | State: ${iceState}`);
|
||||
if (iceState === 'failed' || iceState === 'disconnected') {
|
||||
console.warn(`⚠️ ICE failure detected for callId: ${callId}! Possible UDP blockage.`);
|
||||
emitToParticipants(callId, 'connection-failed', { callId });
|
||||
}
|
||||
});
|
||||
|
||||
|
BIN
doc/[video] Video - Connection error.png
Normal file
BIN
doc/[video] Video - Connection error.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 215 KiB |
Loading…
x
Reference in New Issue
Block a user