@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/esm/index.js
CHANGED
|
@@ -7562,6 +7562,8 @@ const maxFrameSizeToMaxBitrateMap = new Map([
|
|
|
7562
7562
|
[3600, 2500000],
|
|
7563
7563
|
[8160, 4000000],
|
|
7564
7564
|
]);
|
|
7565
|
+
const defaultVideoMainRtxTime = '300';
|
|
7566
|
+
const defaultVideoSlidesRtxTime = '1000';
|
|
7565
7567
|
function areProfileLevelIdsCompatible(senderProfileLevelId, receiverProfileLevelId, levelAsymmetryAllowed) {
|
|
7566
7568
|
const senderProfile = Number.parseInt(`0x${senderProfileLevelId}`, 16);
|
|
7567
7569
|
const recvProfile = Number.parseInt(`0x${receiverProfileLevelId}`, 16);
|
|
@@ -9800,10 +9802,10 @@ function addVlaExtension(mediaDescription) {
|
|
|
9800
9802
|
mediaDescription.addExtension({ uri: vlaExtensionUri });
|
|
9801
9803
|
}
|
|
9802
9804
|
}
|
|
9803
|
-
function applyFormatParameters(mediaDescription, paramsMap) {
|
|
9805
|
+
function applyFormatParameters(mediaDescription, codecs, paramsMap) {
|
|
9804
9806
|
paramsMap.forEach((value, param) => {
|
|
9805
9807
|
[...mediaDescription.codecs.values()]
|
|
9806
|
-
.filter((ci) => ci.name
|
|
9808
|
+
.filter((ci) => ci.name && codecs.includes(ci.name))
|
|
9807
9809
|
.forEach((ci) => {
|
|
9808
9810
|
if (value === null) {
|
|
9809
9811
|
ci.fmtParams.delete(param);
|
|
@@ -9924,7 +9926,7 @@ class EgressSdpMunger {
|
|
|
9924
9926
|
if (options.simulcastEnabled) {
|
|
9925
9927
|
mediaDescription.addLine(new SsrcGroupLine('SIM', this.streamIds.map((streamId) => streamId.ssrc)));
|
|
9926
9928
|
}
|
|
9927
|
-
applyFormatParameters(mediaDescription, this.customCodecParameters);
|
|
9929
|
+
applyFormatParameters(mediaDescription, ['H264', 'opus'], this.customCodecParameters);
|
|
9928
9930
|
if (options.twccDisabled) {
|
|
9929
9931
|
disableTwcc(mediaDescription);
|
|
9930
9932
|
}
|
|
@@ -10452,6 +10454,7 @@ class EventEmitter$2 extends events$1.exports.EventEmitter {
|
|
|
10452
10454
|
|
|
10453
10455
|
class IngressSdpMunger {
|
|
10454
10456
|
constructor() {
|
|
10457
|
+
this.customRtxCodecParameters = new Map();
|
|
10455
10458
|
this.ssrc = generateSsrc();
|
|
10456
10459
|
}
|
|
10457
10460
|
getReceiverId() {
|
|
@@ -10463,6 +10466,7 @@ class IngressSdpMunger {
|
|
|
10463
10466
|
logErrorAndThrow(WcmeErrorType.SDP_MUNGE_MISSING_CODECS, `No codecs present in m-line with MID ${mediaDescription.mid} after filtering.`);
|
|
10464
10467
|
}
|
|
10465
10468
|
removeMidRidExtensions(mediaDescription);
|
|
10469
|
+
applyFormatParameters(mediaDescription, ['rtx'], this.customRtxCodecParameters);
|
|
10466
10470
|
if (options.twccDisabled) {
|
|
10467
10471
|
disableTwcc(mediaDescription);
|
|
10468
10472
|
}
|
|
@@ -10486,6 +10490,12 @@ class IngressSdpMunger {
|
|
|
10486
10490
|
[...mediaDescription.codecs.values()].forEach((ci) => {
|
|
10487
10491
|
ci.fmtParams.set('x-google-start-bitrate', '60000');
|
|
10488
10492
|
});
|
|
10493
|
+
applyFormatParameters(mediaDescription, ['rtx'], this.customRtxCodecParameters);
|
|
10494
|
+
}
|
|
10495
|
+
setRtxCodecParameters(parameters) {
|
|
10496
|
+
Object.entries(parameters).forEach(([param, value]) => {
|
|
10497
|
+
this.customRtxCodecParameters.set(param, value);
|
|
10498
|
+
});
|
|
10489
10499
|
}
|
|
10490
10500
|
reset() {
|
|
10491
10501
|
this.ssrc = generateSsrc();
|
|
@@ -10652,7 +10662,18 @@ class Transceiver {
|
|
|
10652
10662
|
return this._rtcRtpTransceiver.sender;
|
|
10653
10663
|
}
|
|
10654
10664
|
close() {
|
|
10655
|
-
|
|
10665
|
+
try {
|
|
10666
|
+
this._rtcRtpTransceiver.stop();
|
|
10667
|
+
}
|
|
10668
|
+
catch (error) {
|
|
10669
|
+
if (error instanceof DOMException && error.name === 'InvalidStateError') {
|
|
10670
|
+
logger.warn('Peer connection is already closed, skipping call to RTCRtpTransceiver.stop()');
|
|
10671
|
+
}
|
|
10672
|
+
else {
|
|
10673
|
+
logger.error('An unexpected error occurred while stopping the RTCRtpTransceiver:', error);
|
|
10674
|
+
throw error;
|
|
10675
|
+
}
|
|
10676
|
+
}
|
|
10656
10677
|
}
|
|
10657
10678
|
}
|
|
10658
10679
|
|
|
@@ -10704,7 +10725,9 @@ class ReceiveOnlyTransceiver extends Transceiver {
|
|
|
10704
10725
|
});
|
|
10705
10726
|
}
|
|
10706
10727
|
mungeLocalDescription(mediaDescription) {
|
|
10707
|
-
this.munger.mungeLocalDescription(mediaDescription, {
|
|
10728
|
+
this.munger.mungeLocalDescription(mediaDescription, {
|
|
10729
|
+
twccDisabled: this.twccDisabled,
|
|
10730
|
+
});
|
|
10708
10731
|
}
|
|
10709
10732
|
mungeRemoteDescription(mediaDescription) {
|
|
10710
10733
|
this.munger.mungeRemoteDescription(mediaDescription);
|
|
@@ -10741,6 +10764,9 @@ class ReceiveOnlyTransceiver extends Transceiver {
|
|
|
10741
10764
|
this.metadata.lastActiveSpeakerUpdateTimestamp = getCurrentTimestamp();
|
|
10742
10765
|
}
|
|
10743
10766
|
}
|
|
10767
|
+
setRtxCodecParameters(parameters) {
|
|
10768
|
+
this.munger.setRtxCodecParameters(parameters);
|
|
10769
|
+
}
|
|
10744
10770
|
}
|
|
10745
10771
|
ReceiveOnlyTransceiver.rid = '1';
|
|
10746
10772
|
|
|
@@ -15297,6 +15323,11 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15297
15323
|
mediaType,
|
|
15298
15324
|
munger,
|
|
15299
15325
|
});
|
|
15326
|
+
if (getMediaFamily(mediaType) === MediaFamily.Video) {
|
|
15327
|
+
recvOnlyTransceiver.setRtxCodecParameters({
|
|
15328
|
+
'rtx-time': mediaType === MediaType.VideoMain ? defaultVideoMainRtxTime : defaultVideoSlidesRtxTime,
|
|
15329
|
+
});
|
|
15330
|
+
}
|
|
15300
15331
|
recvOnlyTransceiver.twccDisabled =
|
|
15301
15332
|
getMediaFamily(mediaType) === MediaFamily.Audio ? this.options.disableAudioTwcc : false;
|
|
15302
15333
|
this.recvTransceivers.set(mediaType, [
|