@webex/web-client-media-engine 3.28.0 → 3.28.2
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/dist/cjs/index.js +36 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +36 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -7566,6 +7566,8 @@ const maxFrameSizeToMaxBitrateMap = new Map([
|
|
|
7566
7566
|
[3600, 2500000],
|
|
7567
7567
|
[8160, 4000000],
|
|
7568
7568
|
]);
|
|
7569
|
+
const defaultVideoMainRtxTime = '300';
|
|
7570
|
+
const defaultVideoSlidesRtxTime = '1000';
|
|
7569
7571
|
function areProfileLevelIdsCompatible(senderProfileLevelId, receiverProfileLevelId, levelAsymmetryAllowed) {
|
|
7570
7572
|
const senderProfile = Number.parseInt(`0x${senderProfileLevelId}`, 16);
|
|
7571
7573
|
const recvProfile = Number.parseInt(`0x${receiverProfileLevelId}`, 16);
|
|
@@ -9804,10 +9806,10 @@ function addVlaExtension(mediaDescription) {
|
|
|
9804
9806
|
mediaDescription.addExtension({ uri: vlaExtensionUri });
|
|
9805
9807
|
}
|
|
9806
9808
|
}
|
|
9807
|
-
function applyFormatParameters(mediaDescription, paramsMap) {
|
|
9809
|
+
function applyFormatParameters(mediaDescription, codecs, paramsMap) {
|
|
9808
9810
|
paramsMap.forEach((value, param) => {
|
|
9809
9811
|
[...mediaDescription.codecs.values()]
|
|
9810
|
-
.filter((ci) => ci.name
|
|
9812
|
+
.filter((ci) => ci.name && codecs.includes(ci.name))
|
|
9811
9813
|
.forEach((ci) => {
|
|
9812
9814
|
if (value === null) {
|
|
9813
9815
|
ci.fmtParams.delete(param);
|
|
@@ -9928,7 +9930,7 @@ class EgressSdpMunger {
|
|
|
9928
9930
|
if (options.simulcastEnabled) {
|
|
9929
9931
|
mediaDescription.addLine(new SsrcGroupLine('SIM', this.streamIds.map((streamId) => streamId.ssrc)));
|
|
9930
9932
|
}
|
|
9931
|
-
applyFormatParameters(mediaDescription, this.customCodecParameters);
|
|
9933
|
+
applyFormatParameters(mediaDescription, ['H264', 'opus'], this.customCodecParameters);
|
|
9932
9934
|
if (options.twccDisabled) {
|
|
9933
9935
|
disableTwcc(mediaDescription);
|
|
9934
9936
|
}
|
|
@@ -10456,6 +10458,7 @@ class EventEmitter$2 extends events$1.exports.EventEmitter {
|
|
|
10456
10458
|
|
|
10457
10459
|
class IngressSdpMunger {
|
|
10458
10460
|
constructor() {
|
|
10461
|
+
this.customRtxCodecParameters = new Map();
|
|
10459
10462
|
this.ssrc = generateSsrc();
|
|
10460
10463
|
}
|
|
10461
10464
|
getReceiverId() {
|
|
@@ -10467,6 +10470,7 @@ class IngressSdpMunger {
|
|
|
10467
10470
|
logErrorAndThrow(exports.WcmeErrorType.SDP_MUNGE_MISSING_CODECS, `No codecs present in m-line with MID ${mediaDescription.mid} after filtering.`);
|
|
10468
10471
|
}
|
|
10469
10472
|
removeMidRidExtensions(mediaDescription);
|
|
10473
|
+
applyFormatParameters(mediaDescription, ['rtx'], this.customRtxCodecParameters);
|
|
10470
10474
|
if (options.twccDisabled) {
|
|
10471
10475
|
disableTwcc(mediaDescription);
|
|
10472
10476
|
}
|
|
@@ -10490,6 +10494,12 @@ class IngressSdpMunger {
|
|
|
10490
10494
|
[...mediaDescription.codecs.values()].forEach((ci) => {
|
|
10491
10495
|
ci.fmtParams.set('x-google-start-bitrate', '60000');
|
|
10492
10496
|
});
|
|
10497
|
+
applyFormatParameters(mediaDescription, ['rtx'], this.customRtxCodecParameters);
|
|
10498
|
+
}
|
|
10499
|
+
setRtxCodecParameters(parameters) {
|
|
10500
|
+
Object.entries(parameters).forEach(([param, value]) => {
|
|
10501
|
+
this.customRtxCodecParameters.set(param, value);
|
|
10502
|
+
});
|
|
10493
10503
|
}
|
|
10494
10504
|
reset() {
|
|
10495
10505
|
this.ssrc = generateSsrc();
|
|
@@ -10656,7 +10666,18 @@ class Transceiver {
|
|
|
10656
10666
|
return this._rtcRtpTransceiver.sender;
|
|
10657
10667
|
}
|
|
10658
10668
|
close() {
|
|
10659
|
-
|
|
10669
|
+
try {
|
|
10670
|
+
this._rtcRtpTransceiver.stop();
|
|
10671
|
+
}
|
|
10672
|
+
catch (error) {
|
|
10673
|
+
if (error instanceof DOMException && error.name === 'InvalidStateError') {
|
|
10674
|
+
logger.warn('Peer connection is already closed, skipping call to RTCRtpTransceiver.stop()');
|
|
10675
|
+
}
|
|
10676
|
+
else {
|
|
10677
|
+
logger.error('An unexpected error occurred while stopping the RTCRtpTransceiver:', error);
|
|
10678
|
+
throw error;
|
|
10679
|
+
}
|
|
10680
|
+
}
|
|
10660
10681
|
}
|
|
10661
10682
|
}
|
|
10662
10683
|
|
|
@@ -10708,7 +10729,9 @@ class ReceiveOnlyTransceiver extends Transceiver {
|
|
|
10708
10729
|
});
|
|
10709
10730
|
}
|
|
10710
10731
|
mungeLocalDescription(mediaDescription) {
|
|
10711
|
-
this.munger.mungeLocalDescription(mediaDescription, {
|
|
10732
|
+
this.munger.mungeLocalDescription(mediaDescription, {
|
|
10733
|
+
twccDisabled: this.twccDisabled,
|
|
10734
|
+
});
|
|
10712
10735
|
}
|
|
10713
10736
|
mungeRemoteDescription(mediaDescription) {
|
|
10714
10737
|
this.munger.mungeRemoteDescription(mediaDescription);
|
|
@@ -10745,6 +10768,9 @@ class ReceiveOnlyTransceiver extends Transceiver {
|
|
|
10745
10768
|
this.metadata.lastActiveSpeakerUpdateTimestamp = getCurrentTimestamp();
|
|
10746
10769
|
}
|
|
10747
10770
|
}
|
|
10771
|
+
setRtxCodecParameters(parameters) {
|
|
10772
|
+
this.munger.setRtxCodecParameters(parameters);
|
|
10773
|
+
}
|
|
10748
10774
|
}
|
|
10749
10775
|
ReceiveOnlyTransceiver.rid = '1';
|
|
10750
10776
|
|
|
@@ -15301,6 +15327,11 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15301
15327
|
mediaType,
|
|
15302
15328
|
munger,
|
|
15303
15329
|
});
|
|
15330
|
+
if (getMediaFamily(mediaType) === exports.MediaFamily.Video) {
|
|
15331
|
+
recvOnlyTransceiver.setRtxCodecParameters({
|
|
15332
|
+
'rtx-time': mediaType === exports.MediaType.VideoMain ? defaultVideoMainRtxTime : defaultVideoSlidesRtxTime,
|
|
15333
|
+
});
|
|
15334
|
+
}
|
|
15304
15335
|
recvOnlyTransceiver.twccDisabled =
|
|
15305
15336
|
getMediaFamily(mediaType) === exports.MediaFamily.Audio ? this.options.disableAudioTwcc : false;
|
|
15306
15337
|
this.recvTransceivers.set(mediaType, [
|