@stream-io/video-client 0.0.34 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-client",
3
- "version": "0.0.34",
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",
@@ -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);