@stream-io/video-client 0.0.33 → 0.0.35

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
@@ -6422,9 +6422,14 @@ class Publisher {
6422
6422
  }
6423
6423
  this.logger('warn', 'No mid found for track. Trying to find it from SDP');
6424
6424
  const parsedSdp = SDP__namespace.parse(sdp);
6425
- const media = parsedSdp.media.find((m) => m.type === track.kind);
6425
+ const media = parsedSdp.media.find((m) => {
6426
+ var _a, _b;
6427
+ return (m.type === track.kind &&
6428
+ // if `msid` is not present, we assume that the track is the first one
6429
+ ((_b = (_a = m.msid) === null || _a === void 0 ? void 0 : _a.includes(track.id)) !== null && _b !== void 0 ? _b : true));
6430
+ });
6426
6431
  if (typeof (media === null || media === void 0 ? void 0 : media.mid) === 'undefined') {
6427
- this.logger('warn', `No mid found in SDP for track type ${track.kind}`);
6432
+ this.logger('warn', `No mid found in SDP for track type ${track.kind} and id ${track.id}`);
6428
6433
  return '';
6429
6434
  }
6430
6435
  return String(media.mid);
@@ -10083,7 +10088,7 @@ class Call {
10083
10088
  /**
10084
10089
  * Sends a custom event to all call participants.
10085
10090
  *
10086
- * @param event the event to send.
10091
+ * @param payload the payload to send.
10087
10092
  */
10088
10093
  this.sendCustomEvent = (payload) => __awaiter(this, void 0, void 0, function* () {
10089
10094
  return this.streamClient.post(`${this.streamClientBasePath}/event`, { custom: payload });
@@ -10146,7 +10151,7 @@ class Call {
10146
10151
  const currentUserId = this.currentUserId;
10147
10152
  if (currentUserId &&
10148
10153
  metadata.blocked_user_ids.includes(currentUserId)) {
10149
- this.logger('info', 'Leaving call bacause of being blocked');
10154
+ this.logger('info', 'Leaving call because of being blocked');
10150
10155
  yield this.leave();
10151
10156
  }
10152
10157
  })),
@@ -11852,7 +11857,7 @@ class StreamClient {
11852
11857
  }
11853
11858
  getUserAgent() {
11854
11859
  return (this.userAgent ||
11855
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.32"}`);
11860
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.34"}`);
11856
11861
  }
11857
11862
  setUserAgent(userAgent) {
11858
11863
  this.userAgent = userAgent;