@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/esm/index.js CHANGED
@@ -14484,8 +14484,14 @@ const organizeTransceiverStats = (sendTransceivers, recvTransceivers) => __await
14484
14484
  };
14485
14485
  yield Promise.all([...sendTransceivers.entries()].map(([mediaType, transceiver]) => __awaiter$1(void 0, void 0, void 0, function* () {
14486
14486
  var _a;
14487
+ const report = [];
14488
+ (yield transceiver.getStats()).forEach((senderStats) => {
14489
+ if (senderStats.type === 'outbound-rtp') {
14490
+ report.push(Object.assign(Object.assign({}, senderStats), { requestedBitrate: transceiver.getRequestedBitrate(senderStats.ssrc), requestedFrameSize: transceiver.getRequestedFrameSize(senderStats.ssrc) }));
14491
+ }
14492
+ });
14487
14493
  const item = {
14488
- report: yield transceiver.getStats(),
14494
+ report,
14489
14495
  mid: transceiver.mid,
14490
14496
  csi: transceiver.csi,
14491
14497
  currentDirection: 'sendonly',
@@ -14507,8 +14513,14 @@ const organizeTransceiverStats = (sendTransceivers, recvTransceivers) => __await
14507
14513
  yield Promise.all([...recvTransceivers.entries()].map(([mediaType, transceivers]) => __awaiter$1(void 0, void 0, void 0, function* () {
14508
14514
  return Promise.all(transceivers.map((t) => __awaiter$1(void 0, void 0, void 0, function* () {
14509
14515
  var _b, _c;
14516
+ const report = [];
14517
+ (yield t.getStats()).forEach((receiverStats) => {
14518
+ if (receiverStats.type === 'inbound-rtp') {
14519
+ report.push(Object.assign(Object.assign({}, receiverStats), { requestedBitrate: t.requestedBitrate, requestedFrameSize: t.requestedFrameSize }));
14520
+ }
14521
+ });
14510
14522
  const item = {
14511
- report: yield t.getStats(),
14523
+ report,
14512
14524
  mid: (_b = t.receiveSlot.id) === null || _b === void 0 ? void 0 : _b.mid,
14513
14525
  csi: t.receiveSlot.currentRxCsi,
14514
14526
  currentDirection: 'recvonly',
@@ -14551,6 +14563,7 @@ var MultistreamConnectionEventNames;
14551
14563
  MultistreamConnectionEventNames["AudioSourceCountUpdate"] = "audio-source-count-update";
14552
14564
  MultistreamConnectionEventNames["ActiveSpeakerNotification"] = "active-speaker-notification";
14553
14565
  MultistreamConnectionEventNames["ConnectionStateUpdate"] = "connection-state-update";
14566
+ MultistreamConnectionEventNames["IceGatheringStateUpdate"] = "ice-gathering-state-update";
14554
14567
  MultistreamConnectionEventNames["NegotiationNeeded"] = "negotiation-needed";
14555
14568
  MultistreamConnectionEventNames["CreateOfferOnSuccess"] = "createofferonsuccess";
14556
14569
  MultistreamConnectionEventNames["CreateAnswerOnSuccess"] = "createansweronsuccess";
@@ -14618,10 +14631,16 @@ class MultistreamConnection extends EventEmitter$2 {
14618
14631
  this.pc.on(PeerConnection.Events.SetRemoteDescriptionOnSuccess, (description) => {
14619
14632
  this.emit(MultistreamConnectionEventNames.SetRemoteDescriptionOnSuccess, description);
14620
14633
  });
14634
+ this.pc.on(PeerConnection.Events.IceGatheringStateChange, () => {
14635
+ this.emit(MultistreamConnectionEventNames.IceGatheringStateUpdate, this.getIceGatheringState());
14636
+ });
14621
14637
  }
14622
14638
  getConnectionState() {
14623
14639
  return this.pc.getConnectionState();
14624
14640
  }
14641
+ getIceGatheringState() {
14642
+ return this.pc.iceGatheringState;
14643
+ }
14625
14644
  getVideoEncodingOptions(content) {
14626
14645
  const enabledSimulcast = content === MediaContent.Main
14627
14646
  ? !this.options.disableSimulcast
@@ -15225,12 +15244,16 @@ SCTP Max Message Size: ${maxMessageSize}`);
15225
15244
  streamRequests.forEach((sr) => {
15226
15245
  var _a;
15227
15246
  const isAffectedInStreamRequest = (t) => sr.receiveSlots.some((rs) => rs.id && compareStreamIds(rs.id, t.receiverId));
15228
- const affectedTransceivers = (_a = this.recvTransceivers
15229
- .get(mediaType)) === null || _a === void 0 ? void 0 : _a.filter(isAffectedInStreamRequest);
15230
- affectedTransceivers === null || affectedTransceivers === void 0 ? void 0 : affectedTransceivers.forEach((t) => {
15247
+ (_a = this.recvTransceivers.get(mediaType)) === null || _a === void 0 ? void 0 : _a.forEach((t) => {
15231
15248
  var _a, _b;
15232
- t.requestedBitrate = sr.maxPayloadBitsPerSecond;
15233
- t.requestedFrameSize = (_b = (_a = sr.codecInfos[0]) === null || _a === void 0 ? void 0 : _a.h264) === null || _b === void 0 ? void 0 : _b.maxFs;
15249
+ if (isAffectedInStreamRequest(t)) {
15250
+ t.requestedBitrate = sr.maxPayloadBitsPerSecond;
15251
+ t.requestedFrameSize = (_b = (_a = sr.codecInfos[0]) === null || _a === void 0 ? void 0 : _a.h264) === null || _b === void 0 ? void 0 : _b.maxFs;
15252
+ }
15253
+ else {
15254
+ t.requestedBitrate = undefined;
15255
+ t.requestedFrameSize = undefined;
15256
+ }
15234
15257
  });
15235
15258
  });
15236
15259
  };