@webex/web-client-media-engine 2.0.7 → 2.0.8
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 +39 -30
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +39 -30
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -13552,25 +13552,29 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13552
13552
|
}
|
|
13553
13553
|
createReceiveSlot(mediaType) {
|
|
13554
13554
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13555
|
-
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
13562
|
-
|
|
13563
|
-
|
|
13564
|
-
|
|
13555
|
+
return new Promise((createReceiveSlotResolve) => {
|
|
13556
|
+
this.offerAnswerQueue.push(() => __awaiter(this, void 0, void 0, function* () {
|
|
13557
|
+
const rtcRtpTransceiver = this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
13558
|
+
direction: 'recvonly',
|
|
13559
|
+
});
|
|
13560
|
+
this.addMid(mediaType);
|
|
13561
|
+
const recvOnlyTransceiver = new ReceiveOnlyTransceiver(rtcRtpTransceiver, (mid) => {
|
|
13562
|
+
const ingressSignaler = this.streamSignalerManager.getIngressStreamSignaler(mid);
|
|
13563
|
+
if (!ingressSignaler) {
|
|
13564
|
+
return null;
|
|
13565
|
+
}
|
|
13566
|
+
return ingressSignaler.getReceiverId();
|
|
13567
|
+
});
|
|
13568
|
+
if (this.pc.getRemoteDescription()) {
|
|
13569
|
+
yield this.doLocalOfferAnswer();
|
|
13570
|
+
}
|
|
13571
|
+
this.recvTransceivers.set(mediaType, [
|
|
13572
|
+
...(this.recvTransceivers.get(mediaType) || []),
|
|
13573
|
+
recvOnlyTransceiver,
|
|
13574
|
+
]);
|
|
13575
|
+
createReceiveSlotResolve(recvOnlyTransceiver.receiveSlot);
|
|
13576
|
+
}));
|
|
13565
13577
|
});
|
|
13566
|
-
if (this.pc.getRemoteDescription()) {
|
|
13567
|
-
yield this.doLocalOfferAnswer();
|
|
13568
|
-
}
|
|
13569
|
-
this.recvTransceivers.set(mediaType, [
|
|
13570
|
-
...(this.recvTransceivers.get(mediaType) || []),
|
|
13571
|
-
recvOnlyTransceiver,
|
|
13572
|
-
]);
|
|
13573
|
-
return recvOnlyTransceiver.receiveSlot;
|
|
13574
13578
|
});
|
|
13575
13579
|
}
|
|
13576
13580
|
getIngressPayloadType(mediaType, mimeType) {
|
|
@@ -13647,23 +13651,28 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13647
13651
|
logger.debug(`setAnswerResolve function was cleared between setAnswer and result of setRemoteDescription`);
|
|
13648
13652
|
}
|
|
13649
13653
|
if (isInitialAnswer && this.customCodecParameters.size > 0) {
|
|
13650
|
-
yield this.
|
|
13654
|
+
yield this.queueLocalOfferAnswer();
|
|
13651
13655
|
}
|
|
13652
13656
|
}));
|
|
13653
13657
|
});
|
|
13654
13658
|
}
|
|
13655
13659
|
doLocalOfferAnswer() {
|
|
13660
|
+
var _a;
|
|
13661
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
13662
|
+
const offer = yield this.pc.createOffer();
|
|
13663
|
+
if (!offer.sdp) {
|
|
13664
|
+
throw new Error('No SDP offer');
|
|
13665
|
+
}
|
|
13666
|
+
offer.sdp = this.preProcessLocalOffer(offer.sdp);
|
|
13667
|
+
yield this.pc.setLocalDescription(offer);
|
|
13668
|
+
const answer = this.preProcessRemoteAnswer((_a = this.pc.getRemoteDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
13669
|
+
return this.pc.setRemoteDescription({ type: 'answer', sdp: answer });
|
|
13670
|
+
});
|
|
13671
|
+
}
|
|
13672
|
+
queueLocalOfferAnswer() {
|
|
13656
13673
|
return __awaiter(this, void 0, void 0, function* () {
|
|
13657
13674
|
return this.offerAnswerQueue.push(() => __awaiter(this, void 0, void 0, function* () {
|
|
13658
|
-
|
|
13659
|
-
const offer = yield this.pc.createOffer();
|
|
13660
|
-
if (!offer.sdp) {
|
|
13661
|
-
throw new Error('No SDP offer');
|
|
13662
|
-
}
|
|
13663
|
-
offer.sdp = this.preProcessLocalOffer(offer.sdp);
|
|
13664
|
-
yield this.pc.setLocalDescription(offer);
|
|
13665
|
-
const answer = this.preProcessRemoteAnswer((_a = this.pc.getRemoteDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
|
|
13666
|
-
return this.pc.setRemoteDescription({ type: 'answer', sdp: answer });
|
|
13675
|
+
yield this.doLocalOfferAnswer();
|
|
13667
13676
|
}));
|
|
13668
13677
|
});
|
|
13669
13678
|
}
|
|
@@ -13796,7 +13805,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13796
13805
|
});
|
|
13797
13806
|
this.customCodecParameters.set(mediaType, currentParams);
|
|
13798
13807
|
if (this.pc.getRemoteDescription()) {
|
|
13799
|
-
yield this.
|
|
13808
|
+
yield this.queueLocalOfferAnswer();
|
|
13800
13809
|
}
|
|
13801
13810
|
});
|
|
13802
13811
|
}
|
|
@@ -13808,7 +13817,7 @@ class MultistreamConnection extends EventEmitter {
|
|
|
13808
13817
|
});
|
|
13809
13818
|
this.customCodecParameters.set(mediaType, currentParams);
|
|
13810
13819
|
if (this.pc.getRemoteDescription()) {
|
|
13811
|
-
yield this.
|
|
13820
|
+
yield this.queueLocalOfferAnswer();
|
|
13812
13821
|
}
|
|
13813
13822
|
});
|
|
13814
13823
|
}
|