Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion packages/media-signaling/src/lib/services/webrtc/Processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,21 @@ export class MediaCallWebRTCProcessor implements IWebRTCProcessor {
}

public async waitForIceGathering(): Promise<void> {
if (this.stopped || this.peer.iceGatheringState === 'complete') {
if (this.stopped) {
return;
}

if (this.peer.iceGatheringState === 'complete') {
Comment thread
pierre-lehnen-rc marked this conversation as resolved.
// If the peer state is 'complete', wait long enough for a macrotask to complete to ensure this state is not outdated
await new Promise((resolve) => {
setTimeout(resolve, 1);
});

if (this.stopped || this.peer.iceGatheringState === 'complete') {
return;
}
}
Comment thread
pierre-lehnen-rc marked this conversation as resolved.

this.config.logger?.debug('MediaCallWebRTCProcessor.waitForIceGathering');
await this.initialization;

Expand Down
Loading