forked from Ivasoft/mattermost-mobile
MM-47003 - Calls - Fix for: peer connection timeout (#6658)
* force negotiation * fix message bug * remove forced negotiation
This commit is contained in:
committed by
GitHub
parent
e905f7df29
commit
681b6b0b0f
@@ -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(() => {
|
||||
|
||||
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user