@stream-io/video-react-sdk 0.4.4 → 0.4.6

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-react-sdk",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "packageManager": "yarn@3.2.4",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -31,8 +31,8 @@
31
31
  "@floating-ui/react": "^0.22.0",
32
32
  "@nivo/core": "^0.80.0",
33
33
  "@nivo/line": "^0.80.0",
34
- "@stream-io/video-client": "^0.4.2",
35
- "@stream-io/video-react-bindings": "^0.3.2",
34
+ "@stream-io/video-client": "^0.4.4",
35
+ "@stream-io/video-react-bindings": "^0.3.4",
36
36
  "clsx": "^2.0.0",
37
37
  "prop-types": "^15.8.1"
38
38
  },
@@ -20,33 +20,42 @@ export const ParticipantsAudio = (props: ParticipantsAudioProps) => {
20
20
  <>
21
21
  {participants.map((participant) => {
22
22
  if (participant.isLocalParticipant) return null;
23
- const hasAudio = participant.publishedTracks.includes(
24
- SfuModels.TrackType.AUDIO,
23
+ const {
24
+ publishedTracks,
25
+ audioStream,
26
+ screenShareAudioStream,
27
+ sessionId,
28
+ } = participant;
29
+
30
+ const hasAudio = publishedTracks.includes(SfuModels.TrackType.AUDIO);
31
+ const audioTrackElement = hasAudio && audioStream && (
32
+ <Audio
33
+ {...audioProps}
34
+ trackType="audioTrack"
35
+ participant={participant}
36
+ key={`${sessionId}-audio`}
37
+ />
25
38
  );
26
- const hasScreenShareAudio = participant.publishedTracks.includes(
39
+
40
+ const hasScreenShareAudio = publishedTracks.includes(
27
41
  SfuModels.TrackType.SCREEN_SHARE_AUDIO,
28
42
  );
29
- if (hasAudio && participant.audioStream) {
30
- return (
31
- <Audio
32
- {...audioProps}
33
- trackType="audioTrack"
34
- participant={participant}
35
- key={participant.sessionId}
36
- />
37
- );
38
- }
39
- if (hasScreenShareAudio && participant.screenShareAudioStream) {
40
- return (
43
+ const screenShareAudioTrackElement = hasScreenShareAudio &&
44
+ screenShareAudioStream && (
41
45
  <Audio
42
46
  {...audioProps}
43
47
  trackType="screenShareAudioTrack"
44
48
  participant={participant}
45
- key={participant.sessionId}
49
+ key={`${sessionId}-screen-share-audio`}
46
50
  />
47
51
  );
48
- }
49
- return null;
52
+
53
+ return (
54
+ <>
55
+ {audioTrackElement}
56
+ {screenShareAudioTrackElement}
57
+ </>
58
+ );
50
59
  })}
51
60
  </>
52
61
  );