@webex/web-client-media-engine 3.35.1 → 3.35.2
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 +18 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +18 -6
- 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
|
@@ -16211,6 +16211,9 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
16211
16211
|
csi: sendTransceiver.csi,
|
|
16212
16212
|
}));
|
|
16213
16213
|
}
|
|
16214
|
+
static getEncodedTransformId(mediaType, mid) {
|
|
16215
|
+
return `INBOUND-${mediaType}-${mid}`;
|
|
16216
|
+
}
|
|
16214
16217
|
createReceiveTransceiver(mediaType) {
|
|
16215
16218
|
const rtcRtpTransceiver = this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
16216
16219
|
direction: 'recvonly',
|
|
@@ -16225,20 +16228,19 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
16225
16228
|
munger,
|
|
16226
16229
|
});
|
|
16227
16230
|
if (doAudioLevelMonitoring) {
|
|
16228
|
-
const encodedTransformId = `INBOUND-${mediaType}-${mid}`;
|
|
16229
16231
|
try {
|
|
16230
|
-
this.setupEncodedTransform(rtcRtpTransceiver.receiver,
|
|
16232
|
+
this.setupEncodedTransform(rtcRtpTransceiver.receiver, MultistreamConnection.getEncodedTransformId(mediaType, recvOnlyTransceiver.mid), EncodedTransformType.AudioLevelMonitor);
|
|
16231
16233
|
recvOnlyTransceiver.setEncodedStreamMetadataCallback(() => __awaiter(this, void 0, void 0, function* () {
|
|
16232
16234
|
return getWorkerManager().sendRequestToWorker({
|
|
16233
16235
|
type: MainMsgType.GetMetadata,
|
|
16234
16236
|
mediaType,
|
|
16235
|
-
encodedTransformId,
|
|
16237
|
+
encodedTransformId: MultistreamConnection.getEncodedTransformId(mediaType, recvOnlyTransceiver.mid),
|
|
16236
16238
|
multistreamConnectionId: this.id,
|
|
16237
16239
|
});
|
|
16238
16240
|
}));
|
|
16239
16241
|
}
|
|
16240
16242
|
catch (e) {
|
|
16241
|
-
logger.warn(`Failed to setup encoded transform for
|
|
16243
|
+
logger.warn(`Failed to setup encoded transform for audio level monitoring of mid=${mid}: ${e}`);
|
|
16242
16244
|
}
|
|
16243
16245
|
}
|
|
16244
16246
|
if (getMediaFamily(mediaType) === MediaFamily.Video) {
|
|
@@ -16621,6 +16623,12 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
16621
16623
|
var _a;
|
|
16622
16624
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16623
16625
|
(_a = this.pc) === null || _a === void 0 ? void 0 : _a.close();
|
|
16626
|
+
if (getWorkerManager().getWorker()) {
|
|
16627
|
+
yield getWorkerManager().sendRequestToWorker({
|
|
16628
|
+
type: MainMsgType.ClearMetadata,
|
|
16629
|
+
multistreamConnectionId: this.id,
|
|
16630
|
+
});
|
|
16631
|
+
}
|
|
16624
16632
|
try {
|
|
16625
16633
|
if (userOptions) {
|
|
16626
16634
|
this.options = Object.assign(Object.assign({}, this.options), (yield userOptions));
|
|
@@ -16654,10 +16662,14 @@ SCTP Max Message Size: ${maxMessageSize}`);
|
|
|
16654
16662
|
this.recvTransceivers.forEach((transceivers, mediaType) => {
|
|
16655
16663
|
transceivers.forEach((t) => {
|
|
16656
16664
|
const mid = this.midPredictor.getNextMid(mediaType);
|
|
16657
|
-
|
|
16665
|
+
const rtcRtpTransceiver = this.pc.addTransceiver(toMediaStreamTrackKind(mediaType), {
|
|
16658
16666
|
direction: 'recvonly',
|
|
16659
|
-
})
|
|
16667
|
+
});
|
|
16668
|
+
t.replaceTransceiver(rtcRtpTransceiver);
|
|
16660
16669
|
t.mid = mid;
|
|
16670
|
+
if (this.options.enableInboundAudioLevelMonitoring && mediaType === MediaType.AudioMain) {
|
|
16671
|
+
this.setupEncodedTransform(rtcRtpTransceiver.receiver, MultistreamConnection.getEncodedTransformId(mediaType, mid), EncodedTransformType.AudioLevelMonitor);
|
|
16672
|
+
}
|
|
16661
16673
|
});
|
|
16662
16674
|
});
|
|
16663
16675
|
});
|