Skip to content

Commit 68d8d3d

Browse files
committed
fix(mediasoup-sdp-bridge): support mediasoup-client 3.10.x (#685)
mediasoup-client 3.8.0 added an "exports" field that hides the internal `lib/` subpaths the bridge was importing, breaking the package with ERR_PACKAGE_PATH_NOT_EXPORTED on any 3.8+ install. Move the imports to the public paths exposed since 3.10.0 (mediasoup-client/handlers/sdp/*, mediasoup-client/ortc) and read IceCandidate from the publicly re-exported mediasoup-client/types. Drop the now-removed extmapAllowMixed option on RemoteSdp.send, and tighten the peerDependency to >=3.10.0 <3.11.0 to signal the tested range. 3.11 added a mandatory third arg to getExtendedRtpCapabilities and 3.16 renamed validateRtpCapabilities; both need follow-up before they can be supported.
1 parent 4cd72bc commit 68d8d3d

5 files changed

Lines changed: 52 additions & 2775 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@epicgames-ps/mediasoup-sdp-bridge": patch
3+
---
4+
5+
Make `mediasoup-sdp-bridge` importable against `mediasoup-client` 3.10.x (#685). Internal subpaths under `mediasoup-client/lib/...` were hidden by the `exports` field added in 3.8.0, breaking `import * as MsSdpUtils from "mediasoup-client/lib/handlers/sdp/commonUtils"` etc. with `ERR_PACKAGE_PATH_NOT_EXPORTED`. The imports now use the public paths exposed since 3.10.0 (`mediasoup-client/handlers/sdp/commonUtils`, `mediasoup-client/handlers/sdp/RemoteSdp`, `mediasoup-client/handlers/sdp/unifiedPlanUtils`, `mediasoup-client/ortc`) and the publicly re-exported `IceCandidate` from `mediasoup-client/types`. The peerDependency is tightened to `>=3.10.0 <3.11.0` to flag the supported range — 3.11 added a mandatory third arg to `getExtendedRtpCapabilities` and 3.16 renamed `validateRtpCapabilities`, both of which need follow-up work before they can be supported. The unsupported `extmapAllowMixed` option on `RemoteSdp.send` was removed.

Extras/mediasoup-sdp-bridge/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@
6464
"jest": "^29.7.0",
6565
"jest-tobetype": "^1.2.3",
6666
"mediasoup": "3.15.5",
67-
"mediasoup-client": "3.9.1",
67+
"mediasoup-client": "~3.10.0",
6868
"open-cli": "^6.0.1",
6969
"prettier": "~2.5.0",
7070
"tsc-watch": "^4.2.8",
7171
"typescript": "^5.7.3"
7272
},
7373
"peerDependencies": {
7474
"mediasoup": "^3.0.0",
75-
"mediasoup-client": "^3.0.0"
75+
"mediasoup-client": ">=3.10.0 <3.11.0"
7676
}
7777
}

Extras/mediasoup-sdp-bridge/src/SdpUtils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// TODO, FIXME: Here we're assuming that Unified Plan is the correct way to
22
// handle the SDP messages. For a more robust handling, this should probably
33
// depend on the actual type of SDP: plain, PlanB, or UnifiedPlan.
4-
import * as MsSdpUnifiedPlanUtils from "mediasoup-client/lib/handlers/sdp/unifiedPlanUtils";
4+
import * as MsSdpUnifiedPlanUtils from "mediasoup-client/handlers/sdp/unifiedPlanUtils";
55

6-
import * as MsSdpUtils from "mediasoup-client/lib/handlers/sdp/commonUtils";
7-
import * as MsOrtc from "mediasoup-client/lib/ortc";
6+
import * as MsSdpUtils from "mediasoup-client/handlers/sdp/commonUtils";
7+
import * as MsOrtc from "mediasoup-client/ortc";
88
import {
99
MediaKind,
1010
RtpCapabilities,

Extras/mediasoup-sdp-bridge/src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as MsSdpUtils from "mediasoup-client/lib/handlers/sdp/commonUtils";
2-
import { RemoteSdp } from "mediasoup-client/lib/handlers/sdp/RemoteSdp";
3-
import { IceCandidate as ClientIceCandidate } from "mediasoup-client/lib/Transport";
1+
import * as MsSdpUtils from "mediasoup-client/handlers/sdp/commonUtils";
2+
import { RemoteSdp } from "mediasoup-client/handlers/sdp/RemoteSdp";
3+
import { IceCandidate as ClientIceCandidate } from "mediasoup-client/types";
44

55
import {
66
Consumer,
@@ -208,7 +208,6 @@ export class SdpEndpoint {
208208
offerRtpParameters: this.producerOfferParams[i],
209209
answerRtpParameters: this.producers[i].rtpParameters,
210210
codecOptions: undefined,
211-
extmapAllowMixed: false,
212211
});
213212
}
214213

0 commit comments

Comments
 (0)