Skip to content

Commit

Permalink
gstwebrtc-api: Patch webrtc-adapter to fix Safari behaviour
Browse files Browse the repository at this point in the history
There's currently a Safari-side bug causing webrtc-adapter to be unable to correctly shim the empty-candidate scenario
which we're using. This patch is very much a workaround and should be removed as soon as Safari and/or webrtc-adapter
fixes this on their side.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/439
webrtcHacks/adapter#1140

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1377>
  • Loading branch information
thewildtree authored and GStreamer Marge Bot committed Oct 30, 2023
1 parent 16c00ae commit 436b6d8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/webrtc/gstwebrtc-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"webpack-dev-server": "4.15.1"
},
"dependencies": {
"patch-package": "8.0.0",
"webrtc-adapter": "8.2.3"
},
"scripts": {
Expand All @@ -59,6 +60,7 @@
"make": "npm run check && npm run build && npm run docs",
"test": "mocha --node-env=test --exit",
"prepack": "npm run test && npm run make",
"start": "webpack serve"
"start": "webpack serve",
"postinstall": "patch-package"
}
}
13 changes: 13 additions & 0 deletions net/webrtc/gstwebrtc-api/patches/webrtc-adapter+8.2.3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/webrtc-adapter/src/js/common_shim.js b/node_modules/webrtc-adapter/src/js/common_shim.js
index 96d7c8e..063ea64 100644
--- a/node_modules/webrtc-adapter/src/js/common_shim.js
+++ b/node_modules/webrtc-adapter/src/js/common_shim.js
@@ -388,7 +388,7 @@ export function shimAddIceCandidateNullOrEmpty(window, browserDetails) {
}
const nativeAddIceCandidate =
window.RTCPeerConnection.prototype.addIceCandidate;
- if (!nativeAddIceCandidate || nativeAddIceCandidate.length === 0) {
+ if (!nativeAddIceCandidate) {
return;
}
window.RTCPeerConnection.prototype.addIceCandidate =

0 comments on commit 436b6d8

Please sign in to comment.