@stream-io/video-client 0.6.1 → 0.6.2

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.es.js CHANGED
@@ -5929,7 +5929,9 @@ const getClientDetails = () => {
5929
5929
  architecture: cpu.architecture || '',
5930
5930
  },
5931
5931
  device: {
5932
- name: `${device.vendor || ''} ${device.model || ''} ${device.type || ''}`,
5932
+ name: [device.vendor, device.model, device.type]
5933
+ .filter(Boolean)
5934
+ .join(' '),
5933
5935
  version: '',
5934
5936
  },
5935
5937
  };
@@ -7907,7 +7909,8 @@ class Publisher {
7907
7909
  this.onIceCandidateError = (e) => {
7908
7910
  const errorMessage = e instanceof RTCPeerConnectionIceErrorEvent &&
7909
7911
  `${e.errorCode}: ${e.errorText}`;
7910
- const logLevel = this.pc.iceConnectionState === 'connected' ? 'debug' : 'error';
7912
+ const iceState = this.pc.iceConnectionState;
7913
+ const logLevel = iceState === 'connected' || iceState === 'checking' ? 'debug' : 'warn';
7911
7914
  logger$3(logLevel, `ICE Candidate error`, errorMessage);
7912
7915
  };
7913
7916
  this.onIceConnectionStateChange = () => {
@@ -8227,7 +8230,8 @@ class Subscriber {
8227
8230
  this.onIceCandidateError = (e) => {
8228
8231
  const errorMessage = e instanceof RTCPeerConnectionIceErrorEvent &&
8229
8232
  `${e.errorCode}: ${e.errorText}`;
8230
- const logLevel = this.pc.iceConnectionState === 'connected' ? 'debug' : 'error';
8233
+ const iceState = this.pc.iceConnectionState;
8234
+ const logLevel = iceState === 'connected' || iceState === 'checking' ? 'debug' : 'warn';
8231
8235
  logger$2(logLevel, `ICE Candidate error`, errorMessage);
8232
8236
  };
8233
8237
  this.sfuClient = sfuClient;
@@ -12225,6 +12229,17 @@ class Call {
12225
12229
  }
12226
12230
  return this.streamClient.get(`${endpoint}/recordings`);
12227
12231
  };
12232
+ /**
12233
+ * Retrieve call statistics for a particular call session (historical).
12234
+ * Here `callSessionID` is mandatory.
12235
+ *
12236
+ * @param callSessionID the call session ID to retrieve statistics for.
12237
+ * @returns The call stats.
12238
+ */
12239
+ this.getCallStats = async (callSessionID) => {
12240
+ const endpoint = `${this.streamClientBasePath}/stats/${callSessionID}`;
12241
+ return this.streamClient.get(endpoint);
12242
+ };
12228
12243
  /**
12229
12244
  * Sends a custom event to all call participants.
12230
12245
  *
@@ -13638,7 +13653,7 @@ const getLocationHint = async (hintUrl = HINT_URL, timeout = 2000) => {
13638
13653
  const abortController = new AbortController();
13639
13654
  const timeoutId = setTimeout(() => abortController.abort(), timeout);
13640
13655
  try {
13641
- const response = await fetch(HINT_URL, {
13656
+ const response = await fetch(hintUrl, {
13642
13657
  method: 'HEAD',
13643
13658
  signal: abortController.signal,
13644
13659
  });
@@ -13647,7 +13662,7 @@ const getLocationHint = async (hintUrl = HINT_URL, timeout = 2000) => {
13647
13662
  return awsPop.substring(0, 3); // AMS1-P2 -> AMS
13648
13663
  }
13649
13664
  catch (e) {
13650
- logger('warn', `Failed to get location hint from ${HINT_URL}`, e);
13665
+ logger('warn', `Failed to get location hint from ${hintUrl}`, e);
13651
13666
  return 'ERR';
13652
13667
  }
13653
13668
  finally {
@@ -14094,7 +14109,7 @@ class StreamClient {
14094
14109
  });
14095
14110
  };
14096
14111
  this.getUserAgent = () => {
14097
- const version = "0.6.1" ;
14112
+ const version = "0.6.2" ;
14098
14113
  return (this.userAgent ||
14099
14114
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14100
14115
  };