@webex/web-client-media-engine 3.31.6 → 3.32.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
@@ -7214,6 +7214,7 @@ var WcmeErrorType;
7214
7214
  WcmeErrorType["GET_MAX_BITRATE_FAILED"] = "GET_MAX_BITRATE_FAILED";
7215
7215
  WcmeErrorType["GET_PAYLOAD_TYPE_FAILED"] = "GET_PAYLOAD_TYPE_FAILED";
7216
7216
  WcmeErrorType["SET_NMG_FAILED"] = "SET_NMG_FAILED";
7217
+ WcmeErrorType["SET_SOURCE_STATE_OVERRIDE_FAILED"] = "SET_SOURCE_STATE_OVERRIDE_FAILED";
7217
7218
  WcmeErrorType["DATA_CHANNEL_SEND_FAILED"] = "DATA_CHANNEL_SEND_FAILED";
7218
7219
  WcmeErrorType["RENEW_PEER_CONNECTION_FAILED"] = "RENEW_PEER_CONNECTION_FAILED";
7219
7220
  })(WcmeErrorType || (WcmeErrorType = {}));
@@ -14648,6 +14649,7 @@ class SendOnlyTransceiver extends Transceiver {
14648
14649
  if (stats.type === 'outbound-rtp') {
14649
14650
  stats.mid = this.mid;
14650
14651
  stats.csi = this.csi;
14652
+ stats.sourceState = this.currentSourceState;
14651
14653
  stats.calliopeMediaType = this.mediaType;
14652
14654
  const senderId = this.munger.getSenderIds().find((id) => id.ssrc === stats.ssrc);
14653
14655
  if (senderId) {
@@ -14781,10 +14783,16 @@ class SendOnlyTransceiver extends Transceiver {
14781
14783
  this.negotiationNeeded.emit(OfferAnswerType.LocalOnly);
14782
14784
  }
14783
14785
  setSourceStateOverride(state) {
14786
+ if (getMediaFamily(this.mediaType) !== MediaFamily.Video) {
14787
+ logErrorAndThrow(WcmeErrorType.SET_SOURCE_STATE_OVERRIDE_FAILED, `Source state can only be overridden for video.`);
14788
+ }
14784
14789
  this.sourceStateOverride = state;
14785
14790
  this.sourceStateOverrideChange.emit();
14786
14791
  }
14787
14792
  get currentSourceState() {
14793
+ if (getMediaFamily(this.mediaType) !== MediaFamily.Video) {
14794
+ return undefined;
14795
+ }
14788
14796
  if (this.sourceStateOverride) {
14789
14797
  return this.sourceStateOverride;
14790
14798
  }
@@ -15322,7 +15330,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
15322
15330
  if (!this.getSendTransceiverOrThrow(mediaType).requested) {
15323
15331
  return;
15324
15332
  }
15325
- const streamStates = this.getVideoStreamStates(mediaType);
15333
+ const streamStates = this.getVideoStreamStates(getMediaContent(mediaType));
15326
15334
  const task = () => {
15327
15335
  var _a;
15328
15336
  (_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.sendMediaRequestStatus(streamStates);
@@ -15343,7 +15351,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
15343
15351
  : 0;
15344
15352
  let task;
15345
15353
  if (getMediaFamily(mediaType) === MediaFamily.Video) {
15346
- const sources = this.getVideoStreamStates(mediaType);
15354
+ const sources = this.getVideoStreamStates(getMediaContent(mediaType));
15347
15355
  if (sources === null) {
15348
15356
  return;
15349
15357
  }
@@ -15371,8 +15379,8 @@ SCTP Max Message Size: ${maxMessageSize}`);
15371
15379
  this.pendingJmpTasks.push(task);
15372
15380
  }
15373
15381
  }
15374
- getVideoStreamStates(mediaType) {
15375
- const sendTransceiver = this.getSendTransceiverOrThrow(mediaType);
15382
+ getVideoStreamStates(mediaContent) {
15383
+ const sendTransceiver = this.getSendTransceiverOrThrow(getMediaType(MediaFamily.Video, mediaContent));
15376
15384
  return sendTransceiver.senderIds.map((id) => ({
15377
15385
  id,
15378
15386
  state: sendTransceiver.currentSourceState,