@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.
@@ -433,7 +433,7 @@ export declare class Call {
433
433
  /**
434
434
  * Sends a custom event to all call participants.
435
435
  *
436
- * @param event the event to send.
436
+ * @param payload the payload to send.
437
437
  */
438
438
  sendCustomEvent: (payload: {
439
439
  [key: string]: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.es.js",
package/src/Call.ts CHANGED
@@ -296,7 +296,7 @@ export class Call {
296
296
  currentUserId &&
297
297
  metadata.blocked_user_ids.includes(currentUserId)
298
298
  ) {
299
- this.logger('info', 'Leaving call bacause of being blocked');
299
+ this.logger('info', 'Leaving call because of being blocked');
300
300
  await this.leave();
301
301
  }
302
302
  }),
@@ -1613,7 +1613,7 @@ export class Call {
1613
1613
  /**
1614
1614
  * Sends a custom event to all call participants.
1615
1615
  *
1616
- * @param event the event to send.
1616
+ * @param payload the payload to send.
1617
1617
  */
1618
1618
  sendCustomEvent = async (payload: { [key: string]: any }) => {
1619
1619
  return this.streamClient.post<SendEventResponse, SendEventRequest>(
@@ -531,9 +531,18 @@ export class Publisher {
531
531
  this.logger('warn', 'No mid found for track. Trying to find it from SDP');
532
532
 
533
533
  const parsedSdp = SDP.parse(sdp);
534
- const media = parsedSdp.media.find((m) => m.type === track.kind);
534
+ const media = parsedSdp.media.find((m) => {
535
+ return (
536
+ m.type === track.kind &&
537
+ // if `msid` is not present, we assume that the track is the first one
538
+ (m.msid?.includes(track.id) ?? true)
539
+ );
540
+ });
535
541
  if (typeof media?.mid === 'undefined') {
536
- this.logger('warn', `No mid found in SDP for track type ${track.kind}`);
542
+ this.logger(
543
+ 'warn',
544
+ `No mid found in SDP for track type ${track.kind} and id ${track.id}`,
545
+ );
537
546
  return '';
538
547
  }
539
548
  return String(media.mid);