@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.
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs.js +30 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +30 -24
- package/dist/index.es.js.map +1 -1
- package/dist/src/components/DeviceSettings/index.d.ts +1 -0
- package/dist/src/core/components/CallLayout/LivestreamLayout.d.ts +5 -0
- package/package.json +3 -3
- package/src/components/DeviceSettings/index.ts +1 -0
- package/src/core/components/CallLayout/LivestreamLayout.tsx +68 -45
|
@@ -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.
|
|
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.
|
|
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.
|
|
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,5 +1,11 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
-
import {
|
|
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
|
|
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
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
};
|