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 be96230894
commit a2e22fffb3

View File

@ -1085,10 +1085,9 @@ 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();
selectedPair = receivers[0].transport.iceTransport.getSelectedCandidatePair();
}
return selectedPair;