mediasoup-client 3.22.0 → 3.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import type * as SdpTransform from 'sdp-transform';
2
2
  import type { DtlsParameters } from '../../Transport';
3
- import type { RtpCapabilities, RtpHeaderExtensionUri, RtpParameters } from '../../RtpParameters';
3
+ import type { RtpCapabilities, RtpParameters } from '../../RtpParameters';
4
4
  /**
5
5
  * This function extracs RTP capabilities from the given SDP.
6
6
  *
@@ -24,12 +24,4 @@ export declare function applyCodecParameters({ offerRtpParameters, answerMediaOb
24
24
  offerRtpParameters: RtpParameters;
25
25
  answerMediaObject: SdpTransform.MediaDescription;
26
26
  }): void;
27
- /**
28
- * Add header extension in the given SDP m= section offer.
29
- */
30
- export declare function addHeaderExtension({ offerMediaObject, headerExtensionUri, headerExtensionId, }: {
31
- offerMediaObject: SdpTransform.MediaDescription;
32
- headerExtensionUri: RtpHeaderExtensionUri;
33
- headerExtensionId: number;
34
- }): void;
35
27
  //# sourceMappingURL=commonUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,YAAY,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EACX,cAAc,EAGd,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,eAAe,EAGf,qBAAqB,EACrB,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EACtC,SAAS,GACT,EAAE;IACF,SAAS,EAAE,YAAY,CAAC,kBAAkB,CAAC;CAC3C,GAAG,eAAe,CA4GlB;AAED,wBAAgB,qBAAqB,CAAC,EACrC,SAAS,GACT,EAAE;IACF,SAAS,EAAE,YAAY,CAAC,kBAAkB,CAAC;CAC3C,GAAG,cAAc,CAsDjB;AAED,wBAAgB,QAAQ,CAAC,EACxB,gBAAgB,GAChB,EAAE;IACF,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,CAAC;CAChD,GAAG,MAAM,CAUT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACpC,kBAAkB,EAClB,iBAAiB,GACjB,EAAE;IACF,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,YAAY,CAAC,gBAAgB,CAAC;CACjD,GAAG,IAAI,CAsDP;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAClC,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,GACjB,EAAE;IACF,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,CAAC;IAChD,kBAAkB,EAAE,qBAAqB,CAAC;IAC1C,iBAAiB,EAAE,MAAM,CAAC;CAC1B,GAAG,IAAI,CASP"}
1
+ {"version":3,"file":"commonUtils.d.ts","sourceRoot":"","sources":["../../../src/handlers/sdp/commonUtils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,YAAY,MAAM,eAAe,CAAC;AACnD,OAAO,KAAK,EACX,cAAc,EAGd,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EACX,eAAe,EAIf,aAAa,EAEb,MAAM,qBAAqB,CAAC;AAE7B;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,EACtC,SAAS,GACT,EAAE;IACF,SAAS,EAAE,YAAY,CAAC,kBAAkB,CAAC;CAC3C,GAAG,eAAe,CA4GlB;AAED,wBAAgB,qBAAqB,CAAC,EACrC,SAAS,GACT,EAAE;IACF,SAAS,EAAE,YAAY,CAAC,kBAAkB,CAAC;CAC3C,GAAG,cAAc,CAsDjB;AAED,wBAAgB,QAAQ,CAAC,EACxB,gBAAgB,GAChB,EAAE;IACF,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,CAAC;CAChD,GAAG,MAAM,CAUT;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,EACpC,kBAAkB,EAClB,iBAAiB,GACjB,EAAE;IACF,kBAAkB,EAAE,aAAa,CAAC;IAClC,iBAAiB,EAAE,YAAY,CAAC,gBAAgB,CAAC;CACjD,GAAG,IAAI,CAsDP"}
@@ -37,7 +37,6 @@ exports.extractRtpCapabilities = extractRtpCapabilities;
37
37
  exports.extractDtlsParameters = extractDtlsParameters;
38
38
  exports.getCname = getCname;
39
39
  exports.applyCodecParameters = applyCodecParameters;
40
- exports.addHeaderExtension = addHeaderExtension;
41
40
  const sdpTransform = __importStar(require("sdp-transform"));
42
41
  /**
43
42
  * This function extracs RTP capabilities from the given SDP.
@@ -226,15 +225,3 @@ function applyCodecParameters({ offerRtpParameters, answerMediaObject, }) {
226
225
  }
227
226
  }
228
227
  }
229
- /**
230
- * Add header extension in the given SDP m= section offer.
231
- */
232
- function addHeaderExtension({ offerMediaObject, headerExtensionUri, headerExtensionId, }) {
233
- if (!offerMediaObject.ext) {
234
- offerMediaObject.ext = [];
235
- }
236
- offerMediaObject.ext.push({
237
- uri: headerExtensionUri,
238
- value: headerExtensionId,
239
- });
240
- }
package/lib/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export * as types from './types';
6
6
  /**
7
7
  * Expose mediasoup-client version.
8
8
  */
9
- export declare const version = "__MEDIASOUP_CLIENT_VERSION__";
9
+ export declare const version = "3.23.1";
10
10
  /**
11
11
  * Expose Device class and device detector helpers.
12
12
  */
package/lib/index.js CHANGED
@@ -46,7 +46,7 @@ exports.types = __importStar(require("./types"));
46
46
  /**
47
47
  * Expose mediasoup-client version.
48
48
  */
49
- exports.version = '__MEDIASOUP_CLIENT_VERSION__';
49
+ exports.version = '3.23.1';
50
50
  /**
51
51
  * Expose Device class and device detector helpers.
52
52
  */
package/lib/ortc.js CHANGED
@@ -791,6 +791,7 @@ function validateAndNormalizeRtcpParameters(rtcp) {
791
791
  * extended RTP capabilities.
792
792
  */
793
793
  function getRtpCapabilities({ direction, extendedRtpCapabilities, }) {
794
+ const isSending = direction === 'sendonly';
794
795
  const rtpCapabilities = {
795
796
  codecs: [],
796
797
  headerExtensions: [],
@@ -799,7 +800,9 @@ function getRtpCapabilities({ direction, extendedRtpCapabilities, }) {
799
800
  const codec = {
800
801
  kind: extendedCodec.kind,
801
802
  mimeType: extendedCodec.mimeType,
802
- preferredPayloadType: extendedCodec.remotePayloadType,
803
+ preferredPayloadType: isSending
804
+ ? extendedCodec.localPayloadType
805
+ : extendedCodec.remotePayloadType,
803
806
  clockRate: extendedCodec.clockRate,
804
807
  channels: extendedCodec.channels,
805
808
  parameters: extendedCodec.localParameters,
@@ -807,16 +810,21 @@ function getRtpCapabilities({ direction, extendedRtpCapabilities, }) {
807
810
  };
808
811
  rtpCapabilities.codecs.push(codec);
809
812
  // Add RTX codec.
810
- if (!extendedCodec.remoteRtxPayloadType) {
813
+ if (!extendedCodec.localRtxPayloadType ||
814
+ !extendedCodec.remoteRtxPayloadType) {
811
815
  continue;
812
816
  }
813
817
  const rtxCodec = {
814
818
  kind: extendedCodec.kind,
815
819
  mimeType: `${extendedCodec.kind}/rtx`,
816
- preferredPayloadType: extendedCodec.remoteRtxPayloadType,
820
+ preferredPayloadType: isSending
821
+ ? extendedCodec.localRtxPayloadType
822
+ : extendedCodec.remoteRtxPayloadType,
817
823
  clockRate: extendedCodec.clockRate,
818
824
  parameters: {
819
- apt: extendedCodec.remotePayloadType,
825
+ apt: isSending
826
+ ? extendedCodec.localPayloadType
827
+ : extendedCodec.remotePayloadType,
820
828
  },
821
829
  rtcpFeedback: [],
822
830
  };
@@ -832,7 +840,9 @@ function getRtpCapabilities({ direction, extendedRtpCapabilities, }) {
832
840
  const ext = {
833
841
  kind: extendedExtension.kind,
834
842
  uri: extendedExtension.uri,
835
- preferredId: extendedExtension.recvId,
843
+ preferredId: isSending
844
+ ? extendedExtension.sendId
845
+ : extendedExtension.recvId,
836
846
  preferredEncrypt: extendedExtension.encrypt ?? false,
837
847
  direction: extendedExtension.direction,
838
848
  };
package/npm-scripts.mjs CHANGED
@@ -77,6 +77,7 @@ async function run() {
77
77
  }
78
78
 
79
79
  case 'lint': {
80
+ replaceVersion();
80
81
  lint();
81
82
 
82
83
  break;
@@ -170,6 +171,14 @@ function buildTypescript({ force, args = '' }) {
170
171
 
171
172
  // Generate .js CommonJS code and .d.ts TypeScript declaration files in lib/.
172
173
  executeCmd(`tsc ${args}`);
174
+
175
+ // NOTE: This must happen here (and not just in the `release` task) because
176
+ // the published tarball is built in GitHub Actions: `npm publish` runs the
177
+ // `prepare` script, which transpiles a fresh lib/ (lib/ is gitignored, so
178
+ // whatever `release` patched locally never reaches CI). `prepare` is the
179
+ // last hook NPM runs before assembling the tarball, so replacing the
180
+ // version right after `tsc` is the only reliable place.
181
+ replaceVersion();
173
182
  }
174
183
 
175
184
  function watchTypescript({ args = '' } = {}) {
@@ -321,8 +330,9 @@ async function release({ args = '' } = {}) {
321
330
  // Bump the version in package.json + package-lock.json.
322
331
  executeCmd(`npm version ${version} --no-git-tag-version`);
323
332
 
324
- // Also replace the version in the transpiled JS.
325
- replaceVersion();
333
+ // NOTE: No need to replace the version in the transpiled JS here: lib/ is
334
+ // gitignored and the published tarball is built from scratch in GitHub
335
+ // Actions, where `buildTypescript()` does the replacement.
326
336
 
327
337
  // Commit the bump, tag it, and push both. The pushed tag triggers
328
338
  // `mediasoup-client-npm-publish` workflow, which checks, creates the GitHub
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasoup-client",
3
- "version": "3.22.0",
3
+ "version": "3.23.1",
4
4
  "description": "mediasoup client side TypeScript library",
5
5
  "contributors": [
6
6
  "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
@@ -87,17 +87,17 @@
87
87
  "@eslint/js": "^10.0.1",
88
88
  "@types/jest": "^30.0.0",
89
89
  "@types/sdp-transform": "^3.0.0",
90
- "eslint": "^10.8.1",
90
+ "eslint": "^10.9.1",
91
91
  "eslint-config-prettier": "^10.1.8",
92
- "eslint-plugin-jest": "^29.16.1",
92
+ "eslint-plugin-jest": "^29.16.2",
93
93
  "eslint-plugin-prettier": "^5.5.6",
94
94
  "globals": "^17.11.0",
95
95
  "jest": "^30.4.2",
96
- "knip": "^6.32.2",
96
+ "knip": "^6.32.3",
97
97
  "open-cli": "^9.0.0",
98
98
  "prettier": "^3.9.6",
99
99
  "ts-jest": "^29.4.12",
100
100
  "typescript": "^6.0.3",
101
- "typescript-eslint": "^8.67.0"
101
+ "typescript-eslint": "^8.68.0"
102
102
  }
103
103
  }