@webex/web-client-media-engine 3.10.1 → 3.11.0
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 +28 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +28 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -9034,6 +9034,18 @@ function parse(sdp, grammar = DefaultSdpGrammar) {
|
|
|
9034
9034
|
const parsed = parseToModel(lines);
|
|
9035
9035
|
return parsed;
|
|
9036
9036
|
}
|
|
9037
|
+
|
|
9038
|
+
function disableRtcpFbValue(sdpOrAv, rtcpFbValue) {
|
|
9039
|
+
const mediaDescriptions = sdpOrAv instanceof Sdp ? sdpOrAv.avMedia : [sdpOrAv];
|
|
9040
|
+
mediaDescriptions.forEach((media) => {
|
|
9041
|
+
media.codecs.forEach((codec) => {
|
|
9042
|
+
codec.feedback = codec.feedback.filter((fb) => fb !== rtcpFbValue);
|
|
9043
|
+
});
|
|
9044
|
+
});
|
|
9045
|
+
}
|
|
9046
|
+
function disableTwcc(sdpOrAv) {
|
|
9047
|
+
disableRtcpFbValue(sdpOrAv, 'transport-cc');
|
|
9048
|
+
}
|
|
9037
9049
|
function removeCodec(sdpOrAv, codecName) {
|
|
9038
9050
|
const mediaDescriptions = sdpOrAv instanceof Sdp ? sdpOrAv.avMedia : [sdpOrAv];
|
|
9039
9051
|
mediaDescriptions.forEach((media) => {
|
|
@@ -9375,7 +9387,7 @@ class EgressSdpMunger {
|
|
|
9375
9387
|
reset() {
|
|
9376
9388
|
this.streamIds = [];
|
|
9377
9389
|
}
|
|
9378
|
-
mungeLocalDescription(mediaDescription, simulcastEnabled, rtxEnabled) {
|
|
9390
|
+
mungeLocalDescription(mediaDescription, simulcastEnabled, rtxEnabled, twccDisabled) {
|
|
9379
9391
|
var _a;
|
|
9380
9392
|
retainCodecs(mediaDescription, ['h264', 'opus', 'rtx']);
|
|
9381
9393
|
if (mediaDescription.codecs.size === 0) {
|
|
@@ -9453,6 +9465,9 @@ class EgressSdpMunger {
|
|
|
9453
9465
|
mediaDescription.addLine(new SsrcGroupLine('SIM', this.streamIds.map((streamId) => streamId.ssrc)));
|
|
9454
9466
|
}
|
|
9455
9467
|
applyFormatParameters(mediaDescription, this.customCodecParameters);
|
|
9468
|
+
if (twccDisabled) {
|
|
9469
|
+
disableTwcc(mediaDescription);
|
|
9470
|
+
}
|
|
9456
9471
|
}
|
|
9457
9472
|
mungeLocalDescriptionForRemoteServer(mediaDescription, mediaContent, csi) {
|
|
9458
9473
|
injectContentType(mediaDescription, mediaContent);
|
|
@@ -9979,13 +9994,16 @@ class IngressSdpMunger {
|
|
|
9979
9994
|
getReceiverId() {
|
|
9980
9995
|
return Object.assign({ ssrc: this.ssrc }, (this.rtxSsrc ? { rtxSsrc: this.rtxSsrc } : {}));
|
|
9981
9996
|
}
|
|
9982
|
-
mungeLocalDescription(mediaDescription) {
|
|
9997
|
+
mungeLocalDescription(mediaDescription, twccDisabled) {
|
|
9983
9998
|
retainCodecs(mediaDescription, ['h264', 'opus', 'rtx']);
|
|
9984
9999
|
if (mediaDescription.codecs.size === 0) {
|
|
9985
10000
|
logErrorAndThrow(WcmeErrorType.SDP_MUNGE_MISSING_CODECS, `No codecs present in m-line with MID ${mediaDescription.mid} after filtering.`);
|
|
9986
10001
|
}
|
|
9987
10002
|
mediaDescription.bandwidth = new BandwidthLine('TIAS', 20000000);
|
|
9988
10003
|
removeMidRidExtensions(mediaDescription);
|
|
10004
|
+
if (twccDisabled) {
|
|
10005
|
+
disableTwcc(mediaDescription);
|
|
10006
|
+
}
|
|
9989
10007
|
}
|
|
9990
10008
|
mungeRemoteDescription(mediaDescription) {
|
|
9991
10009
|
if (!mediaDescription.ssrcs.length) {
|
|
@@ -10135,6 +10153,7 @@ ReceiveSlot.Events = ReceiveSlotEvents;
|
|
|
10135
10153
|
|
|
10136
10154
|
class Transceiver {
|
|
10137
10155
|
constructor(rtcRtpTransceiver, mid) {
|
|
10156
|
+
this.twccDisabled = false;
|
|
10138
10157
|
this._rtcRtpTransceiver = rtcRtpTransceiver;
|
|
10139
10158
|
this.mid = mid;
|
|
10140
10159
|
}
|
|
@@ -10178,7 +10197,7 @@ class ReceiveOnlyTransceiver extends Transceiver {
|
|
|
10178
10197
|
return this.receiver.getStats();
|
|
10179
10198
|
}
|
|
10180
10199
|
mungeLocalDescription(mediaDescription) {
|
|
10181
|
-
this.munger.mungeLocalDescription(mediaDescription);
|
|
10200
|
+
this.munger.mungeLocalDescription(mediaDescription, this.twccDisabled);
|
|
10182
10201
|
}
|
|
10183
10202
|
mungeRemoteDescription(mediaDescription) {
|
|
10184
10203
|
this.munger.mungeRemoteDescription(mediaDescription);
|
|
@@ -14041,7 +14060,7 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
14041
14060
|
return params.encodings.length > 1;
|
|
14042
14061
|
}
|
|
14043
14062
|
mungeLocalDescription(mediaDescription) {
|
|
14044
|
-
this.munger.mungeLocalDescription(mediaDescription, this.isSimulcastEnabled(), this.rtxEnabled);
|
|
14063
|
+
this.munger.mungeLocalDescription(mediaDescription, this.isSimulcastEnabled(), this.rtxEnabled, this.twccDisabled);
|
|
14045
14064
|
}
|
|
14046
14065
|
mungeLocalDescriptionForRemoteServer(mediaDescription) {
|
|
14047
14066
|
this.munger.mungeLocalDescriptionForRemoteServer(mediaDescription, getMediaContent(this.mediaType), this.csi);
|
|
@@ -14227,6 +14246,7 @@ const defaultMultistreamConnectionOptions = {
|
|
|
14227
14246
|
bundlePolicy: 'max-compat',
|
|
14228
14247
|
iceServers: undefined,
|
|
14229
14248
|
disableContentSimulcast: true,
|
|
14249
|
+
disableAudioTwcc: true,
|
|
14230
14250
|
};
|
|
14231
14251
|
class MultistreamConnection extends EventEmitter$2 {
|
|
14232
14252
|
constructor(userOptions = {}) {
|
|
@@ -14304,6 +14324,8 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14304
14324
|
'max-fs': `${defaultMaxVideoEncodeFrameSize}`,
|
|
14305
14325
|
});
|
|
14306
14326
|
}
|
|
14327
|
+
transceiver.twccDisabled =
|
|
14328
|
+
getMediaFamily(mediaType) === MediaFamily.Audio ? this.options.disableAudioTwcc : false;
|
|
14307
14329
|
transceiver.active = false;
|
|
14308
14330
|
transceiver.streamMuteStateChange.on(() => {
|
|
14309
14331
|
this.sendSourceAdvertisement(mediaType);
|
|
@@ -14564,6 +14586,8 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14564
14586
|
const transceiverMid = this.midPredictor.getNextMid(mediaType);
|
|
14565
14587
|
const munger = new IngressSdpMunger();
|
|
14566
14588
|
const recvOnlyTransceiver = new ReceiveOnlyTransceiver(rtcRtpTransceiver, transceiverMid, munger);
|
|
14589
|
+
recvOnlyTransceiver.twccDisabled =
|
|
14590
|
+
getMediaFamily(mediaType) === MediaFamily.Audio ? this.options.disableAudioTwcc : false;
|
|
14567
14591
|
this.recvTransceivers.set(mediaType, [
|
|
14568
14592
|
...(this.recvTransceivers.get(mediaType) || []),
|
|
14569
14593
|
recvOnlyTransceiver,
|