@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/cjs/index.js CHANGED
@@ -7218,6 +7218,7 @@ exports.WcmeErrorType = void 0;
7218
7218
  WcmeErrorType["GET_MAX_BITRATE_FAILED"] = "GET_MAX_BITRATE_FAILED";
7219
7219
  WcmeErrorType["GET_PAYLOAD_TYPE_FAILED"] = "GET_PAYLOAD_TYPE_FAILED";
7220
7220
  WcmeErrorType["SET_NMG_FAILED"] = "SET_NMG_FAILED";
7221
+ WcmeErrorType["SET_SOURCE_STATE_OVERRIDE_FAILED"] = "SET_SOURCE_STATE_OVERRIDE_FAILED";
7221
7222
  WcmeErrorType["DATA_CHANNEL_SEND_FAILED"] = "DATA_CHANNEL_SEND_FAILED";
7222
7223
  WcmeErrorType["RENEW_PEER_CONNECTION_FAILED"] = "RENEW_PEER_CONNECTION_FAILED";
7223
7224
  })(exports.WcmeErrorType || (exports.WcmeErrorType = {}));
@@ -14652,6 +14653,7 @@ class SendOnlyTransceiver extends Transceiver {
14652
14653
  if (stats.type === 'outbound-rtp') {
14653
14654
  stats.mid = this.mid;
14654
14655
  stats.csi = this.csi;
14656
+ stats.sourceState = this.currentSourceState;
14655
14657
  stats.calliopeMediaType = this.mediaType;
14656
14658
  const senderId = this.munger.getSenderIds().find((id) => id.ssrc === stats.ssrc);
14657
14659
  if (senderId) {
@@ -14785,10 +14787,16 @@ class SendOnlyTransceiver extends Transceiver {
14785
14787
  this.negotiationNeeded.emit(OfferAnswerType.LocalOnly);
14786
14788
  }
14787
14789
  setSourceStateOverride(state) {
14790
+ if (getMediaFamily(this.mediaType) !== exports.MediaFamily.Video) {
14791
+ logErrorAndThrow(exports.WcmeErrorType.SET_SOURCE_STATE_OVERRIDE_FAILED, `Source state can only be overridden for video.`);
14792
+ }
14788
14793
  this.sourceStateOverride = state;
14789
14794
  this.sourceStateOverrideChange.emit();
14790
14795
  }
14791
14796
  get currentSourceState() {
14797
+ if (getMediaFamily(this.mediaType) !== exports.MediaFamily.Video) {
14798
+ return undefined;
14799
+ }
14792
14800
  if (this.sourceStateOverride) {
14793
14801
  return this.sourceStateOverride;
14794
14802
  }
@@ -15326,7 +15334,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
15326
15334
  if (!this.getSendTransceiverOrThrow(mediaType).requested) {
15327
15335
  return;
15328
15336
  }
15329
- const streamStates = this.getVideoStreamStates(mediaType);
15337
+ const streamStates = this.getVideoStreamStates(getMediaContent(mediaType));
15330
15338
  const task = () => {
15331
15339
  var _a;
15332
15340
  (_a = this.jmpSessions.get(mediaType)) === null || _a === void 0 ? void 0 : _a.sendMediaRequestStatus(streamStates);
@@ -15347,7 +15355,7 @@ SCTP Max Message Size: ${maxMessageSize}`);
15347
15355
  : 0;
15348
15356
  let task;
15349
15357
  if (getMediaFamily(mediaType) === exports.MediaFamily.Video) {
15350
- const sources = this.getVideoStreamStates(mediaType);
15358
+ const sources = this.getVideoStreamStates(getMediaContent(mediaType));
15351
15359
  if (sources === null) {
15352
15360
  return;
15353
15361
  }
@@ -15375,8 +15383,8 @@ SCTP Max Message Size: ${maxMessageSize}`);
15375
15383
  this.pendingJmpTasks.push(task);
15376
15384
  }
15377
15385
  }
15378
- getVideoStreamStates(mediaType) {
15379
- const sendTransceiver = this.getSendTransceiverOrThrow(mediaType);
15386
+ getVideoStreamStates(mediaContent) {
15387
+ const sendTransceiver = this.getSendTransceiverOrThrow(getMediaType(exports.MediaFamily.Video, mediaContent));
15380
15388
  return sendTransceiver.senderIds.map((id) => ({
15381
15389
  id,
15382
15390
  state: sendTransceiver.currentSourceState,