Merge pull request #879 from vector-im/matthew/fix-end-of-ice-candidates

don't ignore end-of-ICE candidates
This commit is contained in:
Bruno Windels 2022-09-26 07:10:02 +00:00 committed by GitHub
commit a6d7ef94da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -818,14 +818,16 @@ export class PeerCall implements IDisposable {
private async addIceCandidates(candidates: RTCIceCandidate[], log: ILogItem): Promise<void> { private async addIceCandidates(candidates: RTCIceCandidate[], log: ILogItem): Promise<void> {
for (const candidate of candidates) { for (const candidate of candidates) {
let logItem;
if ( if (
(candidate.sdpMid === null || candidate.sdpMid === undefined) && (candidate.sdpMid === null || candidate.sdpMid === undefined) &&
(candidate.sdpMLineIndex === null || candidate.sdpMLineIndex === undefined) (candidate.sdpMLineIndex === null || candidate.sdpMLineIndex === undefined)
) { ) {
log.log(`Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex`); logItem = log.log(`Got remote end-of-ICE candidates`);
continue; }
else {
logItem = log.log(`Adding 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) {