@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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.6.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.6.1...@stream-io/video-client-0.6.2) (2024-03-25)
6
+
7
+
8
+ ### Features
9
+
10
+ * **call:** Add getCallStats method ([#1296](https://github.com/GetStream/stream-video-js/issues/1296)) ([b64a19e](https://github.com/GetStream/stream-video-js/commit/b64a19ecd2fcc74f5f531397ed34732d55b0f815))
11
+
5
12
  ### [0.6.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.6.0...@stream-io/video-client-0.6.1) (2024-03-13)
6
13
 
7
14
 
@@ -5926,7 +5926,9 @@ const getClientDetails = () => {
5926
5926
  architecture: cpu.architecture || '',
5927
5927
  },
5928
5928
  device: {
5929
- name: `${device.vendor || ''} ${device.model || ''} ${device.type || ''}`,
5929
+ name: [device.vendor, device.model, device.type]
5930
+ .filter(Boolean)
5931
+ .join(' '),
5930
5932
  version: '',
5931
5933
  },
5932
5934
  };
@@ -7904,7 +7906,8 @@ class Publisher {
7904
7906
  this.onIceCandidateError = (e) => {
7905
7907
  const errorMessage = e instanceof RTCPeerConnectionIceErrorEvent &&
7906
7908
  `${e.errorCode}: ${e.errorText}`;
7907
- const logLevel = this.pc.iceConnectionState === 'connected' ? 'debug' : 'error';
7909
+ const iceState = this.pc.iceConnectionState;
7910
+ const logLevel = iceState === 'connected' || iceState === 'checking' ? 'debug' : 'warn';
7908
7911
  logger$3(logLevel, `ICE Candidate error`, errorMessage);
7909
7912
  };
7910
7913
  this.onIceConnectionStateChange = () => {
@@ -8224,7 +8227,8 @@ class Subscriber {
8224
8227
  this.onIceCandidateError = (e) => {
8225
8228
  const errorMessage = e instanceof RTCPeerConnectionIceErrorEvent &&
8226
8229
  `${e.errorCode}: ${e.errorText}`;
8227
- const logLevel = this.pc.iceConnectionState === 'connected' ? 'debug' : 'error';
8230
+ const iceState = this.pc.iceConnectionState;
8231
+ const logLevel = iceState === 'connected' || iceState === 'checking' ? 'debug' : 'warn';
8228
8232
  logger$2(logLevel, `ICE Candidate error`, errorMessage);
8229
8233
  };
8230
8234
  this.sfuClient = sfuClient;
@@ -12222,6 +12226,17 @@ class Call {
12222
12226
  }
12223
12227
  return this.streamClient.get(`${endpoint}/recordings`);
12224
12228
  };
12229
+ /**
12230
+ * Retrieve call statistics for a particular call session (historical).
12231
+ * Here `callSessionID` is mandatory.
12232
+ *
12233
+ * @param callSessionID the call session ID to retrieve statistics for.
12234
+ * @returns The call stats.
12235
+ */
12236
+ this.getCallStats = async (callSessionID) => {
12237
+ const endpoint = `${this.streamClientBasePath}/stats/${callSessionID}`;
12238
+ return this.streamClient.get(endpoint);
12239
+ };
12225
12240
  /**
12226
12241
  * Sends a custom event to all call participants.
12227
12242
  *
@@ -13634,7 +13649,7 @@ const getLocationHint = async (hintUrl = HINT_URL, timeout = 2000) => {
13634
13649
  const abortController = new AbortController();
13635
13650
  const timeoutId = setTimeout(() => abortController.abort(), timeout);
13636
13651
  try {
13637
- const response = await fetch(HINT_URL, {
13652
+ const response = await fetch(hintUrl, {
13638
13653
  method: 'HEAD',
13639
13654
  signal: abortController.signal,
13640
13655
  });
@@ -13643,7 +13658,7 @@ const getLocationHint = async (hintUrl = HINT_URL, timeout = 2000) => {
13643
13658
  return awsPop.substring(0, 3); // AMS1-P2 -> AMS
13644
13659
  }
13645
13660
  catch (e) {
13646
- logger('warn', `Failed to get location hint from ${HINT_URL}`, e);
13661
+ logger('warn', `Failed to get location hint from ${hintUrl}`, e);
13647
13662
  return 'ERR';
13648
13663
  }
13649
13664
  finally {
@@ -14090,7 +14105,7 @@ class StreamClient {
14090
14105
  });
14091
14106
  };
14092
14107
  this.getUserAgent = () => {
14093
- const version = "0.6.1" ;
14108
+ const version = "0.6.2" ;
14094
14109
  return (this.userAgent ||
14095
14110
  `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
14096
14111
  };