@stream-io/video-react-native-sdk 0.1.9 → 0.1.11
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 +18 -0
- package/README.md +5 -4
- package/dist/commonjs/components/Call/CallContent/CallContent.js +1 -1
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js +71 -0
- package/dist/commonjs/components/Livestream/HostLivestream/HostLivestream.js.map +1 -0
- package/dist/commonjs/components/Livestream/HostLivestream/index.js +17 -0
- package/dist/commonjs/components/Livestream/HostLivestream/index.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js +69 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js +113 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js +70 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamMediaControls.js +38 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamMediaControls.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js +70 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +83 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +64 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/index.js +61 -0
- package/dist/commonjs/components/Livestream/LivestreamControls/index.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js +65 -0
- package/dist/commonjs/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamLayout/index.js +17 -0
- package/dist/commonjs/components/Livestream/LivestreamLayout/index.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js +144 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/FollowerCount.js +71 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/FollowerCount.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +87 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js +55 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +80 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/index.js +50 -0
- package/dist/commonjs/components/Livestream/LivestreamTopView/index.js.map +1 -0
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js +88 -0
- package/dist/commonjs/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -0
- package/dist/commonjs/components/Livestream/ViewerLivestream/index.js +17 -0
- package/dist/commonjs/components/Livestream/ViewerLivestream/index.js.map +1 -0
- package/dist/commonjs/components/Livestream/index.js +61 -0
- package/dist/commonjs/components/Livestream/index.js.map +1 -0
- package/dist/commonjs/components/index.js +11 -0
- package/dist/commonjs/components/index.js.map +1 -1
- package/dist/commonjs/hooks/usePaginatedLayoutSortPreset.js +26 -0
- package/dist/commonjs/hooks/usePaginatedLayoutSortPreset.js.map +1 -0
- package/dist/commonjs/icons/EndStreamIcon.js +20 -0
- package/dist/commonjs/icons/EndStreamIcon.js.map +1 -0
- package/dist/commonjs/icons/Eye.js +20 -0
- package/dist/commonjs/icons/Eye.js.map +1 -0
- package/dist/commonjs/icons/LeaveStreamIcon.js +20 -0
- package/dist/commonjs/icons/LeaveStreamIcon.js.map +1 -0
- package/dist/commonjs/icons/ShieldBadge.js +20 -0
- package/dist/commonjs/icons/ShieldBadge.js.map +1 -0
- package/dist/commonjs/icons/StartStreamIcon.js +20 -0
- package/dist/commonjs/icons/StartStreamIcon.js.map +1 -0
- package/dist/commonjs/icons/index.js +55 -0
- package/dist/commonjs/icons/index.js.map +1 -1
- package/dist/commonjs/theme/theme.js +70 -0
- package/dist/commonjs/theme/theme.js.map +1 -1
- package/dist/commonjs/translations/en.json +6 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/commonjs/version.js.map +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Livestream/HostLivestream/HostLivestream.js +64 -0
- package/dist/module/components/Livestream/HostLivestream/HostLivestream.js.map +1 -0
- package/dist/module/components/Livestream/HostLivestream/index.js +2 -0
- package/dist/module/components/Livestream/HostLivestream/index.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js +62 -0
- package/dist/module/components/Livestream/LivestreamControls/HostLivestreamControls.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js +105 -0
- package/dist/module/components/Livestream/LivestreamControls/HostStartStreamButton.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js +63 -0
- package/dist/module/components/Livestream/LivestreamControls/LivestreamAudioControlButton.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/LivestreamMediaControls.js +31 -0
- package/dist/module/components/Livestream/LivestreamControls/LivestreamMediaControls.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js +63 -0
- package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js +75 -0
- package/dist/module/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js +57 -0
- package/dist/module/components/Livestream/LivestreamControls/ViewerLivestreamControls.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamControls/index.js +6 -0
- package/dist/module/components/Livestream/LivestreamControls/index.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js +58 -0
- package/dist/module/components/Livestream/LivestreamLayout/LivestreamLayout.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamLayout/index.js +2 -0
- package/dist/module/components/Livestream/LivestreamLayout/index.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamTopView/DurationBadge.js +136 -0
- package/dist/module/components/Livestream/LivestreamTopView/DurationBadge.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamTopView/FollowerCount.js +64 -0
- package/dist/module/components/Livestream/LivestreamTopView/FollowerCount.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js +80 -0
- package/dist/module/components/Livestream/LivestreamTopView/HostLivestreamTopView.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js +48 -0
- package/dist/module/components/Livestream/LivestreamTopView/LiveIndicator.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js +73 -0
- package/dist/module/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.js.map +1 -0
- package/dist/module/components/Livestream/LivestreamTopView/index.js +5 -0
- package/dist/module/components/Livestream/LivestreamTopView/index.js.map +1 -0
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js +81 -0
- package/dist/module/components/Livestream/ViewerLivestream/ViewerLivestream.js.map +1 -0
- package/dist/module/components/Livestream/ViewerLivestream/index.js +2 -0
- package/dist/module/components/Livestream/ViewerLivestream/index.js.map +1 -0
- package/dist/module/components/Livestream/index.js +6 -0
- package/dist/module/components/Livestream/index.js.map +1 -0
- package/dist/module/components/index.js +1 -0
- package/dist/module/components/index.js.map +1 -1
- package/dist/module/hooks/usePaginatedLayoutSortPreset.js +19 -0
- package/dist/module/hooks/usePaginatedLayoutSortPreset.js.map +1 -0
- package/dist/module/icons/EndStreamIcon.js +12 -0
- package/dist/module/icons/EndStreamIcon.js.map +1 -0
- package/dist/module/icons/Eye.js +12 -0
- package/dist/module/icons/Eye.js.map +1 -0
- package/dist/module/icons/LeaveStreamIcon.js +12 -0
- package/dist/module/icons/LeaveStreamIcon.js.map +1 -0
- package/dist/module/icons/ShieldBadge.js +12 -0
- package/dist/module/icons/ShieldBadge.js.map +1 -0
- package/dist/module/icons/StartStreamIcon.js +12 -0
- package/dist/module/icons/StartStreamIcon.js.map +1 -0
- package/dist/module/icons/index.js +5 -0
- package/dist/module/icons/index.js.map +1 -1
- package/dist/module/theme/theme.js +70 -0
- package/dist/module/theme/theme.js.map +1 -1
- package/dist/module/translations/en.json +6 -1
- package/dist/module/version.js +1 -1
- package/dist/module/version.js.map +1 -1
- package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts +30 -0
- package/dist/typescript/components/Livestream/HostLivestream/HostLivestream.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/HostLivestream/index.d.ts +2 -0
- package/dist/typescript/components/Livestream/HostLivestream/index.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts +25 -0
- package/dist/typescript/components/Livestream/LivestreamControls/HostLivestreamControls.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts +25 -0
- package/dist/typescript/components/Livestream/LivestreamControls/HostStartStreamButton.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamAudioControlButton.d.ts +6 -0
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamAudioControlButton.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts +10 -0
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamMediaControls.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamVideoControlButton.d.ts +6 -0
- package/dist/typescript/components/Livestream/LivestreamControls/LivestreamVideoControlButton.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts +16 -0
- package/dist/typescript/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts +16 -0
- package/dist/typescript/components/Livestream/LivestreamControls/ViewerLivestreamControls.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts +6 -0
- package/dist/typescript/components/Livestream/LivestreamControls/index.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts +17 -0
- package/dist/typescript/components/Livestream/LivestreamLayout/LivestreamLayout.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamLayout/index.d.ts +2 -0
- package/dist/typescript/components/Livestream/LivestreamLayout/index.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts +12 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/DurationBadge.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts +10 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/FollowerCount.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts +26 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/HostLivestreamTopView.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts +10 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/LiveIndicator.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts +26 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts +5 -0
- package/dist/typescript/components/Livestream/LivestreamTopView/index.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts +32 -0
- package/dist/typescript/components/Livestream/ViewerLivestream/ViewerLivestream.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/ViewerLivestream/index.d.ts +2 -0
- package/dist/typescript/components/Livestream/ViewerLivestream/index.d.ts.map +1 -0
- package/dist/typescript/components/Livestream/index.d.ts +6 -0
- package/dist/typescript/components/Livestream/index.d.ts.map +1 -0
- package/dist/typescript/components/index.d.ts +1 -0
- package/dist/typescript/components/index.d.ts.map +1 -1
- package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts +3 -0
- package/dist/typescript/hooks/usePaginatedLayoutSortPreset.d.ts.map +1 -0
- package/dist/typescript/icons/EndStreamIcon.d.ts +3 -0
- package/dist/typescript/icons/EndStreamIcon.d.ts.map +1 -0
- package/dist/typescript/icons/Eye.d.ts +3 -0
- package/dist/typescript/icons/Eye.d.ts.map +1 -0
- package/dist/typescript/icons/LeaveStreamIcon.d.ts +3 -0
- package/dist/typescript/icons/LeaveStreamIcon.d.ts.map +1 -0
- package/dist/typescript/icons/ShieldBadge.d.ts +3 -0
- package/dist/typescript/icons/ShieldBadge.d.ts.map +1 -0
- package/dist/typescript/icons/StartStreamIcon.d.ts +3 -0
- package/dist/typescript/icons/StartStreamIcon.d.ts.map +1 -0
- package/dist/typescript/icons/index.d.ts +5 -0
- package/dist/typescript/icons/index.d.ts.map +1 -1
- package/dist/typescript/theme/theme.d.ts +70 -0
- package/dist/typescript/theme/theme.d.ts.map +1 -1
- package/dist/typescript/translations/index.d.ts +6 -1
- package/dist/typescript/translations/index.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/dist/typescript/version.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/Call/CallContent/CallContent.tsx +1 -1
- package/src/components/Livestream/HostLivestream/HostLivestream.tsx +99 -0
- package/src/components/Livestream/HostLivestream/index.ts +1 -0
- package/src/components/Livestream/LivestreamControls/HostLivestreamControls.tsx +87 -0
- package/src/components/Livestream/LivestreamControls/HostStartStreamButton.tsx +163 -0
- package/src/components/Livestream/LivestreamControls/LivestreamAudioControlButton.tsx +78 -0
- package/src/components/Livestream/LivestreamControls/LivestreamMediaControls.tsx +32 -0
- package/src/components/Livestream/LivestreamControls/LivestreamVideoControlButton.tsx +78 -0
- package/src/components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx +102 -0
- package/src/components/Livestream/LivestreamControls/ViewerLivestreamControls.tsx +75 -0
- package/src/components/Livestream/LivestreamControls/index.ts +5 -0
- package/src/components/Livestream/LivestreamLayout/LivestreamLayout.tsx +77 -0
- package/src/components/Livestream/LivestreamLayout/index.ts +1 -0
- package/src/components/Livestream/LivestreamTopView/DurationBadge.tsx +170 -0
- package/src/components/Livestream/LivestreamTopView/FollowerCount.tsx +74 -0
- package/src/components/Livestream/LivestreamTopView/HostLivestreamTopView.tsx +105 -0
- package/src/components/Livestream/LivestreamTopView/LiveIndicator.tsx +53 -0
- package/src/components/Livestream/LivestreamTopView/ViewerLivestreamTopView.tsx +102 -0
- package/src/components/Livestream/LivestreamTopView/index.ts +4 -0
- package/src/components/Livestream/ViewerLivestream/ViewerLivestream.tsx +126 -0
- package/src/components/Livestream/ViewerLivestream/index.ts +1 -0
- package/src/components/Livestream/index.ts +5 -0
- package/src/components/index.ts +1 -0
- package/src/hooks/usePaginatedLayoutSortPreset.ts +27 -0
- package/src/icons/EndStreamIcon.tsx +13 -0
- package/src/icons/Eye.tsx +13 -0
- package/src/icons/LeaveStreamIcon.tsx +13 -0
- package/src/icons/ShieldBadge.tsx +13 -0
- package/src/icons/StartStreamIcon.tsx +13 -0
- package/src/icons/index.tsx +5 -0
- package/src/theme/theme.ts +140 -0
- package/src/translations/en.json +6 -1
- package/src/version.ts +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { StyleSheet, SafeAreaView, View } from 'react-native';
|
|
4
|
+
import { useIncallManager } from '../../../hooks';
|
|
5
|
+
import { useTheme } from '../../../contexts';
|
|
6
|
+
import {
|
|
7
|
+
ViewerLivestreamTopView as DefaultViewerLivestreamTopView,
|
|
8
|
+
ViewerLivestreamTopViewProps,
|
|
9
|
+
} from '../LivestreamTopView/ViewerLivestreamTopView';
|
|
10
|
+
import {
|
|
11
|
+
ViewerLivestreamControls as DefaultViewerLivestreamControls,
|
|
12
|
+
ViewerLivestreamControlsProps,
|
|
13
|
+
} from '../LivestreamControls/ViewerLivestreamControls';
|
|
14
|
+
import { ViewerLeaveStreamButtonProps } from '../LivestreamControls/ViewerLeaveStreamButton';
|
|
15
|
+
import {
|
|
16
|
+
LivestreamLayout as DefaultLivestreamLayout,
|
|
17
|
+
LivestreamLayoutProps,
|
|
18
|
+
} from '../LivestreamLayout';
|
|
19
|
+
import { useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
20
|
+
import {
|
|
21
|
+
FloatingParticipantView as DefaultFloatingParticipantView,
|
|
22
|
+
FloatingParticipantViewProps,
|
|
23
|
+
} from '../../Participant';
|
|
24
|
+
import { Z_INDEX } from '../../../constants';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Props for the ViewerLivestream component.
|
|
28
|
+
*/
|
|
29
|
+
export type ViewerLivestreamProps = ViewerLivestreamTopViewProps &
|
|
30
|
+
ViewerLivestreamControlsProps &
|
|
31
|
+
ViewerLeaveStreamButtonProps & {
|
|
32
|
+
/**
|
|
33
|
+
* Component to customize the top view at the viewer's live stream.
|
|
34
|
+
*/
|
|
35
|
+
ViewerLivestreamTopView?: React.ComponentType<ViewerLivestreamTopViewProps> | null;
|
|
36
|
+
/**
|
|
37
|
+
* Component to customize the live stream video layout.
|
|
38
|
+
*/
|
|
39
|
+
LivestreamLayout?: React.ComponentType<LivestreamLayoutProps> | null;
|
|
40
|
+
/**
|
|
41
|
+
* Component to customize the bottom view controls at the viewer's live stream.
|
|
42
|
+
*/
|
|
43
|
+
ViewerLivestreamControls?: React.ComponentType<ViewerLivestreamControlsProps> | null;
|
|
44
|
+
/**
|
|
45
|
+
* Component to customize the FloatingParticipantView when screen is shared.
|
|
46
|
+
*/
|
|
47
|
+
FloatingParticipantView?: React.ComponentType<FloatingParticipantViewProps> | null;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The ViewerLivestream component renders the UI for the Viewer's live stream.
|
|
52
|
+
*/
|
|
53
|
+
export const ViewerLivestream = ({
|
|
54
|
+
ViewerLivestreamTopView = DefaultViewerLivestreamTopView,
|
|
55
|
+
ViewerLivestreamControls = DefaultViewerLivestreamControls,
|
|
56
|
+
LivestreamLayout = DefaultLivestreamLayout,
|
|
57
|
+
FloatingParticipantView = DefaultFloatingParticipantView,
|
|
58
|
+
LiveIndicator,
|
|
59
|
+
FollowerCount,
|
|
60
|
+
DurationBadge,
|
|
61
|
+
ViewerLeaveStreamButton,
|
|
62
|
+
onLeaveStreamHandler,
|
|
63
|
+
}: ViewerLivestreamProps) => {
|
|
64
|
+
const {
|
|
65
|
+
theme: { colors, viewerLivestream },
|
|
66
|
+
} = useTheme();
|
|
67
|
+
const { useHasOngoingScreenShare, useParticipants } = useCallStateHooks();
|
|
68
|
+
const hasOngoingScreenShare = useHasOngoingScreenShare();
|
|
69
|
+
const [currentSpeaker] = useParticipants();
|
|
70
|
+
|
|
71
|
+
// Automatically route audio to speaker devices as relevant for watching videos.
|
|
72
|
+
useIncallManager({ media: 'video', auto: true });
|
|
73
|
+
|
|
74
|
+
const topViewProps: ViewerLivestreamTopViewProps = {
|
|
75
|
+
LiveIndicator,
|
|
76
|
+
FollowerCount,
|
|
77
|
+
DurationBadge,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<SafeAreaView
|
|
82
|
+
style={[
|
|
83
|
+
styles.container,
|
|
84
|
+
{ backgroundColor: colors.static_grey },
|
|
85
|
+
viewerLivestream.container,
|
|
86
|
+
]}
|
|
87
|
+
>
|
|
88
|
+
<View style={[styles.view, viewerLivestream.view]}>
|
|
89
|
+
{ViewerLivestreamTopView && (
|
|
90
|
+
<ViewerLivestreamTopView {...topViewProps} />
|
|
91
|
+
)}
|
|
92
|
+
<View
|
|
93
|
+
style={[
|
|
94
|
+
styles.floatingParticipantView,
|
|
95
|
+
viewerLivestream.floatingParticipantView,
|
|
96
|
+
]}
|
|
97
|
+
>
|
|
98
|
+
{hasOngoingScreenShare && FloatingParticipantView && (
|
|
99
|
+
<FloatingParticipantView participant={currentSpeaker} />
|
|
100
|
+
)}
|
|
101
|
+
</View>
|
|
102
|
+
|
|
103
|
+
{ViewerLivestreamControls && (
|
|
104
|
+
<ViewerLivestreamControls
|
|
105
|
+
ViewerLeaveStreamButton={ViewerLeaveStreamButton}
|
|
106
|
+
onLeaveStreamHandler={onLeaveStreamHandler}
|
|
107
|
+
/>
|
|
108
|
+
)}
|
|
109
|
+
</View>
|
|
110
|
+
{LivestreamLayout && <LivestreamLayout />}
|
|
111
|
+
</SafeAreaView>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const styles = StyleSheet.create({
|
|
116
|
+
container: {
|
|
117
|
+
flex: 1,
|
|
118
|
+
},
|
|
119
|
+
floatingParticipantView: {
|
|
120
|
+
flex: 1,
|
|
121
|
+
},
|
|
122
|
+
view: {
|
|
123
|
+
...StyleSheet.absoluteFillObject,
|
|
124
|
+
zIndex: Z_INDEX.IN_FRONT,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ViewerLivestream';
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Call,
|
|
3
|
+
CallTypes,
|
|
4
|
+
defaultSortPreset,
|
|
5
|
+
paginatedLayoutSortPreset,
|
|
6
|
+
} from '@stream-io/video-client';
|
|
7
|
+
import { useEffect } from 'react';
|
|
8
|
+
|
|
9
|
+
const resetSortPreset = (call: Call) => {
|
|
10
|
+
// reset the sorting to the default for the call type
|
|
11
|
+
const callConfig = CallTypes.get(call.type);
|
|
12
|
+
call.setSortParticipantsBy(
|
|
13
|
+
callConfig.options.sortParticipantsBy || defaultSortPreset,
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const usePaginatedLayoutSortPreset = (call: Call | undefined) => {
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
if (!call) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
call.setSortParticipantsBy(paginatedLayoutSortPreset);
|
|
23
|
+
return () => {
|
|
24
|
+
resetSortPreset(call);
|
|
25
|
+
};
|
|
26
|
+
}, [call]);
|
|
27
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Path, Svg } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const EndBroadcastIcon = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Svg viewBox="0 0 26 26" fill="none">
|
|
7
|
+
<Path
|
|
8
|
+
d="M8.55615 10.8184C8.44365 11.2309 8.38115 11.6684 8.38115 12.1184C8.38115 13.4934 8.94365 14.7434 9.84365 15.6559L8.06865 17.4309C6.71865 16.0684 5.88115 14.1934 5.88115 12.1184C5.88115 10.9559 6.14365 9.86836 6.60615 8.88086L4.76865 7.04336C3.88115 8.53086 3.38115 10.2684 3.38115 12.1184C3.38115 14.8809 4.50615 17.3809 6.31865 19.1809L4.54365 20.9559C2.28115 18.6934 0.881152 15.5684 0.881152 12.1184C0.881152 9.56836 1.64365 7.20586 2.95615 5.23086L0.118652 2.39336L1.88115 0.630859L24.8562 23.6059L23.0937 25.3684L8.55615 10.8184ZM20.1562 15.3559C20.6187 14.3684 20.8812 13.2809 20.8812 12.1184C20.8812 10.0434 20.0437 8.16836 18.6812 6.81836L16.9062 8.59336C17.8187 9.49336 18.3812 10.7434 18.3812 12.1184C18.3812 12.5684 18.3187 13.0059 18.2062 13.4184L20.1562 15.3559ZM23.3812 12.1184C23.3812 13.9684 22.8812 15.7059 21.9937 17.1934L23.8062 19.0059C25.1187 17.0309 25.8812 14.6684 25.8812 12.1184C25.8812 8.66836 24.4812 5.54336 22.2187 3.28086L20.4437 5.05586C22.2562 6.85586 23.3812 9.35586 23.3812 12.1184Z"
|
|
9
|
+
fill="#FCFCFC"
|
|
10
|
+
/>
|
|
11
|
+
</Svg>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Svg, Path } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const Eye = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Svg viewBox="0 0 15 10" fill="none">
|
|
7
|
+
<Path
|
|
8
|
+
d="M7.25488 1.5625C9.62363 1.5625 11.7361 2.89375 12.7674 5C11.7361 7.10625 9.62363 8.4375 7.25488 8.4375C4.88613 8.4375 2.77363 7.10625 1.74238 5C2.77363 2.89375 4.88613 1.5625 7.25488 1.5625ZM7.25488 0.3125C4.12988 0.3125 1.46113 2.25625 0.379883 5C1.46113 7.74375 4.12988 9.6875 7.25488 9.6875C10.3799 9.6875 13.0486 7.74375 14.1299 5C13.0486 2.25625 10.3799 0.3125 7.25488 0.3125ZM7.25488 3.4375C8.11738 3.4375 8.81738 4.1375 8.81738 5C8.81738 5.8625 8.11738 6.5625 7.25488 6.5625C6.39238 6.5625 5.69238 5.8625 5.69238 5C5.69238 4.1375 6.39238 3.4375 7.25488 3.4375ZM7.25488 2.1875C5.70488 2.1875 4.44238 3.45 4.44238 5C4.44238 6.55 5.70488 7.8125 7.25488 7.8125C8.80488 7.8125 10.0674 6.55 10.0674 5C10.0674 3.45 8.80488 2.1875 7.25488 2.1875Z"
|
|
9
|
+
fill="#FCFCFC"
|
|
10
|
+
/>
|
|
11
|
+
</Svg>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Path, Svg } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const LeaveStreamIcon = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Svg viewBox="0 0 25 24" fill="none">
|
|
7
|
+
<Path
|
|
8
|
+
d="M18.75 5.75L16.9875 7.5125L20.2125 10.75H7.5V13.25H20.2125L16.9875 16.475L18.75 18.25L25 12L18.75 5.75ZM2.5 3.25H12.5V0.75H2.5C1.125 0.75 0 1.875 0 3.25V20.75C0 22.125 1.125 23.25 2.5 23.25H12.5V20.75H2.5V3.25Z"
|
|
9
|
+
fill="#FCFCFC"
|
|
10
|
+
/>
|
|
11
|
+
</Svg>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Svg, Path } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const ShieldBadge = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Svg viewBox="0 0 9 10" fill="none">
|
|
7
|
+
<Path
|
|
8
|
+
d="M2.79919 8.79157L4.02014 9.63654C4.22869 9.7774 4.49664 9.7774 4.70498 9.63654L5.92594 8.79157C7.6828 7.5523 8.75481 5.60898 8.75481 3.52489V1.60984C8.75481 1.35641 8.57617 1.13107 8.30822 1.07467L4.3774 0.257812L0.446587 1.07447C0.178632 1.13085 0 1.35619 0 1.60964V3.52469C0 5.60888 1.04233 7.58057 2.79919 8.79157ZM2.56093 4.05991L3.69256 5.13019L6.16414 2.79258L7.05753 3.63755L3.72223 6.82014L1.69742 4.90488L2.56093 4.05991Z"
|
|
9
|
+
fill="#00E2A1"
|
|
10
|
+
/>
|
|
11
|
+
</Svg>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Path, Svg } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
export const StartStreamIcon = () => {
|
|
5
|
+
return (
|
|
6
|
+
<Svg viewBox="0 0 25 18" fill="none">
|
|
7
|
+
<Path
|
|
8
|
+
d="M7.2 14.2996C5.8375 12.9496 5 11.0746 5 8.99961C5 6.92461 5.8375 5.04961 7.2 3.69961L8.975 5.47461C8.0625 6.37461 7.5 7.62461 7.5 8.99961C7.5 10.3746 8.0625 11.6246 8.9625 12.5371L7.2 14.2996ZM17.8 14.2996C19.1625 12.9496 20 11.0746 20 8.99961C20 6.92461 19.1625 5.04961 17.8 3.69961L16.025 5.47461C16.9375 6.37461 17.5 7.62461 17.5 8.99961C17.5 10.3746 16.9375 11.6246 16.0375 12.5371L17.8 14.2996ZM12.5 6.49961C11.125 6.49961 10 7.62461 10 8.99961C10 10.3746 11.125 11.4996 12.5 11.4996C13.875 11.4996 15 10.3746 15 8.99961C15 7.62461 13.875 6.49961 12.5 6.49961ZM22.5 8.99961C22.5 11.7621 21.375 14.2621 19.5625 16.0621L21.3375 17.8371C23.6 15.5746 25 12.4496 25 8.99961C25 5.54961 23.6 2.42461 21.3375 0.162109L19.5625 1.93711C21.375 3.73711 22.5 6.23711 22.5 8.99961ZM5.4375 1.93711L3.6625 0.162109C1.4 2.42461 0 5.54961 0 8.99961C0 12.4496 1.4 15.5746 3.6625 17.8371L5.4375 16.0621C3.625 14.2621 2.5 11.7621 2.5 8.99961C2.5 6.23711 3.625 3.73711 5.4375 1.93711Z"
|
|
9
|
+
fill="#FCFCFC"
|
|
10
|
+
/>
|
|
11
|
+
</Svg>
|
|
12
|
+
);
|
|
13
|
+
};
|
package/src/icons/index.tsx
CHANGED
|
@@ -14,3 +14,8 @@ export * from './Spotlight';
|
|
|
14
14
|
export * from './ScreenShare';
|
|
15
15
|
export * from './Reaction';
|
|
16
16
|
export * from './TopViewBackground';
|
|
17
|
+
export * from './Eye';
|
|
18
|
+
export * from './ShieldBadge';
|
|
19
|
+
export * from './StartStreamIcon';
|
|
20
|
+
export * from './EndStreamIcon';
|
|
21
|
+
export * from './LeaveStreamIcon';
|
package/src/theme/theme.ts
CHANGED
|
@@ -199,6 +199,76 @@ export type Theme = {
|
|
|
199
199
|
participantsIconContainer: ViewStyle;
|
|
200
200
|
participantsCountText: TextStyle;
|
|
201
201
|
};
|
|
202
|
+
hostLivestream: {
|
|
203
|
+
container: ViewStyle;
|
|
204
|
+
};
|
|
205
|
+
viewerLivestream: {
|
|
206
|
+
container: ViewStyle;
|
|
207
|
+
floatingParticipantView: ViewStyle;
|
|
208
|
+
view: ViewStyle;
|
|
209
|
+
};
|
|
210
|
+
livestreamLayout: {
|
|
211
|
+
container: ViewStyle;
|
|
212
|
+
};
|
|
213
|
+
hostLivestreamTopView: {
|
|
214
|
+
container: ViewStyle;
|
|
215
|
+
leftElement: ViewStyle;
|
|
216
|
+
centerElement: ViewStyle;
|
|
217
|
+
rightElement: ViewStyle;
|
|
218
|
+
liveInfo: ViewStyle;
|
|
219
|
+
};
|
|
220
|
+
viewerLivestreamTopView: {
|
|
221
|
+
container: ViewStyle;
|
|
222
|
+
leftElement: ViewStyle;
|
|
223
|
+
centerElement: ViewStyle;
|
|
224
|
+
rightElement: ViewStyle;
|
|
225
|
+
liveInfo: ViewStyle;
|
|
226
|
+
};
|
|
227
|
+
followerCount: {
|
|
228
|
+
container: ViewStyle;
|
|
229
|
+
icon: ViewStyle;
|
|
230
|
+
label: TextStyle;
|
|
231
|
+
};
|
|
232
|
+
durationBadge: {
|
|
233
|
+
container: ViewStyle;
|
|
234
|
+
icon: ViewStyle;
|
|
235
|
+
label: TextStyle;
|
|
236
|
+
};
|
|
237
|
+
liveIndicator: {
|
|
238
|
+
container: ViewStyle;
|
|
239
|
+
label: TextStyle;
|
|
240
|
+
};
|
|
241
|
+
hostLivestreamControls: {
|
|
242
|
+
container: ViewStyle;
|
|
243
|
+
leftElement: ViewStyle;
|
|
244
|
+
rightElement: ViewStyle;
|
|
245
|
+
};
|
|
246
|
+
viewerLivestreamControls: {
|
|
247
|
+
container: ViewStyle;
|
|
248
|
+
leftElement: ViewStyle;
|
|
249
|
+
rightElement: ViewStyle;
|
|
250
|
+
};
|
|
251
|
+
hostStartStreamButton: {
|
|
252
|
+
container: ViewStyle;
|
|
253
|
+
icon: ViewStyle;
|
|
254
|
+
text: TextStyle;
|
|
255
|
+
};
|
|
256
|
+
viewerLeaveStreamButton: {
|
|
257
|
+
container: ViewStyle;
|
|
258
|
+
icon: ViewStyle;
|
|
259
|
+
text: TextStyle;
|
|
260
|
+
};
|
|
261
|
+
livestreamMediaControls: {
|
|
262
|
+
container: ViewStyle;
|
|
263
|
+
};
|
|
264
|
+
livestreamAudioControlButton: {
|
|
265
|
+
container: ViewStyle;
|
|
266
|
+
icon: ViewStyle;
|
|
267
|
+
};
|
|
268
|
+
livestreamVideoControlButton: {
|
|
269
|
+
container: ViewStyle;
|
|
270
|
+
icon: ViewStyle;
|
|
271
|
+
};
|
|
202
272
|
};
|
|
203
273
|
|
|
204
274
|
export const defaultTheme: Theme = {
|
|
@@ -423,4 +493,74 @@ export const defaultTheme: Theme = {
|
|
|
423
493
|
participantsIconContainer: {},
|
|
424
494
|
participantsCountText: {},
|
|
425
495
|
},
|
|
496
|
+
hostLivestream: {
|
|
497
|
+
container: {},
|
|
498
|
+
},
|
|
499
|
+
hostLivestreamTopView: {
|
|
500
|
+
container: {},
|
|
501
|
+
leftElement: {},
|
|
502
|
+
rightElement: {},
|
|
503
|
+
centerElement: {},
|
|
504
|
+
liveInfo: {},
|
|
505
|
+
},
|
|
506
|
+
viewerLivestream: {
|
|
507
|
+
container: {},
|
|
508
|
+
floatingParticipantView: {},
|
|
509
|
+
view: {},
|
|
510
|
+
},
|
|
511
|
+
livestreamLayout: {
|
|
512
|
+
container: {},
|
|
513
|
+
},
|
|
514
|
+
viewerLivestreamTopView: {
|
|
515
|
+
container: {},
|
|
516
|
+
leftElement: {},
|
|
517
|
+
centerElement: {},
|
|
518
|
+
rightElement: {},
|
|
519
|
+
liveInfo: {},
|
|
520
|
+
},
|
|
521
|
+
followerCount: {
|
|
522
|
+
container: {},
|
|
523
|
+
icon: {},
|
|
524
|
+
label: {},
|
|
525
|
+
},
|
|
526
|
+
durationBadge: {
|
|
527
|
+
container: {},
|
|
528
|
+
icon: {},
|
|
529
|
+
label: {},
|
|
530
|
+
},
|
|
531
|
+
liveIndicator: {
|
|
532
|
+
container: {},
|
|
533
|
+
label: {},
|
|
534
|
+
},
|
|
535
|
+
hostLivestreamControls: {
|
|
536
|
+
container: {},
|
|
537
|
+
leftElement: {},
|
|
538
|
+
rightElement: {},
|
|
539
|
+
},
|
|
540
|
+
viewerLivestreamControls: {
|
|
541
|
+
container: {},
|
|
542
|
+
leftElement: {},
|
|
543
|
+
rightElement: {},
|
|
544
|
+
},
|
|
545
|
+
hostStartStreamButton: {
|
|
546
|
+
container: {},
|
|
547
|
+
icon: {},
|
|
548
|
+
text: {},
|
|
549
|
+
},
|
|
550
|
+
viewerLeaveStreamButton: {
|
|
551
|
+
container: {},
|
|
552
|
+
icon: {},
|
|
553
|
+
text: {},
|
|
554
|
+
},
|
|
555
|
+
livestreamMediaControls: {
|
|
556
|
+
container: {},
|
|
557
|
+
},
|
|
558
|
+
livestreamAudioControlButton: {
|
|
559
|
+
container: {},
|
|
560
|
+
icon: {},
|
|
561
|
+
},
|
|
562
|
+
livestreamVideoControlButton: {
|
|
563
|
+
container: {},
|
|
564
|
+
icon: {},
|
|
565
|
+
},
|
|
426
566
|
};
|
package/src/translations/en.json
CHANGED
|
@@ -6,7 +6,12 @@
|
|
|
6
6
|
"Join": "Join",
|
|
7
7
|
"You": "You",
|
|
8
8
|
"Reconnecting...": "Reconnecting...",
|
|
9
|
-
"
|
|
9
|
+
"Loading...": "Loading...",
|
|
10
|
+
"Start Stream": "Start Stream",
|
|
11
|
+
"End Stream": "End Stream",
|
|
12
|
+
"Leave Stream": "Leave Stream",
|
|
13
|
+
"Live": "Live",
|
|
14
|
+
"You are first to Join the call.": "You are first to Join the call.",
|
|
10
15
|
"Participants ({{ numberOfParticipants }})": "Participants ({{ numberOfParticipants }})",
|
|
11
16
|
"{{ userName }} is sharing their screen": "{{ userName }} is sharing their screen",
|
|
12
17
|
"{{ numberOfParticipants }} participant(s) are in the call.": "{{ numberOfParticipants }} participant(s) are in the call.",
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.11';
|