@stream-io/video-client 1.61.0 → 1.61.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/index.cjs.js CHANGED
@@ -5101,7 +5101,7 @@ const toIceCandidate = (iceTrickle) => {
5101
5101
  }
5102
5102
  };
5103
5103
 
5104
- const version = "1.61.0";
5104
+ const version = "1.61.1";
5105
5105
  const [major, minor, patch] = version.split('.');
5106
5106
  let sdkInfo = {
5107
5107
  type: SdkType.PLAIN_JAVASCRIPT,
@@ -8774,7 +8774,12 @@ class BasePeerConnection {
8774
8774
  }
8775
8775
  // we can't recover from a failed connection state (contrary to ICE)
8776
8776
  if (state === 'failed') {
8777
- this.onReconnectionNeeded?.(WebsocketReconnectStrategy.REJOIN, ReconnectReason.CONNECTION_FAILED, this.peerType);
8777
+ const reason = this.iceHasEverConnected
8778
+ ? ReconnectReason.CONNECTION_FAILED
8779
+ : ReconnectReason.ICE_NEVER_CONNECTED;
8780
+ clearTimeout(this.preConnectStuckTimeout);
8781
+ this.preConnectStuckTimeout = undefined;
8782
+ this.onReconnectionNeeded?.(WebsocketReconnectStrategy.REJOIN, reason, this.peerType);
8778
8783
  return;
8779
8784
  }
8780
8785
  this.handleConnectionStateUpdate(state);
@@ -19651,11 +19656,11 @@ class StreamClient {
19651
19656
  return await this.wsConnection.connect(this.defaultWSTimeout);
19652
19657
  };
19653
19658
  getSdkVersion = () => this.options.clientAppIdentifier?.sdkVersion ||
19654
- "1.61.0";
19659
+ "1.61.1";
19655
19660
  getUserAgent = () => {
19656
19661
  if (!this.cachedUserAgent) {
19657
19662
  const { clientAppIdentifier = {} } = this.options;
19658
- const { sdkName = 'js', sdkVersion = "1.61.0", ...extras } = clientAppIdentifier;
19663
+ const { sdkName = 'js', sdkVersion = "1.61.1", ...extras } = clientAppIdentifier;
19659
19664
  this.cachedUserAgent = [
19660
19665
  `stream-video-${sdkName}-v${sdkVersion}`,
19661
19666
  ...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
@@ -20190,7 +20195,11 @@ class ClientEventReporter {
20190
20195
  return;
20191
20196
  }
20192
20197
  if (event.state === 'failed') {
20193
- this.emitPeerConnectionFailure(cid, role, 'DTLS_CONNECTIVITY_FAILED', 'DTLS connectivity checks failed');
20198
+ const iceConnected = event.iceConnectionState === 'connected' ||
20199
+ event.iceConnectionState === 'completed';
20200
+ this.emitPeerConnectionFailure(cid, role, iceConnected ? 'DTLS_CONNECTIVITY_FAILED' : 'ICE_CONNECTIVITY_FAILED', iceConnected
20201
+ ? 'DTLS connectivity checks failed'
20202
+ : 'ICE connectivity checks failed');
20194
20203
  return;
20195
20204
  }
20196
20205
  switch (event.state) {