@stream-io/video-react-sdk 0.0.1-alpha.9 → 0.0.1-alpha.91
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 +22 -150
- package/README.md +1 -1
- package/dist/css/styles.css +273 -407
- package/dist/css/styles.css.map +1 -1
- package/dist/src/components/Button/CompositeButton.js +2 -4
- package/dist/src/components/Button/CompositeButton.js.map +1 -1
- package/dist/src/components/CallControls/AcceptCallButton.d.ts +7 -0
- package/dist/src/components/CallControls/AcceptCallButton.js +27 -0
- package/dist/src/components/CallControls/AcceptCallButton.js.map +1 -0
- package/dist/src/components/CallControls/CallControls.d.ts +1 -3
- package/dist/src/components/CallControls/CallControls.js +2 -5
- package/dist/src/components/CallControls/CallControls.js.map +1 -1
- package/dist/src/components/CallControls/CallStatsButton.d.ts +1 -5
- package/dist/src/components/CallControls/CallStatsButton.js +2 -4
- package/dist/src/components/CallControls/CallStatsButton.js.map +1 -1
- package/dist/src/components/CallControls/CancelCallButton.d.ts +2 -3
- package/dist/src/components/CallControls/CancelCallButton.js +4 -2
- package/dist/src/components/CallControls/CancelCallButton.js.map +1 -1
- package/dist/src/components/CallControls/ReactionsButton.js +1 -2
- package/dist/src/components/CallControls/ReactionsButton.js.map +1 -1
- package/dist/src/components/CallControls/RecordCallButton.d.ts +1 -3
- package/dist/src/components/CallControls/RecordCallButton.js +10 -6
- package/dist/src/components/CallControls/RecordCallButton.js.map +1 -1
- package/dist/src/components/CallControls/ScreenShareButton.d.ts +1 -3
- package/dist/src/components/CallControls/ScreenShareButton.js +7 -7
- package/dist/src/components/CallControls/ScreenShareButton.js.map +1 -1
- package/dist/src/components/CallControls/ToggleAudioButton.d.ts +1 -1
- package/dist/src/components/CallControls/ToggleAudioButton.js +17 -10
- package/dist/src/components/CallControls/ToggleAudioButton.js.map +1 -1
- package/dist/src/components/CallControls/ToggleVideoButton.d.ts +10 -0
- package/dist/src/components/CallControls/{ToggleCameraButton.js → ToggleVideoButton.js} +17 -11
- package/dist/src/components/CallControls/ToggleVideoButton.js.map +1 -0
- package/dist/src/components/CallControls/index.d.ts +2 -2
- package/dist/src/components/CallControls/index.js +2 -2
- package/dist/src/components/CallControls/index.js.map +1 -1
- package/dist/src/components/CallParticipantsList/BlockedUserListing.js +1 -2
- package/dist/src/components/CallParticipantsList/BlockedUserListing.js.map +1 -1
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.d.ts +2 -1
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js +13 -5
- package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js.map +1 -1
- package/dist/src/components/CallParticipantsList/CallParticipantsList.js +1 -2
- package/dist/src/components/CallParticipantsList/CallParticipantsList.js.map +1 -1
- package/dist/src/components/CallStats/CallStats.d.ts +6 -0
- package/dist/src/components/{StreamCall → CallStats}/CallStats.js +3 -3
- package/dist/src/components/CallStats/CallStats.js.map +1 -0
- package/dist/src/components/CallStats/CallStatsLatencyChart.js.map +1 -0
- package/dist/src/components/CallStats/index.d.ts +2 -0
- package/dist/src/components/CallStats/index.js +3 -0
- package/dist/src/components/CallStats/index.js.map +1 -0
- package/dist/src/components/Debug/DebugStatsView.d.ts +1 -1
- package/dist/src/components/Debug/DebugStatsView.js +32 -7
- package/dist/src/components/Debug/DebugStatsView.js.map +1 -1
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js +5 -3
- package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js.map +1 -1
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js +3 -2
- package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js.map +1 -1
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js +4 -2
- package/dist/src/components/Notification/SpeakingWhileMutedNotification.js.map +1 -1
- package/dist/src/components/PendingCallPanel/PendingCallControls.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.js +13 -0
- package/dist/src/components/PendingCallPanel/PendingCallControls.js.map +1 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js +34 -0
- package/dist/src/components/PendingCallPanel/PendingCallPanel.js.map +1 -0
- package/dist/src/components/PendingCallPanel/index.d.ts +2 -0
- package/dist/src/components/PendingCallPanel/index.js +3 -0
- package/dist/src/components/PendingCallPanel/index.js.map +1 -0
- package/dist/src/components/Permissions/PermissionRequests.js +2 -8
- package/dist/src/components/Permissions/PermissionRequests.js.map +1 -1
- package/dist/src/components/StreamCall/CallParticipantsScreenView.js +3 -3
- package/dist/src/components/StreamCall/CallParticipantsScreenView.js.map +1 -1
- package/dist/src/components/StreamCall/CallParticipantsView.js +2 -3
- package/dist/src/components/StreamCall/CallParticipantsView.js.map +1 -1
- package/dist/src/components/StreamTheme/StreamTheme.d.ts +5 -0
- package/dist/src/components/StreamTheme/StreamTheme.js +18 -0
- package/dist/src/components/StreamTheme/StreamTheme.js.map +1 -0
- package/dist/src/components/StreamTheme/index.d.ts +1 -0
- package/dist/src/components/StreamTheme/index.js +2 -0
- package/dist/src/components/StreamTheme/index.js.map +1 -0
- package/dist/src/components/Video/VideoPreview.js +10 -5
- package/dist/src/components/Video/VideoPreview.js.map +1 -1
- package/dist/src/components/Video/index.d.ts +1 -1
- package/dist/src/components/Video/index.js +1 -1
- package/dist/src/components/Video/index.js.map +1 -1
- package/dist/src/components/index.d.ts +2 -2
- package/dist/src/components/index.js +2 -2
- package/dist/src/components/index.js.map +1 -1
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.d.ts +3 -7
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js +13 -14
- package/dist/src/core/components/CallLayout/PaginatedGridLayout.js.map +1 -1
- package/dist/src/core/components/CallLayout/SpeakerLayout.d.ts +6 -1
- package/dist/src/core/components/CallLayout/SpeakerLayout.js +13 -7
- package/dist/src/core/components/CallLayout/SpeakerLayout.js.map +1 -1
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.d.ts +18 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js +36 -0
- package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js.map +1 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.d.ts +79 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.js +33 -0
- package/dist/src/core/components/ParticipantView/ParticipantView.js.map +1 -0
- package/dist/src/core/components/ParticipantView/index.d.ts +2 -0
- package/dist/src/core/components/ParticipantView/index.js +3 -0
- package/dist/src/core/components/ParticipantView/index.js.map +1 -0
- package/dist/src/core/components/StreamCall/StreamCall.d.ts +73 -0
- package/dist/src/core/components/StreamCall/StreamCall.js +60 -0
- package/dist/src/core/components/StreamCall/StreamCall.js.map +1 -0
- package/dist/src/core/components/StreamCall/index.d.ts +1 -0
- package/dist/src/core/components/StreamCall/index.js +2 -0
- package/dist/src/core/components/StreamCall/index.js.map +1 -0
- package/dist/src/core/components/Video/BaseVideo.d.ts +3 -3
- package/dist/src/core/components/Video/BaseVideo.js +6 -12
- package/dist/src/core/components/Video/BaseVideo.js.map +1 -1
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.d.ts +6 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.js +9 -0
- package/dist/src/core/components/Video/DefaultVideoPlaceholder.js.map +1 -0
- package/dist/src/core/components/Video/Video.d.ts +11 -6
- package/dist/src/core/components/Video/Video.js +31 -28
- package/dist/src/core/components/Video/Video.js.map +1 -1
- package/dist/src/core/components/index.d.ts +3 -2
- package/dist/src/core/components/index.js +2 -1
- package/dist/src/core/components/index.js.map +1 -1
- package/dist/src/core/contexts/MediaDevicesContext.d.ts +117 -19
- package/dist/src/core/contexts/MediaDevicesContext.js +52 -90
- package/dist/src/core/contexts/MediaDevicesContext.js.map +1 -1
- package/dist/src/core/hooks/index.d.ts +2 -0
- package/dist/src/core/hooks/index.js +2 -0
- package/dist/src/core/hooks/index.js.map +1 -1
- package/dist/src/core/hooks/useAudioPublisher.js +9 -3
- package/dist/src/core/hooks/useAudioPublisher.js.map +1 -1
- package/dist/src/core/hooks/useDevices.d.ts +80 -0
- package/dist/src/core/hooks/useDevices.js +113 -0
- package/dist/src/core/hooks/useDevices.js.map +1 -0
- package/dist/src/core/hooks/useTrackElementVisibility.d.ts +6 -0
- package/dist/src/core/hooks/useTrackElementVisibility.js +27 -0
- package/dist/src/core/hooks/useTrackElementVisibility.js.map +1 -0
- package/dist/src/core/hooks/useVideoPublisher.js +35 -6
- package/dist/src/core/hooks/useVideoPublisher.js.map +1 -1
- package/dist/src/hooks/index.d.ts +0 -1
- package/dist/src/hooks/index.js +0 -1
- package/dist/src/hooks/index.js.map +1 -1
- package/dist/src/utilities/applyElementToRef.d.ts +2 -0
- package/dist/src/utilities/applyElementToRef.js +8 -0
- package/dist/src/utilities/applyElementToRef.js.map +1 -0
- package/dist/src/utilities/chunk.d.ts +1 -0
- package/dist/src/utilities/chunk.js +5 -0
- package/dist/src/utilities/chunk.js.map +1 -0
- package/dist/src/utilities/index.d.ts +3 -0
- package/dist/src/utilities/index.js +4 -0
- package/dist/src/utilities/index.js.map +1 -0
- package/dist/src/utilities/isComponentType.d.ts +2 -0
- package/dist/src/utilities/isComponentType.js +7 -0
- package/dist/src/utilities/isComponentType.js.map +1 -0
- package/package.json +12 -10
- package/src/components/Button/CompositeButton.tsx +4 -13
- package/src/components/CallControls/AcceptCallButton.tsx +36 -0
- package/src/components/CallControls/CallControls.tsx +13 -19
- package/src/components/CallControls/CallStatsButton.tsx +6 -14
- package/src/components/CallControls/CancelCallButton.tsx +12 -4
- package/src/components/CallControls/ReactionsButton.tsx +1 -2
- package/src/components/CallControls/RecordCallButton.tsx +12 -7
- package/src/components/CallControls/ScreenShareButton.tsx +7 -8
- package/src/components/CallControls/ToggleAudioButton.tsx +23 -12
- package/src/components/CallControls/{ToggleCameraButton.tsx → ToggleVideoButton.tsx} +20 -13
- package/src/components/CallControls/index.ts +2 -2
- package/src/components/CallParticipantsList/BlockedUserListing.tsx +1 -2
- package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +27 -3
- package/src/components/CallParticipantsList/CallParticipantsList.tsx +1 -1
- package/src/components/{StreamCall → CallStats}/CallStats.tsx +3 -3
- package/src/components/CallStats/index.ts +2 -0
- package/src/components/Debug/DebugStatsView.tsx +60 -7
- package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +9 -4
- package/src/components/DeviceSettings/DeviceSelectorVideo.tsx +3 -3
- package/src/components/Notification/SpeakingWhileMutedNotification.tsx +9 -8
- package/src/components/PendingCallPanel/PendingCallControls.tsx +27 -0
- package/src/components/PendingCallPanel/PendingCallPanel.tsx +71 -0
- package/src/components/PendingCallPanel/index.ts +2 -0
- package/src/components/Permissions/PermissionRequests.tsx +2 -8
- package/src/components/StreamCall/CallParticipantsScreenView.tsx +3 -4
- package/src/components/StreamCall/CallParticipantsView.tsx +3 -4
- package/src/components/StreamTheme/StreamTheme.tsx +19 -0
- package/src/components/StreamTheme/index.ts +1 -0
- package/src/components/Video/VideoPreview.tsx +16 -6
- package/src/components/Video/index.ts +1 -1
- package/src/components/index.ts +2 -2
- package/src/core/components/CallLayout/PaginatedGridLayout.tsx +32 -36
- package/src/core/components/CallLayout/SpeakerLayout.tsx +48 -25
- package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +160 -0
- package/src/core/components/ParticipantView/ParticipantView.tsx +156 -0
- package/src/core/components/ParticipantView/index.ts +2 -0
- package/src/core/components/StreamCall/StreamCall.tsx +157 -0
- package/src/core/components/StreamCall/index.ts +1 -0
- package/src/core/components/Video/BaseVideo.tsx +9 -24
- package/src/core/components/Video/DefaultVideoPlaceholder.tsx +36 -0
- package/src/core/components/Video/Video.tsx +62 -48
- package/src/core/components/index.ts +3 -2
- package/src/core/contexts/MediaDevicesContext.tsx +179 -136
- package/src/core/hooks/index.ts +2 -0
- package/src/core/hooks/useAudioPublisher.ts +9 -3
- package/src/core/hooks/useDevices.ts +161 -0
- package/src/core/hooks/useTrackElementVisibility.ts +44 -0
- package/src/core/hooks/useVideoPublisher.ts +36 -4
- package/src/hooks/index.ts +0 -1
- package/src/utilities/applyElementToRef.ts +12 -0
- package/src/utilities/chunk.ts +8 -0
- package/src/utilities/index.ts +3 -0
- package/src/utilities/isComponentType.ts +9 -0
- package/dist/src/components/CallControls/ToggleCameraButton.d.ts +0 -10
- package/dist/src/components/CallControls/ToggleCameraButton.js.map +0 -1
- package/dist/src/components/CallControls/ToggleParticipantListButton.d.ts +0 -6
- package/dist/src/components/CallControls/ToggleParticipantListButton.js +0 -7
- package/dist/src/components/CallControls/ToggleParticipantListButton.js.map +0 -1
- package/dist/src/components/Moderation/Restricted.d.ts +0 -19
- package/dist/src/components/Moderation/Restricted.js +0 -13
- package/dist/src/components/Moderation/Restricted.js.map +0 -1
- package/dist/src/components/Moderation/index.d.ts +0 -1
- package/dist/src/components/Moderation/index.js +0 -2
- package/dist/src/components/Moderation/index.js.map +0 -1
- package/dist/src/components/StreamCall/CallStats.d.ts +0 -2
- package/dist/src/components/StreamCall/CallStats.js.map +0 -1
- package/dist/src/components/StreamCall/CallStatsLatencyChart.js.map +0 -1
- package/dist/src/components/StreamMeeting/StreamMeeting.d.ts +0 -34
- package/dist/src/components/StreamMeeting/StreamMeeting.js +0 -26
- package/dist/src/components/StreamMeeting/StreamMeeting.js.map +0 -1
- package/dist/src/components/StreamMeeting/index.d.ts +0 -1
- package/dist/src/components/StreamMeeting/index.js +0 -2
- package/dist/src/components/StreamMeeting/index.js.map +0 -1
- package/dist/src/core/components/ParticipantBox/ParticipantBox.d.ts +0 -48
- package/dist/src/core/components/ParticipantBox/ParticipantBox.js +0 -58
- package/dist/src/core/components/ParticipantBox/ParticipantBox.js.map +0 -1
- package/dist/src/core/components/ParticipantBox/index.d.ts +0 -1
- package/dist/src/core/components/ParticipantBox/index.js +0 -2
- package/dist/src/core/components/ParticipantBox/index.js.map +0 -1
- package/dist/src/core/components/Video/VideoPlaceholder.d.ts +0 -6
- package/dist/src/core/components/Video/VideoPlaceholder.js +0 -12
- package/dist/src/core/components/Video/VideoPlaceholder.js.map +0 -1
- package/dist/src/hooks/useRtcStats.d.ts +0 -11
- package/dist/src/hooks/useRtcStats.js +0 -39
- package/dist/src/hooks/useRtcStats.js.map +0 -1
- package/src/components/CallControls/ToggleParticipantListButton.tsx +0 -17
- package/src/components/Moderation/Restricted.tsx +0 -38
- package/src/components/Moderation/index.ts +0 -1
- package/src/components/StreamMeeting/StreamMeeting.tsx +0 -80
- package/src/components/StreamMeeting/index.ts +0 -1
- package/src/core/components/ParticipantBox/ParticipantBox.tsx +0 -248
- package/src/core/components/ParticipantBox/index.ts +0 -1
- package/src/core/components/Video/VideoPlaceholder.tsx +0 -40
- package/src/hooks/useRtcStats.ts +0 -36
- /package/dist/src/components/{StreamCall → CallStats}/CallStatsLatencyChart.d.ts +0 -0
- /package/dist/src/components/{StreamCall → CallStats}/CallStatsLatencyChart.js +0 -0
- /package/src/components/{StreamCall → CallStats}/CallStatsLatencyChart.tsx +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import clsx from 'clsx';
|
|
14
|
+
export const StreamTheme = (_a) => {
|
|
15
|
+
var { as: Component = 'div', className, children } = _a, props = __rest(_a, ["as", "className", "children"]);
|
|
16
|
+
return (_jsx(Component, Object.assign({}, props, { className: clsx('str-video', className) }, { children: children })));
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=StreamTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StreamTheme.js","sourceRoot":"","sources":["../../../../src/components/StreamTheme/StreamTheme.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,IAAI,MAAM,MAAM,CAAC;AAMxB,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAKU,EAAE,EAAE;QALd,EAC1B,EAAE,EAAE,SAAS,GAAG,KAAK,EACrB,SAAS,EACT,QAAQ,OAE4B,EADjC,KAAK,cAJkB,+BAK3B,CADS;IAER,OAAO,CACL,KAAC,SAAS,oBAAK,KAAK,IAAE,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,gBAC1D,QAAQ,IACC,CACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './StreamTheme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/StreamTheme/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useCallback, useEffect, useState, } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
4
|
import { disposeOfMediaStream } from '@stream-io/video-client';
|
|
5
|
-
import { BaseVideo } from '../../core/components/Video
|
|
6
|
-
import { DEVICE_STATE, useMediaDevices } from '../../core
|
|
5
|
+
import { BaseVideo } from '../../core/components/Video';
|
|
6
|
+
import { DEVICE_STATE, useMediaDevices, useOnUnavailableVideoDevices, useVideoDevices, } from '../../core';
|
|
7
7
|
import { LoadingIndicator } from '../LoadingIndicator';
|
|
8
8
|
const DefaultDisabledVideoPreview = () => {
|
|
9
9
|
return _jsx("div", { children: "Video is disabled" });
|
|
@@ -16,11 +16,16 @@ const DefaultVideoErrorPreview = ({ message }) => {
|
|
|
16
16
|
};
|
|
17
17
|
export const VideoPreview = ({ mirror = true, DisabledVideoPreview = DefaultDisabledVideoPreview, NoCameraPreview = DefaultNoCameraPreview, StartingCameraPreview = LoadingIndicator, VideoErrorPreview = DefaultVideoErrorPreview, }) => {
|
|
18
18
|
const [stream, setStream] = useState();
|
|
19
|
-
const {
|
|
19
|
+
const { selectedVideoDeviceId, getVideoStream, initialVideoState, setInitialVideoState, } = useMediaDevices();
|
|
20
|
+
// When there are 0 video devices (e.g. when laptop lid closed),
|
|
21
|
+
// we do not restart the video automatically when the device is again available,
|
|
22
|
+
// but rather leave turning the video on manually to the user.
|
|
23
|
+
useOnUnavailableVideoDevices(() => setInitialVideoState(DEVICE_STATE.stopped));
|
|
24
|
+
const videoDevices = useVideoDevices();
|
|
20
25
|
useEffect(() => {
|
|
21
|
-
if (!initialVideoState.enabled
|
|
26
|
+
if (!initialVideoState.enabled)
|
|
22
27
|
return;
|
|
23
|
-
getVideoStream(selectedVideoDeviceId)
|
|
28
|
+
getVideoStream({ deviceId: selectedVideoDeviceId })
|
|
24
29
|
.then((s) => {
|
|
25
30
|
setStream((previousStream) => {
|
|
26
31
|
if (previousStream) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VideoPreview.js","sourceRoot":"","sources":["../../../../src/components/Video/VideoPreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"VideoPreview.js","sourceRoot":"","sources":["../../../../src/components/Video/VideoPreview.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,WAAW,EACX,SAAS,EACT,QAAQ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AC,OAAO,EAAE;QACpC,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,KAAK,UAAU,CAAC;QACtD,QAAQ,GAAG,CACT,8BACG,MAAM,IAAI,CACT,KAAC,SAAS,IACR,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,IAAI,CAAC,0BAA0B,EAAE;wBAC1C,kCAAkC,EAAE,MAAM;wBAC1C,mCAAmC,EAAE,OAAO;qBAC7C,CAAC,EACF,MAAM,EAAE,YAAY,GACpB,CACH,EACA,OAAO,IAAI,KAAC,qBAAqB,KAAG,IACpC,CACJ,CAAC;KACH;SAAM;QACL,QAAQ,GAAG,KAAC,oBAAoB,KAAG,CAAC;KACrC;IAED,OAAO,CACL,4BAAK,SAAS,EAAE,IAAI,CAAC,oCAAoC,CAAC,gBAAG,QAAQ,IAAO,CAC7E,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export * from '../../core/components/Video/Video';
|
|
2
2
|
export * from '../../core/components/Video/BaseVideo';
|
|
3
|
-
export * from '../../core/components/Video/
|
|
3
|
+
export * from '../../core/components/Video/DefaultVideoPlaceholder';
|
|
4
4
|
export * from './VideoPreview';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from '../../core/components/Video/Video';
|
|
2
2
|
export * from '../../core/components/Video/BaseVideo';
|
|
3
|
-
export * from '../../core/components/Video/
|
|
3
|
+
export * from '../../core/components/Video/DefaultVideoPlaceholder';
|
|
4
4
|
export * from './VideoPreview';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Video/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Video/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qDAAqD,CAAC;AACpE,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export * from './Avatar';
|
|
2
2
|
export * from './Button';
|
|
3
3
|
export * from './CallControls';
|
|
4
|
-
export * from '../core/components/CallLayout';
|
|
5
4
|
export * from './CallParticipantsList';
|
|
6
5
|
export * from './CallRecordingList';
|
|
7
6
|
export * from './DeviceSettings';
|
|
8
7
|
export * from './LoadingIndicator';
|
|
9
8
|
export * from './Menu';
|
|
10
9
|
export * from './Notification';
|
|
10
|
+
export * from './PendingCallPanel';
|
|
11
11
|
export * from './Permissions';
|
|
12
12
|
export * from './StreamCall';
|
|
13
|
-
export * from './
|
|
13
|
+
export * from './StreamTheme';
|
|
14
14
|
export * from './Search';
|
|
15
15
|
export * from './Tooltip';
|
|
16
16
|
export * from './Video';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export * from './Avatar';
|
|
2
2
|
export * from './Button';
|
|
3
3
|
export * from './CallControls';
|
|
4
|
-
export * from '../core/components/CallLayout';
|
|
5
4
|
export * from './CallParticipantsList';
|
|
6
5
|
export * from './CallRecordingList';
|
|
7
6
|
export * from './DeviceSettings';
|
|
8
7
|
export * from './LoadingIndicator';
|
|
9
8
|
export * from './Menu';
|
|
10
9
|
export * from './Notification';
|
|
10
|
+
export * from './PendingCallPanel';
|
|
11
11
|
export * from './Permissions';
|
|
12
12
|
export * from './StreamCall';
|
|
13
|
-
export * from './
|
|
13
|
+
export * from './StreamTheme';
|
|
14
14
|
export * from './Search';
|
|
15
15
|
export * from './Tooltip';
|
|
16
16
|
export * from './Video';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { ParticipantViewProps } from '../ParticipantView';
|
|
2
3
|
export type PaginatedGridLayoutProps = {
|
|
3
4
|
/**
|
|
4
5
|
* The number of participants to display per page.
|
|
@@ -8,14 +9,9 @@ export type PaginatedGridLayoutProps = {
|
|
|
8
9
|
* Whether to exclude the local participant from the grid.
|
|
9
10
|
*/
|
|
10
11
|
excludeLocalParticipant?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Turns on/off the status indicator icons (mute, connection quality, etc...)
|
|
13
|
-
* on the participant boxes.
|
|
14
|
-
*/
|
|
15
|
-
indicatorsVisible?: boolean;
|
|
16
12
|
/**
|
|
17
13
|
* Turns on/off the pagination arrows.
|
|
18
14
|
*/
|
|
19
15
|
pageArrowsVisible?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export declare const PaginatedGridLayout: ({ groupSize, excludeLocalParticipant,
|
|
16
|
+
} & Pick<ParticipantViewProps, 'ParticipantViewUI' | 'VideoPlaceholder'>;
|
|
17
|
+
export declare const PaginatedGridLayout: ({ groupSize, excludeLocalParticipant, pageArrowsVisible, VideoPlaceholder, ParticipantViewUI, }: PaginatedGridLayoutProps) => JSX.Element | null;
|
|
@@ -2,20 +2,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { useCall, useLocalParticipant, useParticipants, useRemoteParticipants, } from '@stream-io/video-react-bindings';
|
|
4
4
|
import clsx from 'clsx';
|
|
5
|
-
import {
|
|
5
|
+
import { ParticipantView, DefaultParticipantViewUI, } from '../ParticipantView';
|
|
6
6
|
import { Audio } from '../Audio';
|
|
7
7
|
import { IconButton } from '../../../components';
|
|
8
|
+
import { chunk } from '../../../utilities';
|
|
8
9
|
const GROUP_SIZE = 16;
|
|
9
|
-
const PaginatedGridLayoutGroup = ({ group,
|
|
10
|
-
|
|
11
|
-
return (_jsx("div", Object.assign({ className: clsx('str-video__paginated-grid-layout--group', {
|
|
10
|
+
const PaginatedGridLayoutGroup = ({ group, VideoPlaceholder, ParticipantViewUI, }) => {
|
|
11
|
+
return (_jsx("div", Object.assign({ className: clsx('str-video__paginated-grid-layout__group', {
|
|
12
12
|
'str-video__paginated-grid-layout--one': group.length === 1,
|
|
13
13
|
'str-video__paginated-grid-layout--two-four': group.length >= 2 && group.length <= 4,
|
|
14
14
|
'str-video__paginated-grid-layout--five-nine': group.length >= 5 && group.length <= 9,
|
|
15
|
-
}) }, { children: group.map((participant) => (_jsx(
|
|
15
|
+
}) }, { children: group.map((participant) => (_jsx(ParticipantView, { participant: participant, muteAudio: true, VideoPlaceholder: VideoPlaceholder, ParticipantViewUI: ParticipantViewUI }, participant.sessionId))) })));
|
|
16
16
|
};
|
|
17
|
-
export const PaginatedGridLayout = ({ groupSize = GROUP_SIZE, excludeLocalParticipant = false,
|
|
17
|
+
export const PaginatedGridLayout = ({ groupSize = GROUP_SIZE, excludeLocalParticipant = false, pageArrowsVisible = true, VideoPlaceholder, ParticipantViewUI = DefaultParticipantViewUI, }) => {
|
|
18
18
|
const [page, setPage] = useState(0);
|
|
19
|
+
const call = useCall();
|
|
19
20
|
const localParticipant = useLocalParticipant();
|
|
20
21
|
const participants = useParticipants();
|
|
21
22
|
// used to render audio elements
|
|
@@ -25,15 +26,13 @@ export const PaginatedGridLayout = ({ groupSize = GROUP_SIZE, excludeLocalPartic
|
|
|
25
26
|
const pageCount = participantGroups.length;
|
|
26
27
|
// update page when page count is reduced and selected page no longer exists
|
|
27
28
|
useEffect(() => {
|
|
28
|
-
if (page > pageCount - 1)
|
|
29
|
-
setPage(pageCount - 1);
|
|
29
|
+
if (page > pageCount - 1) {
|
|
30
|
+
setPage(Math.max(0, pageCount - 1));
|
|
31
|
+
}
|
|
30
32
|
}, [page, pageCount]);
|
|
31
33
|
const selectedGroup = participantGroups[page];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const chunk = (array, size = GROUP_SIZE) => {
|
|
36
|
-
const chunkCount = Math.ceil(array.length / size);
|
|
37
|
-
return Array.from({ length: chunkCount }, (_, index) => array.slice(size * index, size * index + size));
|
|
34
|
+
if (!call)
|
|
35
|
+
return null;
|
|
36
|
+
return (_jsxs(_Fragment, { children: [remoteParticipants.map((participant) => (_jsx(Audio, { muted: false, audioStream: participant.audioStream, sinkId: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.audioOutputDeviceId }, participant.sessionId))), _jsx("div", Object.assign({ className: "str-video__paginated-grid-layout__wrapper" }, { children: _jsxs("div", Object.assign({ className: "str-video__paginated-grid-layout" }, { children: [pageArrowsVisible && pageCount > 1 && (_jsx(IconButton, { icon: "caret-left", disabled: page === 0, onClick: () => setPage((currentPage) => Math.max(0, currentPage - 1)) })), selectedGroup && (_jsx(PaginatedGridLayoutGroup, { group: participantGroups[page], VideoPlaceholder: VideoPlaceholder, ParticipantViewUI: ParticipantViewUI })), pageArrowsVisible && pageCount > 1 && (_jsx(IconButton, { disabled: page === pageCount - 1, icon: "caret-right", onClick: () => setPage((currentPage) => Math.min(pageCount - 1, currentPage + 1)) }))] })) }))] }));
|
|
38
37
|
};
|
|
39
38
|
//# sourceMappingURL=PaginatedGridLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PaginatedGridLayout.js","sourceRoot":"","sources":["../../../../../src/core/components/CallLayout/PaginatedGridLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,EACf,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,
|
|
1
|
+
{"version":3,"file":"PaginatedGridLayout.js","sourceRoot":"","sources":["../../../../../src/core/components/CallLayout/PaginatedGridLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,EACf,qBAAqB,GACtB,MAAM,iCAAiC,CAAC;AAKzC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EACL,eAAe,EACf,wBAAwB,GAEzB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,UAAU,GAAG,EAAE,CAAC;AAUtB,MAAM,wBAAwB,GAAG,CAAC,EAChC,KAAK,EACL,gBAAgB,EAChB,iBAAiB,GACa,EAAE,EAAE;IAClC,OAAO,CACL,4BACE,SAAS,EAAE,IAAI,CAAC,yCAAyC,EAAE;YACzD,uCAAuC,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC;YAC3D,4CAA4C,EAC1C,KAAK,CAAC,MAAM,IAAI,CAAC,IAAI,KAAK,CAAC,MAA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AC,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,CACzC,GAEH,CACH,KACG,IACF,IACL,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { ParticipantViewProps } from '../ParticipantView';
|
|
3
|
+
export type SpeakerLayoutProps = {
|
|
4
|
+
ParticipantViewUISpotlight?: ParticipantViewProps['ParticipantViewUI'];
|
|
5
|
+
ParticipantViewUIBar?: ParticipantViewProps['ParticipantViewUI'];
|
|
6
|
+
} & Pick<ParticipantViewProps, 'VideoPlaceholder'>;
|
|
7
|
+
export declare const SpeakerLayout: ({ ParticipantViewUIBar, ParticipantViewUISpotlight, VideoPlaceholder, }: SpeakerLayoutProps) => JSX.Element | null;
|
|
@@ -2,10 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from 'react';
|
|
3
3
|
import { CallTypes, combineComparators, defaultSortPreset, screenSharing, SfuModels, speakerLayoutSortPreset, } from '@stream-io/video-client';
|
|
4
4
|
import { useCall, useLocalParticipant, useParticipants, } from '@stream-io/video-react-bindings';
|
|
5
|
-
import {
|
|
6
|
-
import { IconButton } from '../../../components
|
|
5
|
+
import { DefaultParticipantViewUI, ParticipantView, } from '../ParticipantView';
|
|
6
|
+
import { IconButton } from '../../../components';
|
|
7
7
|
import { useHorizontalScrollPosition } from '../../../components/StreamCall/hooks';
|
|
8
|
-
|
|
8
|
+
const DefaultParticipantViewUIBar = () => (_jsx(DefaultParticipantViewUI, { menuPlacement: "top-end" }));
|
|
9
|
+
const DefaultParticipantViewUISpotlight = () => _jsx(DefaultParticipantViewUI, {});
|
|
10
|
+
export const SpeakerLayout = ({ ParticipantViewUIBar = DefaultParticipantViewUIBar, ParticipantViewUISpotlight = DefaultParticipantViewUISpotlight, VideoPlaceholder, }) => {
|
|
9
11
|
const call = useCall();
|
|
10
12
|
const [participantInSpotlight, ...otherParticipants] = useParticipants();
|
|
11
13
|
const [scrollWrapper, setScrollWrapper] = useState(null);
|
|
@@ -19,12 +21,14 @@ export const SpeakerLayout = () => {
|
|
|
19
21
|
scrollWrapper === null || scrollWrapper === void 0 ? void 0 : scrollWrapper.scrollBy({ left: 150, behavior: 'smooth' });
|
|
20
22
|
};
|
|
21
23
|
useEffect(() => {
|
|
22
|
-
if (!scrollWrapper)
|
|
24
|
+
if (!scrollWrapper || !call)
|
|
23
25
|
return;
|
|
24
26
|
const cleanup = call.viewportTracker.setViewport(scrollWrapper);
|
|
25
27
|
return () => cleanup();
|
|
26
|
-
}, [scrollWrapper, call
|
|
28
|
+
}, [scrollWrapper, call]);
|
|
27
29
|
useEffect(() => {
|
|
30
|
+
if (!call)
|
|
31
|
+
return;
|
|
28
32
|
// always show the remote participant in the spotlight
|
|
29
33
|
if (isOneOnOneCall) {
|
|
30
34
|
call.setSortParticipantsBy(combineComparators(screenSharing, loggedIn));
|
|
@@ -38,10 +42,12 @@ export const SpeakerLayout = () => {
|
|
|
38
42
|
call.setSortParticipantsBy(callConfig.options.sortParticipantsBy || defaultSortPreset);
|
|
39
43
|
};
|
|
40
44
|
}, [call, isOneOnOneCall]);
|
|
45
|
+
if (!call)
|
|
46
|
+
return null;
|
|
41
47
|
const isSpeakerScreenSharing = hasScreenShare(participantInSpotlight);
|
|
42
|
-
return (_jsx("div", Object.assign({ className: "str-video__speaker-
|
|
48
|
+
return (_jsx("div", Object.assign({ className: "str-video__speaker-layout__wrapper" }, { children: _jsxs("div", Object.assign({ className: "str-video__speaker-layout" }, { children: [_jsx("div", Object.assign({ className: "str-video__speaker-layout__spotlight" }, { children: participantInSpotlight && (_jsx(ParticipantView, { participant: participantInSpotlight, muteAudio: isSpeakerScreenSharing, videoKind: isSpeakerScreenSharing ? 'screen' : 'video', sinkId: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.audioOutputDeviceId, ParticipantViewUI: ParticipantViewUISpotlight, VideoPlaceholder: VideoPlaceholder })) })), otherParticipants.length > 0 && (_jsxs("div", Object.assign({ className: "str-video__speaker-layout__participants-bar-buttons-wrapper" }, { children: [scrollPosition && scrollPosition !== 'start' && (_jsx(IconButton, { onClick: scrollStartClickHandler, icon: "caret-left", className: "str-video__speaker-layout__participants-bar--button-left" })), _jsx("div", Object.assign({ className: "str-video__speaker-layout__participants-bar-wrapper", ref: setScrollWrapper }, { children: _jsxs("div", Object.assign({ className: "str-video__speaker-layout__participants-bar" }, { children: [isSpeakerScreenSharing && (_jsx("div", Object.assign({ className: "str-video__speaker-layout__participant-tile" }, { children: _jsx(ParticipantView, { participant: participantInSpotlight, sinkId: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.audioOutputDeviceId, ParticipantViewUI: ParticipantViewUIBar, VideoPlaceholder: VideoPlaceholder }) }), participantInSpotlight.sessionId)), otherParticipants.map((participant) => (_jsx("div", Object.assign({ className: "str-video__speaker-layout__participant-tile" }, { children: _jsx(ParticipantView, { participant: participant, sinkId: localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.audioOutputDeviceId, ParticipantViewUI: ParticipantViewUIBar, VideoPlaceholder: VideoPlaceholder }) }), participant.sessionId)))] })) })), scrollPosition && scrollPosition !== 'end' && (_jsx(IconButton, { onClick: scrollEndClickHandler, icon: "caret-right", className: "str-video__speaker-layout__participants-bar--button-right" }))] })))] })) })));
|
|
43
49
|
};
|
|
44
|
-
const hasScreenShare = (p) => p.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE);
|
|
50
|
+
const hasScreenShare = (p) => !!(p === null || p === void 0 ? void 0 : p.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE));
|
|
45
51
|
const loggedIn = (a, b) => {
|
|
46
52
|
if (a.isLoggedInUser)
|
|
47
53
|
return 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpeakerLayout.js","sourceRoot":"","sources":["../../../../../src/core/components/CallLayout/SpeakerLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,SAAS,EACT,kBAAkB,EAElB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,GAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,
|
|
1
|
+
{"version":3,"file":"SpeakerLayout.js","sourceRoot":"","sources":["../../../../../src/core/components/CallLayout/SpeakerLayout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACL,SAAS,EACT,kBAAkB,EAElB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,uBAAuB,GAExB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,GAChB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,wBAAwB,EACxB,eAAe,GAEhB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAOnF,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAAC,CACxC,KAAC,wBAAwB,IAAC,aAAa,EAAC,SAAS,GAAG,CACrD,CAAC;AAEF,MAAM,iCAAiC,GAAG,GAAG,EAAE,CAAC,KAAC,wBAAwB,KAAG,CAAC;AAE7E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,oBAAoB,GAAG,2BAA2B,EAClD,0BAA0B,GAAG,iCAAiC,EAC9D,gBAAgB,GACG,EAAE,EAAE;IACvB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,CAAC,sBAAsB,EAAE,GAAG,iBAAiB,CAAC,GAAG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B,gBAAgB,CAAE,mBAAmB,EAC7C,iBAAiB,EAAE,oBAAoB,EACvC,gBAAgB,EAAE,gBAAgB,GAClC,KAPG,sBAAsB,CAAC,SAAS,CAQjC,CACP,EACA,iBAAiB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACtC,4BACE,SAAS,EAAC,6CAA6C,gBAGvD,KAAC,eAAe,IACd,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,mBAAmB,EAC7C,iBAAiB,EAAE,oBAAoB,EACvC,gBAAgB,EAAE,gBAAgB,GAClC,KAPG,WAAW,CAAC,SAAS,CAQtB,CACP,CAAC,KACE,IACF,EACL,cAAc,IAAI,cAAc,KAAK,KAAK,IAAI,CAC7C,KAAC,UAAU,IACT,OAAO,EAAE,qBAAqB,EAC9B,IAAI,EAAC,aAAa,EAClB,SAAS,EAAC,2DAA2D,GACrE,CACH,KACG,CACP,KACG,IACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,CAA0B,EAAE,EAAE,CACpD,CAAC,CAAC,CAAA,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,eAAe,CAAC,QAAQ,CAAC,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,CAAA,CAAC;AAElE,MAAM,QAAQ,GAAuC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;IAC5D,IAAI,CAAC,CAAC,cAAc;QAAE,OAAO,CAAC,CAAC;IAC/B,IAAI,CAAC,CAAC,cAAc;QAAE,OAAO,CAAC,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC;AACX,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
export type DefaultParticipantViewUIProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Turns on/off the status indicator icons (mute, connection quality, etc...).
|
|
6
|
+
*/
|
|
7
|
+
indicatorsVisible?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Placement of the context menu component when opened
|
|
10
|
+
*/
|
|
11
|
+
menuPlacement?: Placement;
|
|
12
|
+
/**
|
|
13
|
+
* Option to show/hide menu button component
|
|
14
|
+
*/
|
|
15
|
+
showMenuButton?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const DefaultParticipantViewUI: ({ indicatorsVisible, menuPlacement, showMenuButton, }: DefaultParticipantViewUIProps) => JSX.Element;
|
|
18
|
+
export declare const ParticipantDetails: ({ indicatorsVisible, }: Pick<DefaultParticipantViewUIProps, 'indicatorsVisible'>) => JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { SfuModels } from '@stream-io/video-client';
|
|
4
|
+
import { useCall } from '@stream-io/video-react-bindings';
|
|
5
|
+
import { clsx } from 'clsx';
|
|
6
|
+
import { IconButton, MenuToggle, Notification, ParticipantActionsContextMenu, } from '../../../components';
|
|
7
|
+
import { Reaction } from '../../../components/Reaction';
|
|
8
|
+
import { DebugParticipantPublishQuality } from '../../../components/Debug/DebugParticipantPublishQuality';
|
|
9
|
+
import { DebugStatsView } from '../../../components/Debug/DebugStatsView';
|
|
10
|
+
import { useIsDebugMode } from '../../../components/Debug/useIsDebugMode';
|
|
11
|
+
import { useParticipantViewContext } from './ParticipantView';
|
|
12
|
+
const ToggleButton = forwardRef((props, ref) => {
|
|
13
|
+
return _jsx(IconButton, { enabled: props.menuShown, icon: "ellipsis", ref: ref });
|
|
14
|
+
});
|
|
15
|
+
export const DefaultParticipantViewUI = ({ indicatorsVisible = true, menuPlacement = 'bottom-end', showMenuButton = true, }) => {
|
|
16
|
+
const call = useCall();
|
|
17
|
+
const { participant, participantViewElement } = useParticipantViewContext();
|
|
18
|
+
const { reaction, sessionId } = participant;
|
|
19
|
+
return (_jsxs(_Fragment, { children: [showMenuButton && (_jsx(MenuToggle, Object.assign({ strategy: "fixed", placement: menuPlacement, ToggleButton: ToggleButton }, { children: _jsx(ParticipantActionsContextMenu, { participantViewElement: participantViewElement, participant: participant }) }))), reaction && (_jsx(Reaction, { reaction: reaction, sessionId: sessionId, call: call })), _jsx(ParticipantDetails, { indicatorsVisible: indicatorsVisible })] }));
|
|
20
|
+
};
|
|
21
|
+
export const ParticipantDetails = ({ indicatorsVisible = true, }) => {
|
|
22
|
+
const { participant } = useParticipantViewContext();
|
|
23
|
+
const { isDominantSpeaker, isLoggedInUser, connectionQuality, publishedTracks, pinnedAt, sessionId, name, userId, videoStream, } = participant;
|
|
24
|
+
const call = useCall();
|
|
25
|
+
const connectionQualityAsString = !!connectionQuality &&
|
|
26
|
+
SfuModels.ConnectionQuality[connectionQuality].toLowerCase();
|
|
27
|
+
const hasAudio = publishedTracks.includes(SfuModels.TrackType.AUDIO);
|
|
28
|
+
const hasVideo = publishedTracks.includes(SfuModels.TrackType.VIDEO);
|
|
29
|
+
const isPinned = !!pinnedAt;
|
|
30
|
+
const isDebugMode = useIsDebugMode();
|
|
31
|
+
return (_jsxs("div", Object.assign({ className: "str-video__participant-details" }, { children: [_jsxs("span", Object.assign({ className: "str-video__participant-details__name" }, { children: [name || userId, indicatorsVisible && isDominantSpeaker && (_jsx("span", { className: "str-video__participant-details__name--dominant_speaker", title: "Dominant speaker" })), indicatorsVisible && (_jsx(Notification, Object.assign({ isVisible: isLoggedInUser &&
|
|
32
|
+
connectionQuality === SfuModels.ConnectionQuality.POOR, message: "Poor connection quality. Please check your internet connection." }, { children: connectionQualityAsString && (_jsx("span", { className: clsx('str-video__participant-details__connection-quality', `str-video__participant-details__connection-quality--${connectionQualityAsString}`), title: connectionQualityAsString })) }))), indicatorsVisible && !hasAudio && (_jsx("span", { className: "str-video__participant-details__name--audio-muted" })), indicatorsVisible && !hasVideo && (_jsx("span", { className: "str-video__participant-details__name--video-muted" })), indicatorsVisible && isPinned && (
|
|
33
|
+
// TODO: remove this monstrosity once we have a proper design
|
|
34
|
+
_jsx("span", { title: "Unpin", onClick: () => call === null || call === void 0 ? void 0 : call.setParticipantPinnedAt(sessionId), style: { cursor: 'pointer' }, className: "str-video__participant-details__name--pinned" }))] })), isDebugMode && (_jsxs(_Fragment, { children: [_jsx(DebugParticipantPublishQuality, { participant: participant, call: call }), _jsx(DebugStatsView, { call: call, sessionId: sessionId, mediaStream: videoStream })] }))] })));
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=DefaultParticipantViewUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultParticipantViewUI.js","sourceRoot":"","sources":["../../../../../src/core/components/ParticipantView/DefaultParticipantViewUI.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,6BAA6B,GAE9B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,8BAA8B,EAAE,MAAM,0DAA0D,CAAC;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAiB9D,MAAM,YAAY,GAAG,UAAU,CAC7B,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,OAAO,KAAC,UAAU,IAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,IAAI,EAAC,UAAU,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CACH,KACI,EACN,WAAW,IAAI,CACd,8BACE,KAAC,8BAA8B,IAC7B,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,IAAI,GACV,EACF,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,GACxB,IACD,CACJ,KACG,CACP,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ComponentType, ReactElement } from 'react';
|
|
2
|
+
import { StreamVideoLocalParticipant, StreamVideoParticipant } from '@stream-io/video-client';
|
|
3
|
+
import { VideoProps } from '../Video';
|
|
4
|
+
export type ParticipantViewContextValue = Pick<ParticipantViewProps, 'participant'> & {
|
|
5
|
+
participantViewElement: HTMLDivElement | null;
|
|
6
|
+
};
|
|
7
|
+
export declare const useParticipantViewContext: () => ParticipantViewContextValue;
|
|
8
|
+
export type ParticipantViewProps = {
|
|
9
|
+
/**
|
|
10
|
+
* The participant bound to this component.
|
|
11
|
+
*/
|
|
12
|
+
participant: StreamVideoParticipant | StreamVideoLocalParticipant;
|
|
13
|
+
/**
|
|
14
|
+
* Component used to render user interface elements (details, network status...),
|
|
15
|
+
* pass `null` if you wish to not render anything
|
|
16
|
+
* @default DefaultParticipantViewUI
|
|
17
|
+
*/
|
|
18
|
+
ParticipantViewUI?: ComponentType | ReactElement | null;
|
|
19
|
+
/**
|
|
20
|
+
* In supported browsers, this sets the default audio output.
|
|
21
|
+
* The value of this prop should be a valid Audio Output `deviceId`.
|
|
22
|
+
*/
|
|
23
|
+
sinkId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The kind of video stream to play for the given participant.
|
|
26
|
+
*/
|
|
27
|
+
videoKind?: 'video' | 'screen';
|
|
28
|
+
/**
|
|
29
|
+
* Turns on/off the audio for the participant.
|
|
30
|
+
*/
|
|
31
|
+
muteAudio?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* An object with set functions meant for exposing the "native" video
|
|
34
|
+
* and video placeholder elements to the integrators.
|
|
35
|
+
* - `refs.setVideoElement`
|
|
36
|
+
* - `refs.setVideoPlaceholderElement`
|
|
37
|
+
*/
|
|
38
|
+
refs?: VideoProps['refs'];
|
|
39
|
+
/**
|
|
40
|
+
* Custom class applied to the root DOM element.
|
|
41
|
+
*/
|
|
42
|
+
className?: string;
|
|
43
|
+
} & Pick<VideoProps, 'VideoPlaceholder'>;
|
|
44
|
+
export declare const ParticipantView: import("react").ForwardRefExoticComponent<{
|
|
45
|
+
/**
|
|
46
|
+
* The participant bound to this component.
|
|
47
|
+
*/
|
|
48
|
+
participant: StreamVideoParticipant | StreamVideoLocalParticipant;
|
|
49
|
+
/**
|
|
50
|
+
* Component used to render user interface elements (details, network status...),
|
|
51
|
+
* pass `null` if you wish to not render anything
|
|
52
|
+
* @default DefaultParticipantViewUI
|
|
53
|
+
*/
|
|
54
|
+
ParticipantViewUI?: ReactElement<any, string | import("react").JSXElementConstructor<any>> | ComponentType<{}> | null | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* In supported browsers, this sets the default audio output.
|
|
57
|
+
* The value of this prop should be a valid Audio Output `deviceId`.
|
|
58
|
+
*/
|
|
59
|
+
sinkId?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* The kind of video stream to play for the given participant.
|
|
62
|
+
*/
|
|
63
|
+
videoKind?: "video" | "screen" | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Turns on/off the audio for the participant.
|
|
66
|
+
*/
|
|
67
|
+
muteAudio?: boolean | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* An object with set functions meant for exposing the "native" video
|
|
70
|
+
* and video placeholder elements to the integrators.
|
|
71
|
+
* - `refs.setVideoElement`
|
|
72
|
+
* - `refs.setVideoPlaceholderElement`
|
|
73
|
+
*/
|
|
74
|
+
refs?: VideoProps['refs'];
|
|
75
|
+
/**
|
|
76
|
+
* Custom class applied to the root DOM element.
|
|
77
|
+
*/
|
|
78
|
+
className?: string | undefined;
|
|
79
|
+
} & Pick<VideoProps, "VideoPlaceholder"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, useMemo } from 'react';
|
|
3
|
+
import { forwardRef, useState, createContext, } from 'react';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
import { SfuModels, } from '@stream-io/video-client';
|
|
6
|
+
import { Audio } from '../Audio';
|
|
7
|
+
import { Video } from '../Video';
|
|
8
|
+
import { useTrackElementVisibility } from '../../hooks';
|
|
9
|
+
import { DefaultParticipantViewUI } from './DefaultParticipantViewUI';
|
|
10
|
+
import { isComponentType, applyElementToRef } from '../../../utilities';
|
|
11
|
+
const ParticipantViewContext = createContext(undefined);
|
|
12
|
+
export const useParticipantViewContext = () => useContext(ParticipantViewContext);
|
|
13
|
+
export const ParticipantView = forwardRef(({ participant, sinkId, videoKind = 'video', muteAudio, refs, className, VideoPlaceholder, ParticipantViewUI = DefaultParticipantViewUI, }, ref) => {
|
|
14
|
+
const { audioStream, isLoggedInUser, isSpeaking, publishedTracks, sessionId, } = participant;
|
|
15
|
+
const hasAudio = publishedTracks.includes(SfuModels.TrackType.AUDIO);
|
|
16
|
+
const hasVideo = publishedTracks.includes(SfuModels.TrackType.VIDEO);
|
|
17
|
+
const [trackedElement, setTrackedElement] = useState(null);
|
|
18
|
+
// TODO: allow to pass custom ViewportTracker instance from props
|
|
19
|
+
useTrackElementVisibility({
|
|
20
|
+
sessionId,
|
|
21
|
+
trackedElement,
|
|
22
|
+
});
|
|
23
|
+
const participantViewContextValue = useMemo(() => ({ participant, participantViewElement: trackedElement }), [participant, trackedElement]);
|
|
24
|
+
return (_jsx("div", Object.assign({ ref: (element) => {
|
|
25
|
+
applyElementToRef(ref, element);
|
|
26
|
+
setTrackedElement(element);
|
|
27
|
+
}, className: clsx('str-video__participant-view', isSpeaking && 'str-video__participant-view--speaking', !hasVideo && 'str-video__participant-view--no-video', !hasAudio && 'str-video__participant-view--no-audio', className) }, { children: _jsxs(ParticipantViewContext.Provider, Object.assign({ value: participantViewContextValue }, { children: [_jsx(Audio
|
|
28
|
+
// mute the local participant, as we don't want to hear ourselves
|
|
29
|
+
, {
|
|
30
|
+
// mute the local participant, as we don't want to hear ourselves
|
|
31
|
+
muted: isLoggedInUser || muteAudio, sinkId: sinkId, audioStream: audioStream }), _jsx(Video, { VideoPlaceholder: VideoPlaceholder, participant: participant, kind: videoKind, refs: refs, autoPlay: true }), isComponentType(ParticipantViewUI) ? (_jsx(ParticipantViewUI, {})) : (ParticipantViewUI)] })) })));
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=ParticipantView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ParticipantView.js","sourceRoot":"","sources":["../../../../../src/core/components/ParticipantView/ParticipantView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EACL,UAAU,EAEV,QAAQ,EAER,aAAa,GACd,MAAM,OAAO,CAAC;AACf,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EACL,SAAS,GAGV,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,KAAK,EAAc,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AASxE,MAAM,sBAAsB,GAAG,aAAa,CAE1C,SAAS,CAAC,CAAC;AAEb,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,EAAE,CAC5C,UAAU,CAAC,sBAAsB,CAAgC,CAAC;AA6CpE,MAAM,CAAC,MAA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AS,EAClC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,WAAW,GACxB,EACF,KAAC,KAAK,IACJ,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,IAAI,EAAE,SAAS,EACf,IAAI,EAAE,IAAI,EACV,QAAQ,SACR,EACD,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CACpC,KAAC,iBAAiB,KAAG,CACtB,CAAC,CAAC,CAAC,CACF,iBAAiB,CAClB,KAC+B,IAC9B,CACP,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/components/ParticipantView/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { Call, JoinCallData } from '@stream-io/video-client';
|
|
3
|
+
import { MediaDevicesProviderProps } from '../../contexts';
|
|
4
|
+
type InitWithCallCID = {
|
|
5
|
+
/**
|
|
6
|
+
* The call type.
|
|
7
|
+
*/
|
|
8
|
+
callType: string;
|
|
9
|
+
/**
|
|
10
|
+
* The call id.
|
|
11
|
+
*/
|
|
12
|
+
callId: string;
|
|
13
|
+
/**
|
|
14
|
+
* The call instance to use.
|
|
15
|
+
*/
|
|
16
|
+
call?: never;
|
|
17
|
+
};
|
|
18
|
+
type InitWithCallInstance = {
|
|
19
|
+
/**
|
|
20
|
+
* The call instance to use.
|
|
21
|
+
*/
|
|
22
|
+
call: Call | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The call type.
|
|
25
|
+
*/
|
|
26
|
+
callType?: never;
|
|
27
|
+
/**
|
|
28
|
+
* The call id.
|
|
29
|
+
*/
|
|
30
|
+
callId?: never;
|
|
31
|
+
};
|
|
32
|
+
type InitStreamCall = InitWithCallCID | InitWithCallInstance;
|
|
33
|
+
export type StreamCallProps = InitStreamCall & {
|
|
34
|
+
/**
|
|
35
|
+
* If true, the call will be joined automatically.
|
|
36
|
+
* Set it to true if you want to join the call immediately.
|
|
37
|
+
* Useful for scenarios where you want to skip prompting the user to join the call.
|
|
38
|
+
*
|
|
39
|
+
* @default false.
|
|
40
|
+
*/
|
|
41
|
+
autoJoin?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* If true, the call data will be loaded automatically from the server.
|
|
44
|
+
*
|
|
45
|
+
* This property is useful for the scenarios where you declaratively create
|
|
46
|
+
* the call instance by using the `callId` and `callType` props,
|
|
47
|
+
* and you have a UI that depends on the call metadata.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```jsx
|
|
51
|
+
* <StreamCall callId="call-id" callType="call-type" autoLoad>
|
|
52
|
+
* <CallMetadata /> // has access to `call.metadata` although not joined yet
|
|
53
|
+
* <CallUI />
|
|
54
|
+
* <CallControls />
|
|
55
|
+
* </StreamCall>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* This property is ignored if you pass the `call` prop or enable `autoJoin`.
|
|
59
|
+
*
|
|
60
|
+
* @default true.
|
|
61
|
+
*/
|
|
62
|
+
autoLoad?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* An optional data to pass when joining the call.
|
|
65
|
+
*/
|
|
66
|
+
data?: JoinCallData;
|
|
67
|
+
/**
|
|
68
|
+
* An optional props to pass to the `MediaDevicesProvider`.
|
|
69
|
+
*/
|
|
70
|
+
mediaDevicesProviderProps?: MediaDevicesProviderProps;
|
|
71
|
+
};
|
|
72
|
+
export declare const StreamCall: ({ children, callId, callType, call, autoJoin, autoLoad, data, mediaDevicesProviderProps, }: PropsWithChildren<StreamCallProps>) => JSX.Element;
|
|
73
|
+
export {};
|