@webex/web-client-media-engine 3.0.1 → 3.1.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
@@ -9125,6 +9125,12 @@ function filterCodecs(parsedSdp, allowedCodecs) {
9125
9125
  .filter((codecName) => !allowedLowerCase.includes(codecName.toLowerCase()))
9126
9126
  .forEach((c) => removeCodec(parsedSdp, c));
9127
9127
  }
9128
+ function filterCandidates(parsedSdp) {
9129
+ const supportedTransportTypes = ['udp', 'tcp'];
9130
+ parsedSdp.media.forEach((mline) => {
9131
+ mline.iceInfo.candidates = mline.iceInfo.candidates.filter((candidate) => supportedTransportTypes.includes(candidate.transport.toLowerCase()));
9132
+ });
9133
+ }
9128
9134
  function setMaxBandwidth(parsedSdp, maxBandwidth) {
9129
9135
  parsedSdp.avMedia.forEach((mline) => {
9130
9136
  mline.bandwidth = new BandwidthLine('TIAS', maxBandwidth);
@@ -9848,6 +9854,7 @@ class SendOnlyTransceiver extends Transceiver {
9848
9854
  this.rtxEnabled = false;
9849
9855
  this.streamMuteStateChange = new TypedEvent();
9850
9856
  this.streamPublishStateChange = new TypedEvent();
9857
+ this.negotiationNeeded = new TypedEvent();
9851
9858
  this.requested = false;
9852
9859
  this.requestedIdEncodingParamsMap = new Map();
9853
9860
  this.csi = csi;
@@ -9931,7 +9938,9 @@ class SendOnlyTransceiver extends Transceiver {
9931
9938
  setActive(enabled) {
9932
9939
  this.direction = enabled ? 'sendrecv' : 'inactive';
9933
9940
  this._rtcRtpTransceiver.direction = this.direction;
9934
- return this._rtcRtpTransceiver.direction !== this._rtcRtpTransceiver.currentDirection;
9941
+ if (this._rtcRtpTransceiver.direction !== this._rtcRtpTransceiver.currentDirection) {
9942
+ this.negotiationNeeded.emit();
9943
+ }
9935
9944
  }
9936
9945
  getStats() {
9937
9946
  return this.sender.getStats();
@@ -13797,6 +13806,7 @@ exports.MultistreamConnectionEventNames = void 0;
13797
13806
  MultistreamConnectionEventNames["AudioSourceCountUpdate"] = "audio-source-count-update";
13798
13807
  MultistreamConnectionEventNames["ActiveSpeakerNotification"] = "active-speaker-notification";
13799
13808
  MultistreamConnectionEventNames["ConnectionStateUpdate"] = "connection-state-update";
13809
+ MultistreamConnectionEventNames["NegotiationNeeded"] = "negotiation-needed";
13800
13810
  })(exports.MultistreamConnectionEventNames || (exports.MultistreamConnectionEventNames = {}));
13801
13811
  const defaultMultistreamConnectionOptions = {
13802
13812
  disableSimulcast: getBrowserDetails().name === 'Firefox',
@@ -13889,6 +13899,9 @@ class MultistreamConnection extends EventEmitter$2 {
13889
13899
  this.sendSourceAdvertisement(mediaType);
13890
13900
  this.sendMediaRequestStatus(mediaType);
13891
13901
  });
13902
+ transceiver.negotiationNeeded.on(() => {
13903
+ this.emit(exports.MultistreamConnectionEventNames.NegotiationNeeded);
13904
+ });
13892
13905
  this.sendTransceivers.set(mediaType, transceiver);
13893
13906
  this.createJmpSession(mediaType);
13894
13907
  }
@@ -14288,6 +14301,7 @@ class MultistreamConnection extends EventEmitter$2 {
14288
14301
  const parsedOffer = parse((_a = this.pc.getLocalDescription()) === null || _a === void 0 ? void 0 : _a.sdp);
14289
14302
  const recvTransceiversByMid = new Map([...this.recvTransceivers.values()].flat().map((t) => [t.mid, t]));
14290
14303
  matchMlinesInAnswer(parsedOffer, parsedAnswer, recvTransceiversByMid);
14304
+ filterCandidates(parsedAnswer);
14291
14305
  if (getBrowserDetails().name === 'Firefox') {
14292
14306
  setupBundle(parsedAnswer, this.options.bundlePolicy, this.midPredictor.getMidMap());
14293
14307
  if (this.options.bundlePolicy === 'max-bundle') {