@stream-io/video-react-sdk 1.26.0 → 1.26.1

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.
@@ -1,3 +1,4 @@
1
+ export * from './AudioVolumeIndicator';
1
2
  export * from './DeviceSettings';
2
3
  export * from './DeviceSelector';
3
4
  export * from './DeviceSelectorAudio';
@@ -1,3 +1,4 @@
1
+ import { ComponentType, ReactElement } from 'react';
1
2
  /**
2
3
  * The props for the {@link LivestreamLayout} component.
3
4
  */
@@ -40,6 +41,10 @@ export type LivestreamLayoutProps = {
40
41
  */
41
42
  position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
42
43
  };
44
+ /**
45
+ * Override the default participant view overlay UI.
46
+ */
47
+ ParticipantViewUI?: ComponentType | ReactElement | null;
43
48
  };
44
49
  export declare const LivestreamLayout: {
45
50
  (props: LivestreamLayoutProps): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stream-io/video-react-sdk",
3
- "version": "1.26.0",
3
+ "version": "1.26.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
@@ -30,9 +30,9 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "@floating-ui/react": "^0.27.6",
33
- "@stream-io/video-client": "1.36.1",
33
+ "@stream-io/video-client": "1.37.0",
34
34
  "@stream-io/video-filters-web": "0.4.0",
35
- "@stream-io/video-react-bindings": "1.11.0",
35
+ "@stream-io/video-react-bindings": "1.11.1",
36
36
  "chart.js": "^4.4.4",
37
37
  "clsx": "^2.0.0",
38
38
  "react-chartjs-2": "^5.3.0"
@@ -1,3 +1,4 @@
1
+ export * from './AudioVolumeIndicator';
1
2
  export * from './DeviceSettings';
2
3
  export * from './DeviceSelector';
3
4
  export * from './DeviceSelectorAudio';
@@ -1,5 +1,11 @@
1
1
  import clsx from 'clsx';
2
- import { useCallback, useEffect, useState } from 'react';
2
+ import {
3
+ ComponentType,
4
+ ReactElement,
5
+ useCallback,
6
+ useEffect,
7
+ useState,
8
+ } from 'react';
3
9
  import {
4
10
  useCall,
5
11
  useCallStateHooks,
@@ -62,6 +68,11 @@ export type LivestreamLayoutProps = {
62
68
  */
63
69
  position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
64
70
  };
71
+
72
+ /**
73
+ * Override the default participant view overlay UI.
74
+ */
75
+ ParticipantViewUI?: ComponentType | ReactElement | null;
65
76
  };
66
77
 
67
78
  export const LivestreamLayout = (props: LivestreamLayoutProps) => {
@@ -77,27 +88,31 @@ export const LivestreamLayout = (props: LivestreamLayoutProps) => {
77
88
 
78
89
  usePaginatedLayoutSortPreset(call);
79
90
 
80
- const overlay = (
91
+ const { floatingParticipantProps, muted, ParticipantViewUI } = props;
92
+ const overlay = ParticipantViewUI ?? (
81
93
  <ParticipantOverlay
82
94
  showParticipantCount={props.showParticipantCount}
83
95
  showDuration={props.showDuration}
84
96
  showLiveBadge={props.showLiveBadge}
85
97
  showSpeakerName={props.showSpeakerName}
98
+ enableFullScreen={props.enableFullScreen}
86
99
  />
87
100
  );
88
101
 
89
- const { floatingParticipantProps, muted } = props;
90
- const floatingParticipantOverlay = hasOngoingScreenShare && (
91
- <ParticipantOverlay
92
- // these elements aren't needed for the video feed
93
- showParticipantCount={
94
- floatingParticipantProps?.showParticipantCount ?? false
95
- }
96
- showDuration={floatingParticipantProps?.showDuration ?? false}
97
- showLiveBadge={floatingParticipantProps?.showLiveBadge ?? false}
98
- showSpeakerName={floatingParticipantProps?.showSpeakerName ?? true}
99
- />
100
- );
102
+ const floatingParticipantOverlay =
103
+ hasOngoingScreenShare &&
104
+ (ParticipantViewUI ?? (
105
+ <ParticipantOverlay
106
+ // these elements aren't needed for the video feed
107
+ showParticipantCount={
108
+ floatingParticipantProps?.showParticipantCount ?? false
109
+ }
110
+ showDuration={floatingParticipantProps?.showDuration ?? false}
111
+ showLiveBadge={floatingParticipantProps?.showLiveBadge ?? false}
112
+ showSpeakerName={floatingParticipantProps?.showSpeakerName ?? true}
113
+ enableFullScreen={floatingParticipantProps?.enableFullScreen ?? true}
114
+ />
115
+ ));
101
116
 
102
117
  return (
103
118
  <div className="str-video__livestream-layout__wrapper">
@@ -192,6 +207,12 @@ const ParticipantOverlay = (props: {
192
207
  showLiveBadge = true,
193
208
  showSpeakerName = false,
194
209
  } = props;
210
+ const overlayBarVisible =
211
+ enableFullScreen ||
212
+ showParticipantCount ||
213
+ showDuration ||
214
+ showLiveBadge ||
215
+ showSpeakerName;
195
216
  const { participant } = useParticipantViewContext();
196
217
  const { useParticipantCount } = useCallStateHooks();
197
218
  const participantCount = useParticipantCount();
@@ -200,37 +221,39 @@ const ParticipantOverlay = (props: {
200
221
  const { t } = useI18n();
201
222
  return (
202
223
  <div className="str-video__livestream-layout__overlay">
203
- <div className="str-video__livestream-layout__overlay__bar">
204
- {showLiveBadge && (
205
- <span className="str-video__livestream-layout__live-badge">
206
- {t('Live')}
207
- </span>
208
- )}
209
- {showParticipantCount && (
210
- <span className="str-video__livestream-layout__viewers-count">
211
- {participantCount}
212
- </span>
213
- )}
214
- {showSpeakerName && (
215
- <span
216
- className="str-video__livestream-layout__speaker-name"
217
- title={participant.name || participant.userId || ''}
218
- >
219
- {participant.name || participant.userId || ''}
220
- </span>
221
- )}
222
- {showDuration && (
223
- <span className="str-video__livestream-layout__duration">
224
- {formatDuration(duration)}
225
- </span>
226
- )}
227
- {enableFullScreen && (
228
- <span
229
- className="str-video__livestream-layout__go-fullscreen"
230
- onClick={toggleFullScreen}
231
- />
232
- )}
233
- </div>
224
+ {overlayBarVisible && (
225
+ <div className="str-video__livestream-layout__overlay__bar">
226
+ {showLiveBadge && (
227
+ <span className="str-video__livestream-layout__live-badge">
228
+ {t('Live')}
229
+ </span>
230
+ )}
231
+ {showParticipantCount && (
232
+ <span className="str-video__livestream-layout__viewers-count">
233
+ {participantCount}
234
+ </span>
235
+ )}
236
+ {showSpeakerName && (
237
+ <span
238
+ className="str-video__livestream-layout__speaker-name"
239
+ title={participant.name || participant.userId || ''}
240
+ >
241
+ {participant.name || participant.userId || ''}
242
+ </span>
243
+ )}
244
+ {showDuration && (
245
+ <span className="str-video__livestream-layout__duration">
246
+ {formatDuration(duration)}
247
+ </span>
248
+ )}
249
+ {enableFullScreen && (
250
+ <span
251
+ className="str-video__livestream-layout__go-fullscreen"
252
+ onClick={toggleFullScreen}
253
+ />
254
+ )}
255
+ </div>
256
+ )}
234
257
  </div>
235
258
  );
236
259
  };