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.
- package/lib/handlers/ortc/utils.d.ts.map +1 -1
- package/lib/handlers/ortc/utils.js +20 -8
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -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,
|
|
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
|
-
|
|
26
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
.map(exten => exten.preferredId));
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
package/lib/index.js
CHANGED