@webex/web-client-media-engine 3.15.0 → 3.15.1

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
@@ -7145,6 +7145,7 @@ var WcmeErrorType;
7145
7145
  WcmeErrorType["GET_MAX_BITRATE_FAILED"] = "GET_MAX_BITRATE_FAILED";
7146
7146
  WcmeErrorType["GET_PAYLOAD_TYPE_FAILED"] = "GET_PAYLOAD_TYPE_FAILED";
7147
7147
  WcmeErrorType["SET_NMG_FAILED"] = "SET_NMG_FAILED";
7148
+ WcmeErrorType["DATA_CHANNEL_SEND_FAILED"] = "DATA_CHANNEL_SEND_FAILED";
7148
7149
  })(WcmeErrorType || (WcmeErrorType = {}));
7149
7150
  class WcmeError {
7150
7151
  constructor(type, message = '') {
@@ -14689,8 +14690,21 @@ class MultistreamConnection extends EventEmitter$2 {
14689
14690
  logger.error(`DataChannel not created or not connected. Unable to send JMP message.`);
14690
14691
  return;
14691
14692
  }
14692
- logger.info(`Sending JMP message: ${msg}`);
14693
- this.dataChannel.send(msg);
14693
+ try {
14694
+ logger.info(`Sending JMP message (size: ${msg.length}): ${msg}`);
14695
+ this.dataChannel.send(msg);
14696
+ }
14697
+ catch (err) {
14698
+ const { bufferedAmount, readyState } = this.dataChannel;
14699
+ const { sctp } = this.pc.getUnderlyingRTCPeerConnection();
14700
+ const { maxMessageSize, state } = sctp || {};
14701
+ logErrorAndThrow(WcmeErrorType.DATA_CHANNEL_SEND_FAILED, `Sending JMP message failed with error: ${err},
14702
+ Message size: ${msg.length},
14703
+ Data Channel State: ${readyState},
14704
+ Data Channel Buffered amount: ${bufferedAmount},
14705
+ SCTP State: ${state},
14706
+ SCTP Max Message Size: ${maxMessageSize}`);
14707
+ }
14694
14708
  });
14695
14709
  let prevNumTotalSources = 0;
14696
14710
  let prevNumLiveSources = 0;