@webex/web-client-media-engine 3.29.1 → 3.29.3

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
@@ -6654,23 +6654,6 @@ function areCodecInfosEqual(left, right) {
6654
6654
  return left.payloadType === right.payloadType && areH264CodecsEqual(left.h264, right.h264);
6655
6655
  }
6656
6656
 
6657
- var HomerMsgType;
6658
- (function (HomerMsgType) {
6659
- HomerMsgType["Multistream"] = "multistream";
6660
- })(HomerMsgType || (HomerMsgType = {}));
6661
- class HomerMsg {
6662
- constructor(msgType, payload) {
6663
- this.msgType = msgType;
6664
- this.payload = payload;
6665
- }
6666
- static fromJson(data) {
6667
- if (!data.msgType || !data.payload) {
6668
- return null;
6669
- }
6670
- return new HomerMsg(data.msgType, data.payload);
6671
- }
6672
- }
6673
-
6674
6657
  var JmpMsgType;
6675
6658
  (function (JmpMsgType) {
6676
6659
  JmpMsgType["MediaRequest"] = "mediaRequest";
@@ -6703,6 +6686,19 @@ function isValidJmpMsg(msg) {
6703
6686
  isValidJmpMsgPayload(maybeJmpMsg.payload));
6704
6687
  }
6705
6688
 
6689
+ class MediaRequestAckMsg {
6690
+ constructor(mediaRequestSeqNum) {
6691
+ this.mediaRequestSeqNum = mediaRequestSeqNum;
6692
+ }
6693
+ toString() {
6694
+ return `MediaRequestAckMsg(seqNum=${this.mediaRequestSeqNum})`;
6695
+ }
6696
+ }
6697
+ function isValidMediaRequestAckMsg(msg) {
6698
+ const maybeMediaRequestAckMsg = msg;
6699
+ return Boolean(maybeMediaRequestAckMsg.mediaRequestSeqNum);
6700
+ }
6701
+
6706
6702
  class MediaRequestMsg {
6707
6703
  constructor(seqNum, requests) {
6708
6704
  this.seqNum = seqNum;
@@ -6717,17 +6713,17 @@ function isValidMediaRequestMsg(msg) {
6717
6713
  return Boolean(maybeMediaRequestMsg.seqNum && maybeMediaRequestMsg.requests);
6718
6714
  }
6719
6715
 
6720
- class MediaRequestAckMsg {
6721
- constructor(mediaRequestSeqNum) {
6722
- this.mediaRequestSeqNum = mediaRequestSeqNum;
6716
+ class MediaRequestStatusAckMsg {
6717
+ constructor(mediaRequestStatusSeqNum) {
6718
+ this.mediaRequestStatusSeqNum = mediaRequestStatusSeqNum;
6723
6719
  }
6724
6720
  toString() {
6725
- return `MediaRequestAckMsg(seqNum=${this.mediaRequestSeqNum})`;
6721
+ return `MediaRequestStatusAckMsg(seqNum=${this.mediaRequestStatusSeqNum})`;
6726
6722
  }
6727
6723
  }
6728
- function isValidMediaRequestAckMsg(msg) {
6729
- const maybeMediaRequestAckMsg = msg;
6730
- return Boolean(maybeMediaRequestAckMsg.mediaRequestSeqNum);
6724
+ function isValidMediaRequestStatusAckMsg(msg) {
6725
+ const maybeMediaRequestStatusAckMsg = msg;
6726
+ return Boolean(maybeMediaRequestStatusAckMsg.mediaRequestStatusSeqNum);
6731
6727
  }
6732
6728
 
6733
6729
  function isValidMidRidStreamId(obj) {
@@ -6781,19 +6777,6 @@ function isValidMediaRequestStatusMsg(msg) {
6781
6777
  maybeMediaRequestStatusMsg.streamStates.every((streamInfo) => isValidStreamInfo(streamInfo)));
6782
6778
  }
6783
6779
 
6784
- class MediaRequestStatusAckMsg {
6785
- constructor(mediaRequestStatusSeqNum) {
6786
- this.mediaRequestStatusSeqNum = mediaRequestStatusSeqNum;
6787
- }
6788
- toString() {
6789
- return `MediaRequestStatusAckMsg(seqNum=${this.mediaRequestStatusSeqNum})`;
6790
- }
6791
- }
6792
- function isValidMediaRequestStatusAckMsg(msg) {
6793
- const maybeMediaRequestStatusAckMsg = msg;
6794
- return Boolean(maybeMediaRequestStatusAckMsg.mediaRequestStatusSeqNum);
6795
- }
6796
-
6797
6780
  class ReceiverSelectedInfo {
6798
6781
  constructor(csi) {
6799
6782
  this.csi = csi;
@@ -6826,6 +6809,19 @@ function arePolicySpecificInfosEqual(left, right) {
6826
6809
  throw new Error('Invalid PolicySpecificInfo');
6827
6810
  }
6828
6811
 
6812
+ class SourceAdvertisementAckMsg {
6813
+ constructor(sourceAdvertisementSeqNum) {
6814
+ this.sourceAdvertisementSeqNum = sourceAdvertisementSeqNum;
6815
+ }
6816
+ toString() {
6817
+ return `SourceAdvertisementAckMsg(sourceAdvertisementSeqNum=${this.sourceAdvertisementSeqNum})`;
6818
+ }
6819
+ }
6820
+ function isValidSourceAdvertisementAckMsg(msg) {
6821
+ const maybeSourceAdvertisementAckMsg = msg;
6822
+ return Boolean(maybeSourceAdvertisementAckMsg.sourceAdvertisementSeqNum);
6823
+ }
6824
+
6829
6825
  class SourceAdvertisementMsg {
6830
6826
  constructor(seqNum, numTotalSources, numLiveSources, namedMediaGroups, videoContentHint) {
6831
6827
  this.seqNum = seqNum;
@@ -6851,19 +6847,6 @@ function areSourceAdvertisementMsgsEqual(sourceAdvertisementMsg1, sourceAdvertis
6851
6847
  sourceAdvertisementMsg1.videoContentHint === sourceAdvertisementMsg2.videoContentHint);
6852
6848
  }
6853
6849
 
6854
- class SourceAdvertisementAckMsg {
6855
- constructor(sourceAdvertisementSeqNum) {
6856
- this.sourceAdvertisementSeqNum = sourceAdvertisementSeqNum;
6857
- }
6858
- toString() {
6859
- return `SourceAdvertisementAckMsg(sourceAdvertisementSeqNum=${this.sourceAdvertisementSeqNum})`;
6860
- }
6861
- }
6862
- function isValidSourceAdvertisementAckMsg(msg) {
6863
- const maybeSourceAdvertisementAckMsg = msg;
6864
- return Boolean(maybeSourceAdvertisementAckMsg.sourceAdvertisementSeqNum);
6865
- }
6866
-
6867
6850
  class StreamRequest$1 {
6868
6851
  constructor(policy, policySpecificInfo, ids, maxPayloadBitsPerSecond, codecInfos = []) {
6869
6852
  this.policy = policy;
@@ -7094,8 +7077,7 @@ class JmpSession extends EventEmitter$5 {
7094
7077
  msgType,
7095
7078
  payload,
7096
7079
  });
7097
- const homerMsg = new HomerMsg(HomerMsgType.Multistream, jmpMsg);
7098
- (_a = this.txCallback) === null || _a === void 0 ? void 0 : _a.call(this, JSON.stringify(homerMsg));
7080
+ (_a = this.txCallback) === null || _a === void 0 ? void 0 : _a.call(this, jmpMsg);
7099
7081
  }
7100
7082
  handleIncomingMediaRequest(mediaRequestMsg) {
7101
7083
  var _a;
@@ -8369,6 +8351,7 @@ function parseFmtpParams(fmtpParams) {
8369
8351
  fmtpObj.set(fmtpParams, undefined);
8370
8352
  return fmtpObj;
8371
8353
  }
8354
+ fmtpParams = fmtpParams.replace(/;$/, '');
8372
8355
  fmtpParams.split(';').forEach((param) => {
8373
8356
  const paramArr = param && param.split('=');
8374
8357
  if (paramArr.length !== 2 || !paramArr[0] || !paramArr[1]) {
@@ -10509,6 +10492,23 @@ class IngressSdpMunger {
10509
10492
  }
10510
10493
  }
10511
10494
 
10495
+ var HomerMsgType;
10496
+ (function (HomerMsgType) {
10497
+ HomerMsgType["Multistream"] = "multistream";
10498
+ })(HomerMsgType || (HomerMsgType = {}));
10499
+ class HomerMsg {
10500
+ constructor(msgType, payload) {
10501
+ this.msgType = msgType;
10502
+ this.payload = payload;
10503
+ }
10504
+ static fromJson(data) {
10505
+ if (!data.msgType || !data.payload) {
10506
+ return null;
10507
+ }
10508
+ return new HomerMsg(data.msgType, data.payload);
10509
+ }
10510
+ }
10511
+
10512
10512
  class MidPredictor {
10513
10513
  constructor() {
10514
10514
  this.currentMid = 0;
@@ -15078,22 +15078,24 @@ class MultistreamConnection extends EventEmitter$2 {
15078
15078
  }
15079
15079
  createJmpSession(mediaType) {
15080
15080
  const jmpSession = new JmpSession(getMediaFamily(mediaType), getMediaContent(mediaType));
15081
- jmpSession.setTxCallback((msg) => {
15081
+ jmpSession.setTxCallback((jmpMessage) => {
15082
15082
  var _a;
15083
15083
  if (((_a = this.dataChannel) === null || _a === void 0 ? void 0 : _a.readyState) !== 'open') {
15084
15084
  logger.error(`DataChannel not created or not connected. Unable to send JMP message.`);
15085
15085
  return;
15086
15086
  }
15087
+ const homerMsg = new HomerMsg(HomerMsgType.Multistream, jmpMessage);
15088
+ const serializedHomerMsg = JSON.stringify(homerMsg);
15087
15089
  try {
15088
- logger.info(`Sending JMP message (size: ${msg.length}): ${msg}`);
15089
- this.dataChannel.send(msg);
15090
+ logger.info(`Sending JMP message: ${serializedHomerMsg}`);
15091
+ this.dataChannel.send(serializedHomerMsg);
15090
15092
  }
15091
15093
  catch (err) {
15092
15094
  const { bufferedAmount, readyState } = this.dataChannel;
15093
15095
  const { sctp } = this.pc.getUnderlyingRTCPeerConnection();
15094
15096
  const { maxMessageSize, state } = sctp || {};
15095
15097
  logErrorAndThrow(WcmeErrorType.DATA_CHANNEL_SEND_FAILED, `Sending JMP message failed with error: ${err},
15096
- Message size: ${msg.length},
15098
+ Message size: ${serializedHomerMsg.length},
15097
15099
  Data Channel State: ${readyState},
15098
15100
  Data Channel Buffered amount: ${bufferedAmount},
15099
15101
  SCTP State: ${state},