@webex/web-client-media-engine 3.0.2 → 3.2.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 +30 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +30 -19
- package/dist/esm/index.js.map +1 -1
- package/dist/types/index.d.ts +13 -6
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -9844,12 +9844,18 @@ class TypedEvent {
|
|
|
9844
9844
|
}
|
|
9845
9845
|
}
|
|
9846
9846
|
|
|
9847
|
+
var OfferAnswerType;
|
|
9848
|
+
(function (OfferAnswerType) {
|
|
9849
|
+
OfferAnswerType[OfferAnswerType["LocalOnly"] = 0] = "LocalOnly";
|
|
9850
|
+
OfferAnswerType[OfferAnswerType["Remote"] = 1] = "Remote";
|
|
9851
|
+
})(OfferAnswerType || (OfferAnswerType = {}));
|
|
9847
9852
|
class SendOnlyTransceiver extends Transceiver {
|
|
9848
9853
|
constructor(rtcRtpTransceiver, mid, csi, signaler, mediaType) {
|
|
9849
9854
|
super(rtcRtpTransceiver, mid);
|
|
9850
9855
|
this.rtxEnabled = false;
|
|
9851
9856
|
this.streamMuteStateChange = new TypedEvent();
|
|
9852
9857
|
this.streamPublishStateChange = new TypedEvent();
|
|
9858
|
+
this.negotiationNeeded = new TypedEvent();
|
|
9853
9859
|
this.requested = false;
|
|
9854
9860
|
this.requestedIdEncodingParamsMap = new Map();
|
|
9855
9861
|
this.csi = csi;
|
|
@@ -9933,7 +9939,9 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
9933
9939
|
setActive(enabled) {
|
|
9934
9940
|
this.direction = enabled ? 'sendrecv' : 'inactive';
|
|
9935
9941
|
this._rtcRtpTransceiver.direction = this.direction;
|
|
9936
|
-
|
|
9942
|
+
if (this._rtcRtpTransceiver.direction !== this._rtcRtpTransceiver.currentDirection) {
|
|
9943
|
+
this.negotiationNeeded.emit(OfferAnswerType.Remote);
|
|
9944
|
+
}
|
|
9937
9945
|
}
|
|
9938
9946
|
getStats() {
|
|
9939
9947
|
return this.sender.getStats();
|
|
@@ -9988,9 +9996,11 @@ class SendOnlyTransceiver extends Transceiver {
|
|
|
9988
9996
|
}
|
|
9989
9997
|
setCodecParameters(parameters) {
|
|
9990
9998
|
this.streamSignaler.setCodecParameters(parameters);
|
|
9999
|
+
this.negotiationNeeded.emit(OfferAnswerType.LocalOnly);
|
|
9991
10000
|
}
|
|
9992
10001
|
deleteCodecParameters(parameters) {
|
|
9993
10002
|
this.streamSignaler.deleteCodecParameters(parameters);
|
|
10003
|
+
this.negotiationNeeded.emit(OfferAnswerType.LocalOnly);
|
|
9994
10004
|
}
|
|
9995
10005
|
}
|
|
9996
10006
|
|
|
@@ -10017,6 +10027,16 @@ class SendSlot {
|
|
|
10017
10027
|
set active(active) {
|
|
10018
10028
|
this.sendTransceiver.setActive(active);
|
|
10019
10029
|
}
|
|
10030
|
+
setCodecParameters(parameters) {
|
|
10031
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10032
|
+
this.sendTransceiver.setCodecParameters(parameters);
|
|
10033
|
+
});
|
|
10034
|
+
}
|
|
10035
|
+
deleteCodecParameters(parameters) {
|
|
10036
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
10037
|
+
this.sendTransceiver.deleteCodecParameters(parameters);
|
|
10038
|
+
});
|
|
10039
|
+
}
|
|
10020
10040
|
}
|
|
10021
10041
|
|
|
10022
10042
|
function generateSsrc() {
|
|
@@ -13799,6 +13819,7 @@ var MultistreamConnectionEventNames;
|
|
|
13799
13819
|
MultistreamConnectionEventNames["AudioSourceCountUpdate"] = "audio-source-count-update";
|
|
13800
13820
|
MultistreamConnectionEventNames["ActiveSpeakerNotification"] = "active-speaker-notification";
|
|
13801
13821
|
MultistreamConnectionEventNames["ConnectionStateUpdate"] = "connection-state-update";
|
|
13822
|
+
MultistreamConnectionEventNames["NegotiationNeeded"] = "negotiation-needed";
|
|
13802
13823
|
})(MultistreamConnectionEventNames || (MultistreamConnectionEventNames = {}));
|
|
13803
13824
|
const defaultMultistreamConnectionOptions = {
|
|
13804
13825
|
disableSimulcast: getBrowserDetails().name === 'Firefox',
|
|
@@ -13891,6 +13912,14 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
13891
13912
|
this.sendSourceAdvertisement(mediaType);
|
|
13892
13913
|
this.sendMediaRequestStatus(mediaType);
|
|
13893
13914
|
});
|
|
13915
|
+
transceiver.negotiationNeeded.on((offerAnswerType) => {
|
|
13916
|
+
if (offerAnswerType === OfferAnswerType.Remote) {
|
|
13917
|
+
this.emit(MultistreamConnectionEventNames.NegotiationNeeded);
|
|
13918
|
+
}
|
|
13919
|
+
else if (this.pc.getRemoteDescription()) {
|
|
13920
|
+
this.queueLocalOfferAnswer();
|
|
13921
|
+
}
|
|
13922
|
+
});
|
|
13894
13923
|
this.sendTransceivers.set(mediaType, transceiver);
|
|
13895
13924
|
this.createJmpSession(mediaType);
|
|
13896
13925
|
}
|
|
@@ -14326,24 +14355,6 @@ class MultistreamConnection extends EventEmitter$2 {
|
|
|
14326
14355
|
}
|
|
14327
14356
|
return transceiver;
|
|
14328
14357
|
}
|
|
14329
|
-
setCodecParameters(mediaType, parameters) {
|
|
14330
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14331
|
-
const transceiver = this.sendTransceivers.get(mediaType);
|
|
14332
|
-
transceiver === null || transceiver === void 0 ? void 0 : transceiver.setCodecParameters(parameters);
|
|
14333
|
-
if (this.pc.getRemoteDescription()) {
|
|
14334
|
-
yield this.queueLocalOfferAnswer();
|
|
14335
|
-
}
|
|
14336
|
-
});
|
|
14337
|
-
}
|
|
14338
|
-
deleteCodecParameters(mediaType, parameters) {
|
|
14339
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
14340
|
-
const transceiver = this.sendTransceivers.get(mediaType);
|
|
14341
|
-
transceiver === null || transceiver === void 0 ? void 0 : transceiver.deleteCodecParameters(parameters);
|
|
14342
|
-
if (this.pc.getRemoteDescription()) {
|
|
14343
|
-
yield this.queueLocalOfferAnswer();
|
|
14344
|
-
}
|
|
14345
|
-
});
|
|
14346
|
-
}
|
|
14347
14358
|
requestMedia(mediaType, streamRequests) {
|
|
14348
14359
|
var _a;
|
|
14349
14360
|
const task = () => {
|