MM-47003 - Calls - Fix for: peer connection timeout (#6658)

* force negotiation

* fix message bug

* remove forced negotiation
This commit is contained in:
Christopher Poile
2022-10-03 13:12:02 -04:00
committed by GitHub
parent e905f7df29
commit 681b6b0b0f
2 changed files with 9 additions and 3 deletions

View File

@@ -231,15 +231,15 @@ export async function newConnection(serverUrl: string, channelID: string, closeC
ws.on('message', ({data}: { data: string }) => {
const msg = JSON.parse(data);
if (msg.type === 'answer' || msg.type === 'offer') {
if (msg.type === 'answer' || msg.type === 'candidate' || msg.type === 'offer') {
peer?.signal(data);
}
});
const waitForPeerConnection = () => {
const waitForReadyImpl = (callback: () => void, fail: () => void, timeout: number) => {
const waitForReadyImpl = (callback: () => void, fail: (reason: string) => void, timeout: number) => {
if (timeout <= 0) {
fail();
fail('timed out waiting for peer connection');
return;
}
setTimeout(() => {

View File

@@ -131,6 +131,12 @@ export const userLeftCall = (serverUrl: string, channelId: string, userId: strin
return;
}
// Was the user me?
if (userId === callsState.myUserId) {
myselfLeftCall();
return;
}
const nextCurrentCall = {
...currentCall,
participants: {...currentCall.participants},