@stream-io/video-client 0.0.34 → 0.0.36

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,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ### [0.0.36](https://github.com/GetStream/stream-video-js/compare/client0.0.35...client0.0.36) (2023-07-05)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * wait for connection ok for all API requests ([#752](https://github.com/GetStream/stream-video-js/issues/752)) ([82f441d](https://github.com/GetStream/stream-video-js/commit/82f441d5fb84ddc2c16fb97ca362e05fff78b4dd))
11
+
12
+ ### [0.0.35](https://github.com/GetStream/stream-video-js/compare/client0.0.34...client0.0.35) (2023-07-05)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * Reliable mid detection ([#753](https://github.com/GetStream/stream-video-js/issues/753)) ([d602574](https://github.com/GetStream/stream-video-js/commit/d6025740f46db413b5c040cb9af145cfa9be4bf1))
18
+
5
19
  ### [0.0.34](https://github.com/GetStream/stream-video-js/compare/client0.0.33...client0.0.34) (2023-07-05)
6
20
 
7
21
 
@@ -6399,9 +6399,14 @@ class Publisher {
6399
6399
  }
6400
6400
  this.logger('warn', 'No mid found for track. Trying to find it from SDP');
6401
6401
  const parsedSdp = SDP.parse(sdp);
6402
- const media = parsedSdp.media.find((m) => m.type === track.kind);
6402
+ const media = parsedSdp.media.find((m) => {
6403
+ var _a, _b;
6404
+ return (m.type === track.kind &&
6405
+ // if `msid` is not present, we assume that the track is the first one
6406
+ ((_b = (_a = m.msid) === null || _a === void 0 ? void 0 : _a.includes(track.id)) !== null && _b !== void 0 ? _b : true));
6407
+ });
6403
6408
  if (typeof (media === null || media === void 0 ? void 0 : media.mid) === 'undefined') {
6404
- this.logger('warn', `No mid found in SDP for track type ${track.kind}`);
6409
+ this.logger('warn', `No mid found in SDP for track type ${track.kind} and id ${track.id}`);
6405
6410
  return '';
6406
6411
  }
6407
6412
  return String(media.mid);
@@ -8483,7 +8488,6 @@ const registerRingingCallEventHandlers = (call) => {
8483
8488
  * @param data the data for the call.
8484
8489
  */
8485
8490
  const join = (httpClient, type, id, data) => __awaiter(void 0, void 0, void 0, function* () {
8486
- yield httpClient.connectionIdPromise;
8487
8491
  const joinCallResponse = yield doJoin(httpClient, type, id, data);
8488
8492
  const { call, credentials, members, own_capabilities } = joinCallResponse;
8489
8493
  return {
@@ -11479,7 +11483,10 @@ class StreamClient {
11479
11483
  if (this.waitForConnectPromise) {
11480
11484
  yield this.waitForConnectPromise;
11481
11485
  }
11482
- yield this.tokenManager.tokenReady();
11486
+ yield Promise.all([
11487
+ this.tokenManager.tokenReady(),
11488
+ this.connectionIdPromise,
11489
+ ]);
11483
11490
  }
11484
11491
  const requestConfig = this._enrichAxiosOptions(options);
11485
11492
  try {
@@ -11828,7 +11835,7 @@ class StreamClient {
11828
11835
  }
11829
11836
  getUserAgent() {
11830
11837
  return (this.userAgent ||
11831
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.33"}`);
11838
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.35"}`);
11832
11839
  }
11833
11840
  setUserAgent(userAgent) {
11834
11841
  this.userAgent = userAgent;
@@ -11972,8 +11979,6 @@ class StreamVideoClient {
11972
11979
  * @param data the query data.
11973
11980
  */
11974
11981
  this.queryCalls = (data) => __awaiter(this, void 0, void 0, function* () {
11975
- if (data.watch)
11976
- yield this.streamClient.connectionIdPromise;
11977
11982
  const response = yield this.streamClient.post('/calls', data);
11978
11983
  const calls = response.calls.map((c) => {
11979
11984
  const call = new Call({