-
Notifications
You must be signed in to change notification settings - Fork 856
Description
- I have provided steps to reproduce (e.g. a link to a jsfiddle)
- I have provided browser name, version and adapter.js version
- This issue only happens when adapter.js is used
Versions affected
Browser name including version (e.g. Chrome 64.0.3282.119)
Safari 17.0 (19616.1.27.111.16)
adapter.js (e.g. 6.1.0)
All versions >=8.0.0
Description
The shimAddIceCandidateNullOrEmpty
step fails on Safari. This particular check breaks (len==0):
Lines 1480 to 1482 in 28c9f94
var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate; | |
if (!nativeAddIceCandidate || nativeAddIceCandidate.length === 0) { | |
return; |
Causing this API to not be replaced correctly. This breaks the empty-candidate scenario, causing an error to be thrown.
Steps to reproduce
- Insert https://webrtc.github.io/adapter/adapter-latest.js into your site (via <script>)
- Insert debugger breakpoint at line mentioned above
- See shim failing to be correctly applied.
We encountered this bug when testing https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/tree/main/net/webrtc/gstwebrtc-api on Safari, where we depend on the empty-candidate scenario to work correctly.
Note: when pausing with the debugger and refreshing right after, it sometimes actually passes that check and the shim works correctly, once in 20 tries I'd say. Might be a Safari bug for all it's worth.
Expected results
The addIceCandidate
is correctly modified to have Safari handle the empty candidate scenario fine.
Actual results
addIceCandidate
is not modified, causing Safari to throw an error when encountering an empty candidate string.