@webex/web-client-media-engine 3.15.7 → 3.16.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 CHANGED
@@ -14488,8 +14488,14 @@ const organizeTransceiverStats = (sendTransceivers, recvTransceivers) => __await
14488
14488
  };
14489
14489
  yield Promise.all([...sendTransceivers.entries()].map(([mediaType, transceiver]) => __awaiter$1(void 0, void 0, void 0, function* () {
14490
14490
  var _a;
14491
+ const report = [];
14492
+ (yield transceiver.getStats()).forEach((senderStats) => {
14493
+ if (senderStats.type === 'outbound-rtp') {
14494
+ report.push(Object.assign(Object.assign({}, senderStats), { requestedBitrate: transceiver.getRequestedBitrate(senderStats.ssrc), requestedFrameSize: transceiver.getRequestedFrameSize(senderStats.ssrc) }));
14495
+ }
14496
+ });
14491
14497
  const item = {
14492
- report: yield transceiver.getStats(),
14498
+ report,
14493
14499
  mid: transceiver.mid,
14494
14500
  csi: transceiver.csi,
14495
14501
  currentDirection: 'sendonly',
@@ -14511,8 +14517,14 @@ const organizeTransceiverStats = (sendTransceivers, recvTransceivers) => __await
14511
14517
  yield Promise.all([...recvTransceivers.entries()].map(([mediaType, transceivers]) => __awaiter$1(void 0, void 0, void 0, function* () {
14512
14518
  return Promise.all(transceivers.map((t) => __awaiter$1(void 0, void 0, void 0, function* () {
14513
14519
  var _b, _c;
14520
+ const report = [];
14521
+ (yield t.getStats()).forEach((receiverStats) => {
14522
+ if (receiverStats.type === 'inbound-rtp') {
14523
+ report.push(Object.assign(Object.assign({}, receiverStats), { requestedBitrate: t.requestedBitrate, requestedFrameSize: t.requestedFrameSize }));
14524
+ }
14525
+ });
14514
14526
  const item = {
14515
- report: yield t.getStats(),
14527
+ report,
14516
14528
  mid: (_b = t.receiveSlot.id) === null || _b === void 0 ? void 0 : _b.mid,
14517
14529
  csi: t.receiveSlot.currentRxCsi,
14518
14530
  currentDirection: 'recvonly',
@@ -14555,6 +14567,7 @@ exports.MultistreamConnectionEventNames = void 0;
14555
14567
  MultistreamConnectionEventNames["AudioSourceCountUpdate"] = "audio-source-count-update";
14556
14568
  MultistreamConnectionEventNames["ActiveSpeakerNotification"] = "active-speaker-notification";
14557
14569
  MultistreamConnectionEventNames["ConnectionStateUpdate"] = "connection-state-update";
14570
+ MultistreamConnectionEventNames["IceGatheringStateUpdate"] = "ice-gathering-state-update";
14558
14571
  MultistreamConnectionEventNames["NegotiationNeeded"] = "negotiation-needed";
14559
14572
  MultistreamConnectionEventNames["CreateOfferOnSuccess"] = "createofferonsuccess";
14560
14573
  MultistreamConnectionEventNames["CreateAnswerOnSuccess"] = "createansweronsuccess";
@@ -14622,10 +14635,16 @@ class MultistreamConnection extends EventEmitter$2 {
14622
14635
  this.pc.on(PeerConnection.Events.SetRemoteDescriptionOnSuccess, (description) => {
14623
14636
  this.emit(exports.MultistreamConnectionEventNames.SetRemoteDescriptionOnSuccess, description);
14624
14637
  });
14638
+ this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
14639
+ this.emit(exports.MultistreamConnectionEventNames.IceGatheringStateUpdate, this.getIceGatheringState());
14640
+ });
14625
14641
  }
14626
14642
  getConnectionState() {
14627
14643
  return this.pc.getConnectionState();
14628
14644
  }
14645
+ getIceGatheringState() {
14646
+ return this.pc.iceGatheringState;
14647
+ }
14629
14648
  getVideoEncodingOptions(content) {
14630
14649
  const enabledSimulcast = content === exports.MediaContent.Main
14631
14650
  ? !this.options.disableSimulcast
@@ -15229,12 +15248,16 @@ SCTP Max Message Size: ${maxMessageSize}`);
15229
15248
  streamRequests.forEach((sr) => {
15230
15249
  var _a;
15231
15250
  const isAffectedInStreamRequest = (t) => sr.receiveSlots.some((rs) => rs.id && compareStreamIds(rs.id, t.receiverId));
15232
- const affectedTransceivers = (_a = this.recvTransceivers
15233
- .get(mediaType)) === null || _a === void 0 ? void 0 : _a.filter(isAffectedInStreamRequest);
15234
- affectedTransceivers === null || affectedTransceivers === void 0 ? void 0 : affectedTransceivers.forEach((t) => {
15251
+ (_a = this.recvTransceivers.get(mediaType)) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
15235
15252
  var _a, _b;
15236
- t.requestedBitrate = sr.maxPayloadBitsPerSecond;
15237
- t.requestedFrameSize = (_b = (_a = sr.codecInfos[0]) === null || _a === void 0 ? void 0 : _a.h264) === null || _b === void 0 ? void 0 : _b.maxFs;
15253
+ if (isAffectedInStreamRequest(t)) {
15254
+ t.requestedBitrate = sr.maxPayloadBitsPerSecond;
15255
+ t.requestedFrameSize = (_b = (_a = sr.codecInfos[0]) === null || _a === void 0 ? void 0 : _a.h264) === null || _b === void 0 ? void 0 : _b.maxFs;
15256
+ }
15257
+ else {
15258
+ t.requestedBitrate = undefined;
15259
+ t.requestedFrameSize = undefined;
15260
+ }
15238
15261
  });
15239
15262
  });
15240
15263
  };