@webex/web-client-media-engine 3.31.4 → 3.31.5

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
@@ -5922,6 +5922,7 @@ class PeerConnection extends EventEmitter$4 {
5922
5922
  */
5923
5923
  constructor(configuration) {
5924
5924
  super();
5925
+ this.iceCandidates = [];
5925
5926
  logger$3.log('PeerConnection init');
5926
5927
  this.pc = createRTCPeerConnection(configuration);
5927
5928
  this.connectionStateHandler = new ConnectionStateHandler(() => {
@@ -5948,6 +5949,9 @@ class PeerConnection extends EventEmitter$4 {
5948
5949
  };
5949
5950
  /* eslint-disable jsdoc/require-jsdoc */
5950
5951
  this.pc.onicecandidate = (ev) => {
5952
+ if (ev.candidate) {
5953
+ this.iceCandidates.push(ev.candidate);
5954
+ }
5951
5955
  this.emit(PeerConnection.Events.IceCandidate, ev);
5952
5956
  };
5953
5957
  this.pc.onicecandidateerror = (ev) => {
@@ -5986,6 +5990,14 @@ class PeerConnection extends EventEmitter$4 {
5986
5990
  getIceConnectionState() {
5987
5991
  return this.connectionStateHandler.getIceConnectionState();
5988
5992
  }
5993
+ /**
5994
+ * Gets the list of ICE candidates that have been gathered.
5995
+ *
5996
+ * @returns An array of RTCIceCandidate objects representing the ICE candidates.
5997
+ */
5998
+ getIceCandidates() {
5999
+ return this.iceCandidates;
6000
+ }
5989
6001
  /**
5990
6002
  * Adds a new media track to the set of tracks which will be transmitted to the other peer.
5991
6003
  *
@@ -14951,7 +14963,6 @@ class MultistreamConnection extends EventEmitter$2 {
14951
14963
  this.midPredictor = new MidPredictor();
14952
14964
  this.offerAnswerQueue = new AsyncQueue();
14953
14965
  this.currentCreateOfferId = 0;
14954
- this.iceCandidates = [];
14955
14966
  this.metadata = { isMediaBypassEdge: false };
14956
14967
  this.options = Object.assign(Object.assign({}, defaultMultistreamConnectionOptions), userOptions);
14957
14968
  logger.info(`Creating multistream connection with options ${JSON.stringify(this.options)}`);
@@ -15002,9 +15013,6 @@ class MultistreamConnection extends EventEmitter$2 {
15002
15013
  this.emit(MultistreamConnectionEventNames.IceGatheringStateUpdate, this.getIceGatheringState());
15003
15014
  });
15004
15015
  this.pc.on(PeerConnection.Events.IceCandidate, (candidate) => {
15005
- if (candidate.candidate) {
15006
- this.iceCandidates.push(candidate.candidate);
15007
- }
15008
15016
  this.emit(MultistreamConnectionEventNames.IceCandidate, candidate);
15009
15017
  });
15010
15018
  this.pc.on(PeerConnection.Events.IceCandidateError, (error) => {
@@ -15611,9 +15619,10 @@ SCTP Max Message Size: ${maxMessageSize}`);
15611
15619
  });
15612
15620
  }
15613
15621
  if (BrowserInfo.isFirefox() && this.options.doFullIce) {
15622
+ const iceCandidates = this.pc.getIceCandidates();
15614
15623
  parsedOffer.media.forEach((media) => {
15615
15624
  media.iceInfo.candidates = [];
15616
- this.iceCandidates.forEach((iceCandidate) => {
15625
+ iceCandidates.forEach((iceCandidate) => {
15617
15626
  const candidateLine = CandidateLine.fromSdpLine(iceCandidate.candidate.toString());
15618
15627
  if (candidateLine) {
15619
15628
  media.addLine(candidateLine);