@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,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, SafeAreaView } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { useIncallManager } from '../../../hooks';
|
|
5
|
+
import {
|
|
6
|
+
HostLivestreamTopView as DefaultHostLivestreamTopView,
|
|
7
|
+
HostLivestreamTopViewProps,
|
|
8
|
+
} from '../LivestreamTopView/HostLivestreamTopView';
|
|
9
|
+
import {
|
|
10
|
+
HostLivestreamControls as DefaultHostLivestreamControls,
|
|
11
|
+
HostLivestreamControlsProps,
|
|
12
|
+
} from '../LivestreamControls/HostLivestreamControls';
|
|
13
|
+
import {
|
|
14
|
+
LivestreamLayout as DefaultLivestreamLayout,
|
|
15
|
+
LivestreamLayoutProps,
|
|
16
|
+
} from '../LivestreamLayout';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Props for the HostLivestream component.
|
|
20
|
+
*/
|
|
21
|
+
export type HostLivestreamProps = HostLivestreamTopViewProps &
|
|
22
|
+
HostLivestreamControlsProps & {
|
|
23
|
+
/**
|
|
24
|
+
* Component to customize the top view at the host's live stream.
|
|
25
|
+
*/
|
|
26
|
+
HostLivestreamTopView?: React.ComponentType<HostLivestreamTopViewProps> | null;
|
|
27
|
+
/**
|
|
28
|
+
* Component to customize the live stream video layout.
|
|
29
|
+
*/
|
|
30
|
+
LivestreamLayout?: React.ComponentType<LivestreamLayoutProps> | null;
|
|
31
|
+
/**
|
|
32
|
+
* Component to customize the bottom view controls at the host's live stream.
|
|
33
|
+
*/
|
|
34
|
+
HostLivestreamControls?: React.ComponentType<HostLivestreamControlsProps> | null;
|
|
35
|
+
/**
|
|
36
|
+
* Enable HTTP live streaming
|
|
37
|
+
*/
|
|
38
|
+
hls?: boolean;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The HostLivestream component displays the UI for the Host's live stream.
|
|
43
|
+
*/
|
|
44
|
+
export const HostLivestream = ({
|
|
45
|
+
HostLivestreamTopView = DefaultHostLivestreamTopView,
|
|
46
|
+
HostLivestreamControls = DefaultHostLivestreamControls,
|
|
47
|
+
LivestreamLayout = DefaultLivestreamLayout,
|
|
48
|
+
LiveIndicator,
|
|
49
|
+
FollowerCount,
|
|
50
|
+
DurationBadge,
|
|
51
|
+
HostStartStreamButton,
|
|
52
|
+
LivestreamMediaControls,
|
|
53
|
+
onEndStreamHandler,
|
|
54
|
+
onStartStreamHandler,
|
|
55
|
+
hls = false,
|
|
56
|
+
}: HostLivestreamProps) => {
|
|
57
|
+
const {
|
|
58
|
+
theme: { colors, hostLivestream },
|
|
59
|
+
} = useTheme();
|
|
60
|
+
|
|
61
|
+
// Automatically route audio to speaker devices as relevant for watching videos.
|
|
62
|
+
useIncallManager({ media: 'video', auto: true });
|
|
63
|
+
|
|
64
|
+
const topViewProps: HostLivestreamTopViewProps = {
|
|
65
|
+
LiveIndicator,
|
|
66
|
+
FollowerCount,
|
|
67
|
+
DurationBadge,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<SafeAreaView
|
|
72
|
+
style={[
|
|
73
|
+
styles.container,
|
|
74
|
+
{
|
|
75
|
+
backgroundColor: colors.static_grey,
|
|
76
|
+
},
|
|
77
|
+
hostLivestream.container,
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
{HostLivestreamTopView && <HostLivestreamTopView {...topViewProps} />}
|
|
81
|
+
{LivestreamLayout && <LivestreamLayout />}
|
|
82
|
+
{HostLivestreamControls && (
|
|
83
|
+
<HostLivestreamControls
|
|
84
|
+
onEndStreamHandler={onEndStreamHandler}
|
|
85
|
+
onStartStreamHandler={onStartStreamHandler}
|
|
86
|
+
HostStartStreamButton={HostStartStreamButton}
|
|
87
|
+
LivestreamMediaControls={LivestreamMediaControls}
|
|
88
|
+
hls={hls}
|
|
89
|
+
/>
|
|
90
|
+
)}
|
|
91
|
+
</SafeAreaView>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const styles = StyleSheet.create({
|
|
96
|
+
container: {
|
|
97
|
+
flex: 1,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './HostLivestream';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
HostStartStreamButton as DefaultHostStartStreamButton,
|
|
5
|
+
HostStartStreamButtonProps,
|
|
6
|
+
} from './HostStartStreamButton';
|
|
7
|
+
import {
|
|
8
|
+
LivestreamMediaControls as DefaultLivestreamMediaControls,
|
|
9
|
+
LivestreamMediaControlsProps,
|
|
10
|
+
} from './LivestreamMediaControls';
|
|
11
|
+
import { useTheme } from '../../../contexts';
|
|
12
|
+
import { Z_INDEX } from '../../../constants';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Props for the HostLivestreamControls component.
|
|
16
|
+
*/
|
|
17
|
+
export type HostLivestreamControlsProps = HostStartStreamButtonProps & {
|
|
18
|
+
/**
|
|
19
|
+
* Component to customize the host's start/end live stream button.
|
|
20
|
+
*/
|
|
21
|
+
HostStartStreamButton?: React.ComponentType<HostStartStreamButtonProps> | null;
|
|
22
|
+
/**
|
|
23
|
+
* Component to customize the host's media control(audio/video) buttons.
|
|
24
|
+
*/
|
|
25
|
+
LivestreamMediaControls?: React.ComponentType<LivestreamMediaControlsProps> | null;
|
|
26
|
+
/**
|
|
27
|
+
* Enable HTTP live streaming
|
|
28
|
+
*/
|
|
29
|
+
hls?: boolean;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The HostLivestreamControls component displays the call controls for the live stream at host's end.
|
|
34
|
+
*/
|
|
35
|
+
export const HostLivestreamControls = ({
|
|
36
|
+
HostStartStreamButton = DefaultHostStartStreamButton,
|
|
37
|
+
LivestreamMediaControls = DefaultLivestreamMediaControls,
|
|
38
|
+
onEndStreamHandler,
|
|
39
|
+
onStartStreamHandler,
|
|
40
|
+
hls = false,
|
|
41
|
+
}: HostLivestreamControlsProps) => {
|
|
42
|
+
const {
|
|
43
|
+
theme: { colors, hostLivestreamControls },
|
|
44
|
+
} = useTheme();
|
|
45
|
+
return (
|
|
46
|
+
<View
|
|
47
|
+
style={[
|
|
48
|
+
styles.container,
|
|
49
|
+
{ backgroundColor: colors.static_overlay },
|
|
50
|
+
hostLivestreamControls.container,
|
|
51
|
+
]}
|
|
52
|
+
>
|
|
53
|
+
<View style={[styles.leftElement, hostLivestreamControls.leftElement]}>
|
|
54
|
+
{HostStartStreamButton && (
|
|
55
|
+
<HostStartStreamButton
|
|
56
|
+
onEndStreamHandler={onEndStreamHandler}
|
|
57
|
+
onStartStreamHandler={onStartStreamHandler}
|
|
58
|
+
hls={hls}
|
|
59
|
+
/>
|
|
60
|
+
)}
|
|
61
|
+
</View>
|
|
62
|
+
<View style={[styles.rightElement, hostLivestreamControls.rightElement]}>
|
|
63
|
+
{LivestreamMediaControls && <LivestreamMediaControls />}
|
|
64
|
+
</View>
|
|
65
|
+
</View>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const styles = StyleSheet.create({
|
|
70
|
+
container: {
|
|
71
|
+
position: 'absolute',
|
|
72
|
+
bottom: 0,
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
paddingVertical: 16,
|
|
76
|
+
paddingHorizontal: 8,
|
|
77
|
+
zIndex: Z_INDEX.IN_FRONT,
|
|
78
|
+
},
|
|
79
|
+
leftElement: {
|
|
80
|
+
flex: 1,
|
|
81
|
+
alignItems: 'flex-start',
|
|
82
|
+
},
|
|
83
|
+
rightElement: {
|
|
84
|
+
flex: 1,
|
|
85
|
+
alignItems: 'flex-end',
|
|
86
|
+
},
|
|
87
|
+
});
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useCall,
|
|
3
|
+
useCallStateHooks,
|
|
4
|
+
useI18n,
|
|
5
|
+
} from '@stream-io/video-react-bindings';
|
|
6
|
+
import React, { useState } from 'react';
|
|
7
|
+
import {
|
|
8
|
+
ActivityIndicator,
|
|
9
|
+
Pressable,
|
|
10
|
+
StyleSheet,
|
|
11
|
+
Text,
|
|
12
|
+
View,
|
|
13
|
+
} from 'react-native';
|
|
14
|
+
import { useTheme } from '../../../contexts';
|
|
15
|
+
import { EndBroadcastIcon, StartStreamIcon } from '../../../icons';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Props for the HostStartStreamButton component.
|
|
19
|
+
*/
|
|
20
|
+
export type HostStartStreamButtonProps = {
|
|
21
|
+
/**
|
|
22
|
+
* Handler to be called when the Start Stream button is pressed.
|
|
23
|
+
* @returns void
|
|
24
|
+
*/
|
|
25
|
+
onStartStreamHandler?: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Handler to be called when the End Stream button is pressed.
|
|
28
|
+
* @returns void
|
|
29
|
+
*/
|
|
30
|
+
onEndStreamHandler?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Enable HTTP live streaming
|
|
33
|
+
*/
|
|
34
|
+
hls?: boolean;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* The HostStartStreamButton component displays and controls the start and end of the host's live stream.
|
|
39
|
+
*/
|
|
40
|
+
export const HostStartStreamButton = ({
|
|
41
|
+
onEndStreamHandler,
|
|
42
|
+
onStartStreamHandler,
|
|
43
|
+
hls,
|
|
44
|
+
}: HostStartStreamButtonProps) => {
|
|
45
|
+
const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
|
|
46
|
+
const { useIsCallLive, useIsCallBroadcastingInProgress } =
|
|
47
|
+
useCallStateHooks();
|
|
48
|
+
const {
|
|
49
|
+
theme: {
|
|
50
|
+
colors,
|
|
51
|
+
variants: { iconSizes },
|
|
52
|
+
typefaces,
|
|
53
|
+
hostStartStreamButton,
|
|
54
|
+
},
|
|
55
|
+
} = useTheme();
|
|
56
|
+
|
|
57
|
+
const call = useCall();
|
|
58
|
+
const isCallLive = useIsCallLive();
|
|
59
|
+
const isCallBroadcasting = useIsCallBroadcastingInProgress();
|
|
60
|
+
const { t } = useI18n();
|
|
61
|
+
|
|
62
|
+
const liveOrBroadcasting = isCallLive || isCallBroadcasting;
|
|
63
|
+
|
|
64
|
+
const onStartStreamButtonPress = async () => {
|
|
65
|
+
if (onStartStreamHandler) {
|
|
66
|
+
onStartStreamHandler();
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
try {
|
|
70
|
+
setIsAwaitingResponse(true);
|
|
71
|
+
await call?.goLive();
|
|
72
|
+
if (hls) {
|
|
73
|
+
await call?.startHLS();
|
|
74
|
+
}
|
|
75
|
+
setIsAwaitingResponse(false);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
console.error('Error starting livestream', error);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
const onEndStreamButtonPress = async () => {
|
|
82
|
+
if (onEndStreamHandler) {
|
|
83
|
+
onEndStreamHandler();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
try {
|
|
87
|
+
setIsAwaitingResponse(true);
|
|
88
|
+
if (hls) {
|
|
89
|
+
await call?.stopHLS();
|
|
90
|
+
} else {
|
|
91
|
+
await call?.stopLive();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
setIsAwaitingResponse(false);
|
|
95
|
+
} catch (error) {
|
|
96
|
+
console.error('Error stopping livestream', error);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Pressable
|
|
102
|
+
disabled={isAwaitingResponse}
|
|
103
|
+
style={[
|
|
104
|
+
styles.container,
|
|
105
|
+
{
|
|
106
|
+
backgroundColor: isAwaitingResponse
|
|
107
|
+
? colors.dark_gray
|
|
108
|
+
: liveOrBroadcasting
|
|
109
|
+
? colors.error
|
|
110
|
+
: colors.primary,
|
|
111
|
+
},
|
|
112
|
+
hostStartStreamButton.container,
|
|
113
|
+
]}
|
|
114
|
+
onPress={
|
|
115
|
+
liveOrBroadcasting ? onEndStreamButtonPress : onStartStreamButtonPress
|
|
116
|
+
}
|
|
117
|
+
>
|
|
118
|
+
<View
|
|
119
|
+
style={[
|
|
120
|
+
styles.icon,
|
|
121
|
+
{ height: iconSizes.xs, width: iconSizes.xs },
|
|
122
|
+
hostStartStreamButton.icon,
|
|
123
|
+
]}
|
|
124
|
+
>
|
|
125
|
+
{isAwaitingResponse ? (
|
|
126
|
+
<ActivityIndicator />
|
|
127
|
+
) : liveOrBroadcasting ? (
|
|
128
|
+
<EndBroadcastIcon />
|
|
129
|
+
) : (
|
|
130
|
+
<StartStreamIcon />
|
|
131
|
+
)}
|
|
132
|
+
</View>
|
|
133
|
+
<Text
|
|
134
|
+
style={[
|
|
135
|
+
styles.text,
|
|
136
|
+
typefaces.subtitleBold,
|
|
137
|
+
{ color: colors.static_white },
|
|
138
|
+
hostStartStreamButton.text,
|
|
139
|
+
]}
|
|
140
|
+
>
|
|
141
|
+
{isAwaitingResponse
|
|
142
|
+
? t('Loading...')
|
|
143
|
+
: liveOrBroadcasting
|
|
144
|
+
? t('Stop Livestream')
|
|
145
|
+
: t('Start Livestream')}
|
|
146
|
+
</Text>
|
|
147
|
+
</Pressable>
|
|
148
|
+
);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const styles = StyleSheet.create({
|
|
152
|
+
container: {
|
|
153
|
+
flexDirection: 'row',
|
|
154
|
+
alignItems: 'center',
|
|
155
|
+
padding: 8,
|
|
156
|
+
borderRadius: 4,
|
|
157
|
+
},
|
|
158
|
+
icon: {},
|
|
159
|
+
text: {
|
|
160
|
+
marginLeft: 8,
|
|
161
|
+
includeFontPadding: false,
|
|
162
|
+
},
|
|
163
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
5
|
+
import { Mic, MicOff } from '../../../icons';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The LivestreamAudioControlButton controls the audio stream publish/unpublish while in the livestream for the host.
|
|
9
|
+
*/
|
|
10
|
+
export const LivestreamAudioControlButton = () => {
|
|
11
|
+
const call = useCall();
|
|
12
|
+
const { useMicrophoneState } = useCallStateHooks();
|
|
13
|
+
const { status } = useMicrophoneState();
|
|
14
|
+
const {
|
|
15
|
+
theme: {
|
|
16
|
+
colors,
|
|
17
|
+
variants: { iconSizes, buttonSizes },
|
|
18
|
+
livestreamAudioControlButton,
|
|
19
|
+
},
|
|
20
|
+
} = useTheme();
|
|
21
|
+
|
|
22
|
+
const onPress = async () => {
|
|
23
|
+
await call?.microphone.toggle();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Pressable
|
|
28
|
+
onPress={onPress}
|
|
29
|
+
style={[
|
|
30
|
+
styles.container,
|
|
31
|
+
{
|
|
32
|
+
backgroundColor: colors.dark_gray,
|
|
33
|
+
height: buttonSizes.xs,
|
|
34
|
+
width: buttonSizes.xs,
|
|
35
|
+
},
|
|
36
|
+
livestreamAudioControlButton.container,
|
|
37
|
+
]}
|
|
38
|
+
>
|
|
39
|
+
{status === 'enabled' ? (
|
|
40
|
+
<View
|
|
41
|
+
style={[
|
|
42
|
+
styles.icon,
|
|
43
|
+
{
|
|
44
|
+
height: iconSizes.sm,
|
|
45
|
+
width: iconSizes.sm,
|
|
46
|
+
},
|
|
47
|
+
livestreamAudioControlButton.icon,
|
|
48
|
+
]}
|
|
49
|
+
>
|
|
50
|
+
<Mic color={colors.static_white} />
|
|
51
|
+
</View>
|
|
52
|
+
) : (
|
|
53
|
+
<View
|
|
54
|
+
style={[
|
|
55
|
+
styles.icon,
|
|
56
|
+
{
|
|
57
|
+
height: iconSizes.sm,
|
|
58
|
+
width: iconSizes.sm,
|
|
59
|
+
},
|
|
60
|
+
livestreamAudioControlButton.icon,
|
|
61
|
+
]}
|
|
62
|
+
>
|
|
63
|
+
<MicOff color={colors.static_white} />
|
|
64
|
+
</View>
|
|
65
|
+
)}
|
|
66
|
+
</Pressable>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
marginHorizontal: 4,
|
|
75
|
+
borderRadius: 4,
|
|
76
|
+
},
|
|
77
|
+
icon: {},
|
|
78
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { LivestreamAudioControlButton } from './LivestreamAudioControlButton';
|
|
5
|
+
import { LivestreamVideoControlButton } from './LivestreamVideoControlButton';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the LivestreamMediaControls component.
|
|
9
|
+
*/
|
|
10
|
+
export type LivestreamMediaControlsProps = {};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The LivestreamMediaControls component controls the media publish/unpublish for the host's live stream.
|
|
14
|
+
*/
|
|
15
|
+
export const LivestreamMediaControls = ({}: LivestreamMediaControlsProps) => {
|
|
16
|
+
const {
|
|
17
|
+
theme: { livestreamMediaControls },
|
|
18
|
+
} = useTheme();
|
|
19
|
+
return (
|
|
20
|
+
<View style={[styles.container, livestreamMediaControls.container]}>
|
|
21
|
+
<LivestreamAudioControlButton />
|
|
22
|
+
<LivestreamVideoControlButton />
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
flexDirection: 'row',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { Pressable, StyleSheet, View } from 'react-native';
|
|
5
|
+
import { Video, VideoSlash } from '../../../icons';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The LivestreamVideoControlButton controls the video stream publish/unpublish while in the livestream for the host.
|
|
9
|
+
*/
|
|
10
|
+
export const LivestreamVideoControlButton = () => {
|
|
11
|
+
const call = useCall();
|
|
12
|
+
const { useCameraState } = useCallStateHooks();
|
|
13
|
+
const { status } = useCameraState();
|
|
14
|
+
const {
|
|
15
|
+
theme: {
|
|
16
|
+
colors,
|
|
17
|
+
variants: { iconSizes, buttonSizes },
|
|
18
|
+
livestreamVideoControlButton,
|
|
19
|
+
},
|
|
20
|
+
} = useTheme();
|
|
21
|
+
|
|
22
|
+
const onPress = async () => {
|
|
23
|
+
await call?.camera.toggle();
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Pressable
|
|
28
|
+
onPress={onPress}
|
|
29
|
+
style={[
|
|
30
|
+
styles.container,
|
|
31
|
+
{
|
|
32
|
+
backgroundColor: colors.dark_gray,
|
|
33
|
+
height: buttonSizes.xs,
|
|
34
|
+
width: buttonSizes.xs,
|
|
35
|
+
},
|
|
36
|
+
livestreamVideoControlButton.container,
|
|
37
|
+
]}
|
|
38
|
+
>
|
|
39
|
+
{status === 'enabled' ? (
|
|
40
|
+
<View
|
|
41
|
+
style={[
|
|
42
|
+
styles.icon,
|
|
43
|
+
{
|
|
44
|
+
height: iconSizes.sm,
|
|
45
|
+
width: iconSizes.sm,
|
|
46
|
+
},
|
|
47
|
+
livestreamVideoControlButton.icon,
|
|
48
|
+
]}
|
|
49
|
+
>
|
|
50
|
+
<Video color={colors.static_white} />
|
|
51
|
+
</View>
|
|
52
|
+
) : (
|
|
53
|
+
<View
|
|
54
|
+
style={[
|
|
55
|
+
styles.icon,
|
|
56
|
+
{
|
|
57
|
+
height: iconSizes.sm,
|
|
58
|
+
width: iconSizes.sm,
|
|
59
|
+
},
|
|
60
|
+
livestreamVideoControlButton.icon,
|
|
61
|
+
]}
|
|
62
|
+
>
|
|
63
|
+
<VideoSlash color={colors.static_white} />
|
|
64
|
+
</View>
|
|
65
|
+
)}
|
|
66
|
+
</Pressable>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
container: {
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
marginHorizontal: 4,
|
|
75
|
+
borderRadius: 4,
|
|
76
|
+
},
|
|
77
|
+
icon: {},
|
|
78
|
+
});
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActivityIndicator,
|
|
4
|
+
Pressable,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
Text,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import { useTheme } from '../../../contexts';
|
|
10
|
+
import { LeaveStreamIcon } from '../../../icons';
|
|
11
|
+
import { useCall, useI18n } from '@stream-io/video-react-bindings';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Props for the ViewerLeaveStreamButton component.
|
|
15
|
+
*/
|
|
16
|
+
export type ViewerLeaveStreamButtonProps = {
|
|
17
|
+
/**
|
|
18
|
+
* Handler to be called when the viewer's leave stream button is called.
|
|
19
|
+
* @returns void
|
|
20
|
+
*/
|
|
21
|
+
onLeaveStreamHandler?: () => void;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The ViewerLeaveStreamButton component displays and controls the leave stream logic of the viewer's live stream.
|
|
26
|
+
*/
|
|
27
|
+
export const ViewerLeaveStreamButton = ({
|
|
28
|
+
onLeaveStreamHandler,
|
|
29
|
+
}: ViewerLeaveStreamButtonProps) => {
|
|
30
|
+
const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
|
|
31
|
+
const call = useCall();
|
|
32
|
+
const { t } = useI18n();
|
|
33
|
+
const {
|
|
34
|
+
theme: {
|
|
35
|
+
colors,
|
|
36
|
+
variants: { iconSizes },
|
|
37
|
+
typefaces,
|
|
38
|
+
viewerLeaveStreamButton,
|
|
39
|
+
},
|
|
40
|
+
} = useTheme();
|
|
41
|
+
|
|
42
|
+
const onLeaveStreamButtonPress = async () => {
|
|
43
|
+
if (onLeaveStreamHandler) {
|
|
44
|
+
onLeaveStreamHandler();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
try {
|
|
48
|
+
setIsAwaitingResponse(true);
|
|
49
|
+
await call?.leave();
|
|
50
|
+
setIsAwaitingResponse(false);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error('Error stopping livestream', error);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return (
|
|
57
|
+
<Pressable
|
|
58
|
+
style={[
|
|
59
|
+
styles.container,
|
|
60
|
+
{
|
|
61
|
+
backgroundColor: colors.dark_gray,
|
|
62
|
+
},
|
|
63
|
+
viewerLeaveStreamButton.container,
|
|
64
|
+
]}
|
|
65
|
+
onPress={onLeaveStreamButtonPress}
|
|
66
|
+
>
|
|
67
|
+
<View
|
|
68
|
+
style={[
|
|
69
|
+
styles.icon,
|
|
70
|
+
{ height: iconSizes.xs, width: iconSizes.xs },
|
|
71
|
+
viewerLeaveStreamButton.icon,
|
|
72
|
+
]}
|
|
73
|
+
>
|
|
74
|
+
{isAwaitingResponse ? <ActivityIndicator /> : <LeaveStreamIcon />}
|
|
75
|
+
</View>
|
|
76
|
+
<Text
|
|
77
|
+
style={[
|
|
78
|
+
styles.text,
|
|
79
|
+
typefaces.subtitleBold,
|
|
80
|
+
{ color: colors.static_white },
|
|
81
|
+
viewerLeaveStreamButton.text,
|
|
82
|
+
]}
|
|
83
|
+
>
|
|
84
|
+
{isAwaitingResponse ? t('Loading...') : t('Leave Stream')}
|
|
85
|
+
</Text>
|
|
86
|
+
</Pressable>
|
|
87
|
+
);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const styles = StyleSheet.create({
|
|
91
|
+
container: {
|
|
92
|
+
flexDirection: 'row',
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
padding: 8,
|
|
95
|
+
borderRadius: 4,
|
|
96
|
+
},
|
|
97
|
+
icon: {},
|
|
98
|
+
text: {
|
|
99
|
+
marginLeft: 8,
|
|
100
|
+
includeFontPadding: false,
|
|
101
|
+
},
|
|
102
|
+
});
|