@webex/web-client-media-engine 3.33.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 +13 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +13 -5
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -15473,21 +15473,24 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15473
15473
|
}
|
|
15474
15474
|
waitForIceGatheringComplete() {
|
|
15475
15475
|
return __awaiter$1(this, void 0, void 0, function* () {
|
|
15476
|
-
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.'));
|
|
15477
15480
|
if (this.pc.iceGatheringState === 'complete') {
|
|
15478
|
-
|
|
15481
|
+
finalizeIceCandidatesGathering();
|
|
15479
15482
|
}
|
|
15480
15483
|
else {
|
|
15481
15484
|
this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
|
|
15482
15485
|
if (candidate.candidate === null ||
|
|
15483
15486
|
(this.options.stopIceGatheringAfterFirstRelayCandidate &&
|
|
15484
15487
|
candidate.candidate.type === 'relay')) {
|
|
15485
|
-
|
|
15488
|
+
finalizeIceCandidatesGathering();
|
|
15486
15489
|
}
|
|
15487
15490
|
});
|
|
15488
15491
|
this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
|
|
15489
15492
|
if (this.pc.iceGatheringState === 'complete') {
|
|
15490
|
-
|
|
15493
|
+
finalizeIceCandidatesGathering();
|
|
15491
15494
|
}
|
|
15492
15495
|
});
|
|
15493
15496
|
}
|
|
@@ -15524,7 +15527,12 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
15524
15527
|
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `Error: ${error}. SDP: ${maskIp((_a = offer.sdp) !== null && _a !== void 0 ? _a : '')}`);
|
|
15525
15528
|
});
|
|
15526
15529
|
if (this.options.doFullIce) {
|
|
15527
|
-
|
|
15530
|
+
try {
|
|
15531
|
+
yield this.waitForIceGatheringComplete();
|
|
15532
|
+
}
|
|
15533
|
+
catch (error) {
|
|
15534
|
+
logErrorAndThrow(exports.WcmeErrorType.CREATE_OFFER_FAILED, `${error}`);
|
|
15535
|
+
}
|
|
15528
15536
|
}
|
|
15529
15537
|
const sdpToSend = this.prepareLocalOfferForRemoteServer((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
15530
15538
|
createOfferResolve({ type: 'offer', sdp: sdpToSend });
|