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