Merge branch 'bwindels/calls' into thirdroom/dev

This commit is contained in:
Robert Long 2022-05-11 17:33:15 -07:00
commit d6ddf1a469
2 changed files with 7 additions and 7 deletions

View file

@ -40,7 +40,7 @@ export type Options = Omit<GroupCallOptions, "emitUpdate" | "createTimeout"> & {
clock: Clock clock: Clock
}; };
function getRoomMemberKey(roomId: string, userId: string) { function getRoomMemberKey(roomId: string, userId: string): string {
return JSON.stringify(roomId)+`,`+JSON.stringify(userId); return JSON.stringify(roomId)+`,`+JSON.stringify(userId);
} }

View file

@ -438,7 +438,7 @@ export class PeerCall implements IDisposable {
if (this.callId! > newCallId) { if (this.callId! > newCallId) {
log.log( log.log(
"Glare detected: answering incoming call " + newCallId + "Glare detected: answering incoming call " + newCallId +
" and canceling outgoing call ", " and canceling outgoing call "
); );
// How do we interrupt `call()`? well, perhaps we need to not just await InviteSent but also CreateAnswer? // How do we interrupt `call()`? well, perhaps we need to not just await InviteSent but also CreateAnswer?
if (this._state === CallState.Fledgling || this._state === CallState.CreateOffer) { if (this._state === CallState.Fledgling || this._state === CallState.CreateOffer) {
@ -452,7 +452,7 @@ export class PeerCall implements IDisposable {
} else { } else {
log.log( log.log(
"Glare detected: rejecting incoming call " + newCallId + "Glare detected: rejecting incoming call " + newCallId +
" and keeping outgoing call ", " and keeping outgoing call "
); );
await this.sendHangupWithCallId(newCallId, CallErrorCode.Replaced, log); await this.sendHangupWithCallId(newCallId, CallErrorCode.Replaced, log);
} }
@ -625,7 +625,7 @@ export class PeerCall implements IDisposable {
if (this.opponentPartyId !== partyId) { if (this.opponentPartyId !== partyId) {
log.log( log.log(
`Ignoring candidates from party ID ${partyId}: ` + `Ignoring candidates from party ID ${partyId}: ` +
`we have chosen party ID ${this.opponentPartyId}`, `we have chosen party ID ${this.opponentPartyId}`
); );
return; return;
@ -680,7 +680,7 @@ export class PeerCall implements IDisposable {
await this.sendSignallingMessage({type: EventType.Negotiate, content}, log); await this.sendSignallingMessage({type: EventType.Negotiate, content}, log);
} }
} catch (err) { } catch (err) {
log.log(`Failed to complete negotiation`, err); log.log(`Failed to complete negotiation`).catch(err);
} }
} }
@ -801,12 +801,12 @@ export class PeerCall implements IDisposable {
log.log(`Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex`); log.log(`Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex`);
continue; continue;
} }
log.log(`Got remote ICE ${candidate.sdpMid} candidate: ${candidate.candidate}`); const logItem = log.log(`Adding remote ICE ${candidate.sdpMid} candidate: ${candidate.candidate}`);
try { try {
await this.peerConnection.addIceCandidate(candidate); await this.peerConnection.addIceCandidate(candidate);
} catch (err) { } catch (err) {
if (!this.ignoreOffer) { if (!this.ignoreOffer) {
log.log(`Failed to add remote ICE candidate`, err); logItem.catch(err);
} }
} }
} }