fix(audio): broken connection stats on Firefox >= 125

WebRTC-based stats generation in the connection status modal is broken
on Firefox >= 125. A broken type check coupled with a new partially
implemented RTCIceTransport dictionary causes and undefined function
call when fetching the selected candidate pair. Since that error is
unhandled, collection breaks.

Correctly check for the getSelectedCandidatePair method availability in
RTCIceTransport so that it skips to pair inference from getStats if
necessary.
This commit is contained in:
prlanzarin 2024-04-30 13:44:29 -03:00
parent 24b90070b7
commit 20daf56390

View File

@ -1072,7 +1072,7 @@ class AudioManager {
receivers[0] &&
receivers[0].transport &&
receivers[0].transport.iceTransport &&
receivers[0].transport.iceTransport
typeof receivers[0].transport.iceTransport.getSelectedCandidatePair === 'function'
) {
selectedPair = receivers[0].transport.iceTransport.getSelectedCandidatePair();
}