@webex/web-client-media-engine 3.32.0 → 3.33.1
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 +21 -15
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +21 -15
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -7544,6 +7544,7 @@ exports.MediaCodecMimeType = void 0;
|
|
|
7544
7544
|
})(exports.MediaCodecMimeType || (exports.MediaCodecMimeType = {}));
|
|
7545
7545
|
const defaultMaxVideoEncodeFrameSize = 8160;
|
|
7546
7546
|
const defaultMaxVideoEncodeMbps = 244800;
|
|
7547
|
+
const defaultStartBitrateKbps = 3000;
|
|
7547
7548
|
exports.RecommendedOpusBitrates = void 0;
|
|
7548
7549
|
(function (RecommendedOpusBitrates) {
|
|
7549
7550
|
RecommendedOpusBitrates[RecommendedOpusBitrates["NB"] = 12000] = "NB";
|
|
@@ -9955,14 +9956,12 @@ class EgressSdpMunger {
|
|
|
9955
9956
|
logger.log(`Some unsupported remote candidates have been removed from mid ${mediaDescription.mid}`);
|
|
9956
9957
|
}
|
|
9957
9958
|
mediaDescription.bandwidth = undefined;
|
|
9958
|
-
[...mediaDescription.codecs.values()].forEach((ci) => {
|
|
9959
|
-
ci.fmtParams.set('x-google-start-bitrate', '60000');
|
|
9960
|
-
});
|
|
9961
9959
|
if (mediaDescription.type === 'audio') {
|
|
9962
9960
|
[...mediaDescription.codecs.values()].forEach((ci) => {
|
|
9963
9961
|
ci.fmtParams.set('usedtx', mungeOptions.dtxDisabled ? '0' : '1');
|
|
9964
9962
|
});
|
|
9965
9963
|
}
|
|
9964
|
+
applyFormatParameters(mediaDescription, ['H264', 'opus'], this.customCodecParameters);
|
|
9966
9965
|
}
|
|
9967
9966
|
getSenderIds() {
|
|
9968
9967
|
return this.streamIds;
|
|
@@ -10498,9 +10497,6 @@ class IngressSdpMunger {
|
|
|
10498
10497
|
if (retainCandidatesByTransportType(mediaDescription, ['udp', 'tcp'])) {
|
|
10499
10498
|
logger.log(`Some unsupported remote candidates have been removed from mid ${mediaDescription.mid}`);
|
|
10500
10499
|
}
|
|
10501
|
-
[...mediaDescription.codecs.values()].forEach((ci) => {
|
|
10502
|
-
ci.fmtParams.set('x-google-start-bitrate', '60000');
|
|
10503
|
-
});
|
|
10504
10500
|
applyFormatParameters(mediaDescription, ['rtx'], this.customRtxCodecParameters);
|
|
10505
10501
|
}
|
|
10506
10502
|
setCodecParameters(parameters) {
|
|
@@ -14973,6 +14969,7 @@ const defaultMultistreamConnectionOptions = {
|
|
|
14973
14969
|
doFullIce: BrowserInfo.isFirefox(),
|
|
14974
14970
|
stopIceGatheringAfterFirstRelayCandidate: false,
|
|
14975
14971
|
disableAudioMainDtx: true,
|
|
14972
|
+
preferredStartingBitrateKbps: defaultStartBitrateKbps,
|
|
14976
14973
|
metricsCallback: () => { },
|
|
14977
14974
|
};
|
|
14978
14975
|
class MultistreamConnection extends EventEmitter$2 {
|
|
@@ -15091,13 +15088,14 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
15091
15088
|
munger,
|
|
15092
15089
|
csi,
|
|
15093
15090
|
});
|
|
15091
|
+
let codecParameters = {
|
|
15092
|
+
'x-google-start-bitrate': `${this.options.preferredStartingBitrateKbps}`,
|
|
15093
|
+
};
|
|
15094
15094
|
if (getMediaFamily(mediaType) === exports.MediaFamily.Video) {
|
|
15095
15095
|
transceiver.rtxEnabled = true;
|
|
15096
|
-
|
|
15097
|
-
'max-mbps': `${defaultMaxVideoEncodeMbps}`,
|
|
15098
|
-
'max-fs': `${defaultMaxVideoEncodeFrameSize}`,
|
|
15099
|
-
});
|
|
15096
|
+
codecParameters = Object.assign(Object.assign({}, codecParameters), { 'max-mbps': `${defaultMaxVideoEncodeMbps}`, 'max-fs': `${defaultMaxVideoEncodeFrameSize}` });
|
|
15100
15097
|
}
|
|
15098
|
+
transceiver.setCodecParameters(codecParameters);
|
|
15101
15099
|
transceiver.twccDisabled =
|
|
15102
15100
|
getMediaFamily(mediaType) === exports.MediaFamily.Audio ? this.options.disableAudioTwcc : false;
|
|
15103
15101
|
transceiver.dtxDisabled = mediaType !== exports.MediaType.AudioMain || this.options.disableAudioMainDtx;
|
|
@@ -15475,21 +15473,24 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15475
15473
|
}
|
|
15476
15474
|
waitForIceGatheringComplete() {
|
|
15477
15475
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
15478
|
-
return new Promise((resolve) => {
|
|
15476
|
+
return new Promise((resolve, reject) => {
|
|
15477
|
+
const finalizeIceCandidatesGathering = () => this.pc.getIceCandidates().length > 0
|
|
15478
|
+
? resolve()
|
|
15479
|
+
: reject(new Error('No ICE candidates gathered.'));
|
|
15479
15480
|
if (this.pc.iceGatheringState === 'complete') {
|
|
15480
|
-
|
|
15481
|
+
finalizeIceCandidatesGathering();
|
|
15481
15482
|
}
|
|
15482
15483
|
else {
|
|
15483
15484
|
this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
|
|
15484
15485
|
if (candidate.candidate === null ||
|
|
15485
15486
|
(this.options.stopIceGatheringAfterFirstRelayCandidate &&
|
|
15486
15487
|
candidate.candidate.type === 'relay')) {
|
|
15487
|
-
|
|
15488
|
+
finalizeIceCandidatesGathering();
|
|
15488
15489
|
}
|
|
15489
15490
|
});
|
|
15490
15491
|
this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
|
|
15491
15492
|
if (this.pc.iceGatheringState === 'complete') {
|
|
15492
|
-
|
|
15493
|
+
finalizeIceCandidatesGathering();
|
|
15493
15494
|
}
|
|
15494
15495
|
});
|
|
15495
15496
|
}
|
|
@@ -15526,7 +15527,12 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15526
15527
|
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
|
|
15527
15528
|
});
|
|
15528
15529
|
if (this.options.doFullIce) {
|
|
15529
|
-
|
|
15530
|
+
try {
|
|
15531
|
+
yield this.waitForIceGatheringComplete();
|
|
15532
|
+
}
|
|
15533
|
+
catch (error) {
|
|
15534
|
+
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `${error}`);
|
|
15535
|
+
}
|
|
15530
15536
|
}
|
|
15531
15537
|
const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
15532
15538
|
createOfferResolve({ type: 'offer', sdp: sdpToSend });
|