mediasoup-client 3.18.2 → 3.18.3

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 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/handlers/ortc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,SAAS,EACT,qBAAqB,EACrB,2BAA2B,EAC3B,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI,CAc5E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE;IAChB,GAAG,EAAE,qBAAqB,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,2BAA2B,CAAC;CACvC,GACC,IAAI,CAmCN;AAED,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAgBA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/handlers/ortc/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,SAAS,EACT,qBAAqB,EACrB,2BAA2B,EAC3B,MAAM,qBAAqB,CAAC;AAE7B;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI,CAc5E;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACxC,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE;IAChB,GAAG,EAAE,qBAAqB,CAAC;IAC3B,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,EAAE,2BAA2B,CAAC;CACvC,GACC,IAAI,CA6CN;AAED,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAgBA"}
@@ -22,18 +22,30 @@ function addNackSupportForOpus(rtpCapabilities) {
22
22
  * This function adds the given RTP header extension to given capabilities.
23
23
  */
24
24
  function addHeaderExtensionSupport(rtpCapabilities, headerExtension) {
25
- if (rtpCapabilities.headerExtensions?.some(exten => exten.kind === headerExtension.kind && exten.uri === headerExtension.uri)) {
26
- return;
25
+ let preferredId;
26
+ // Look for an already existing header extension with same `uri`. Don't
27
+ // try to match `kind` since all media sections in a Bundle SDP must share
28
+ // same `id` in extensions with same `uri` (as per spec). So if we are
29
+ // adding an audio extension and there is already a video extension with
30
+ // same `uri`, then reuse its preferred `id`.
31
+ const existingHeaderExtension = rtpCapabilities.headerExtensions?.find(exten => exten.uri === headerExtension.uri);
32
+ if (existingHeaderExtension) {
33
+ if (existingHeaderExtension.kind === headerExtension.kind) {
34
+ return;
35
+ }
36
+ else {
37
+ preferredId = existingHeaderExtension.preferredId;
38
+ }
27
39
  }
28
40
  if (!rtpCapabilities.headerExtensions) {
29
41
  rtpCapabilities.headerExtensions = [];
30
42
  }
31
- const setPreferredIds = new Set(rtpCapabilities.headerExtensions
32
- .filter(exten => exten.uri !== headerExtension.uri)
33
- .map(exten => exten.preferredId));
34
- let preferredId = 1;
35
- while (setPreferredIds.has(preferredId)) {
36
- ++preferredId;
43
+ if (preferredId === undefined) {
44
+ preferredId = 1;
45
+ const setPreferredIds = new Set(rtpCapabilities.headerExtensions.map(exten => exten.preferredId));
46
+ while (setPreferredIds.has(preferredId)) {
47
+ ++preferredId;
48
+ }
37
49
  }
38
50
  const newHeaderExtension = {
39
51
  kind: headerExtension.kind,
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 = "3.18.2";
9
+ export declare const version = "3.18.3";
10
10
  /**
11
11
  * Expose Device class and device detector helpers.
12
12
  */
package/lib/index.js CHANGED
@@ -10,7 +10,7 @@ exports.types = require("./types");
10
10
  /**
11
11
  * Expose mediasoup-client version.
12
12
  */
13
- exports.version = '3.18.2';
13
+ exports.version = '3.18.3';
14
14
  /**
15
15
  * Expose Device class and device detector helpers.
16
16
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasoup-client",
3
- "version": "3.18.2",
3
+ "version": "3.18.3",
4
4
  "description": "mediasoup client side TypeScript library",
5
5
  "contributors": [
6
6
  "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",