@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 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","useTheme","LivestreamAudioControlButton","LivestreamVideoControlButton","LivestreamMediaControls","_ref","theme","livestreamMediaControls","createElement","style","styles","container","create","flexDirection","alignItems"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/LivestreamMediaControls.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,4BAA4B,QAAQ,gCAAgC;AAC7E,SAASC,4BAA4B,QAAQ,gCAAgC;;AAE7E;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGC,IAAA,IAAsC;EAAA,IAArC,CAA+B,CAAC,GAAAA,IAAA;EACtE,MAAM;IACJC,KAAK,EAAE;MAAEC;IAAwB;EACnC,CAAC,GAAGN,QAAQ,CAAC,CAAC;EACd,oBACEH,KAAA,CAAAU,aAAA,CAACR,IAAI;IAACS,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAEJ,uBAAuB,CAACI,SAAS;EAAE,gBACjEb,KAAA,CAAAU,aAAA,CAACN,4BAA4B,MAAE,CAAC,eAChCJ,KAAA,CAAAU,aAAA,CAACL,4BAA4B,MAAE,CAC3B,CAAC;AAEX,CAAC;AAED,MAAMO,MAAM,GAAGX,UAAU,CAACa,MAAM,CAAC;EAC/BD,SAAS,EAAE;IACTE,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 {
|
|
13
|
+
useCameraState
|
|
14
|
+
} = useCallStateHooks();
|
|
15
|
+
const {
|
|
16
|
+
status
|
|
17
|
+
} = useCameraState();
|
|
18
|
+
const {
|
|
19
|
+
theme: {
|
|
20
|
+
colors,
|
|
21
|
+
variants: {
|
|
22
|
+
iconSizes,
|
|
23
|
+
buttonSizes
|
|
24
|
+
},
|
|
25
|
+
livestreamVideoControlButton
|
|
26
|
+
}
|
|
27
|
+
} = useTheme();
|
|
28
|
+
const onPress = async () => {
|
|
29
|
+
await (call === null || call === void 0 ? void 0 : call.camera.toggle());
|
|
30
|
+
};
|
|
31
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
32
|
+
onPress: onPress,
|
|
33
|
+
style: [styles.container, {
|
|
34
|
+
backgroundColor: colors.dark_gray,
|
|
35
|
+
height: buttonSizes.xs,
|
|
36
|
+
width: buttonSizes.xs
|
|
37
|
+
}, livestreamVideoControlButton.container]
|
|
38
|
+
}, status === 'enabled' ? /*#__PURE__*/React.createElement(View, {
|
|
39
|
+
style: [styles.icon, {
|
|
40
|
+
height: iconSizes.sm,
|
|
41
|
+
width: iconSizes.sm
|
|
42
|
+
}, livestreamVideoControlButton.icon]
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Video, {
|
|
44
|
+
color: colors.static_white
|
|
45
|
+
})) : /*#__PURE__*/React.createElement(View, {
|
|
46
|
+
style: [styles.icon, {
|
|
47
|
+
height: iconSizes.sm,
|
|
48
|
+
width: iconSizes.sm
|
|
49
|
+
}, livestreamVideoControlButton.icon]
|
|
50
|
+
}, /*#__PURE__*/React.createElement(VideoSlash, {
|
|
51
|
+
color: colors.static_white
|
|
52
|
+
})));
|
|
53
|
+
};
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
justifyContent: 'center',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
marginHorizontal: 4,
|
|
59
|
+
borderRadius: 4
|
|
60
|
+
},
|
|
61
|
+
icon: {}
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=LivestreamVideoControlButton.js.map
|
package/dist/module/components/Livestream/LivestreamControls/LivestreamVideoControlButton.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCall","useCallStateHooks","React","useTheme","Pressable","StyleSheet","View","Video","VideoSlash","LivestreamVideoControlButton","call","useCameraState","status","theme","colors","variants","iconSizes","buttonSizes","livestreamVideoControlButton","onPress","camera","toggle","createElement","style","styles","container","backgroundColor","dark_gray","height","xs","width","icon","sm","color","static_white","create","justifyContent","alignItems","marginHorizontal","borderRadius"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/LivestreamVideoControlButton.tsx"],"mappings":"AAAA,SAASA,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC1D,SAASC,KAAK,EAAEC,UAAU,QAAQ,gBAAgB;;AAElD;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAGA,CAAA,KAAM;EAChD,MAAMC,IAAI,GAAGV,OAAO,CAAC,CAAC;EACtB,MAAM;IAAEW;EAAe,CAAC,GAAGV,iBAAiB,CAAC,CAAC;EAC9C,MAAM;IAAEW;EAAO,CAAC,GAAGD,cAAc,CAAC,CAAC;EACnC,MAAM;IACJE,KAA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B,UAAU,CAAC8B,MAAM,CAAC;EAC/BV,SAAS,EAAE;IACTW,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE,QAAQ;IACpBC,gBAAgB,EAAE,CAAC;IACnBC,YAAY,EAAE;EAChB,CAAC;EACDR,IAAI,EAAE,CAAC;AACT,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { ActivityIndicator, Pressable, StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { LeaveStreamIcon } from '../../../icons';
|
|
5
|
+
import { useCall, useI18n } from '@stream-io/video-react-bindings';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the ViewerLeaveStreamButton component.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The ViewerLeaveStreamButton component displays and controls the leave stream logic of the viewer's live stream.
|
|
13
|
+
*/
|
|
14
|
+
export const ViewerLeaveStreamButton = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
onLeaveStreamHandler
|
|
17
|
+
} = _ref;
|
|
18
|
+
const [isAwaitingResponse, setIsAwaitingResponse] = useState(false);
|
|
19
|
+
const call = useCall();
|
|
20
|
+
const {
|
|
21
|
+
t
|
|
22
|
+
} = useI18n();
|
|
23
|
+
const {
|
|
24
|
+
theme: {
|
|
25
|
+
colors,
|
|
26
|
+
variants: {
|
|
27
|
+
iconSizes
|
|
28
|
+
},
|
|
29
|
+
typefaces,
|
|
30
|
+
viewerLeaveStreamButton
|
|
31
|
+
}
|
|
32
|
+
} = useTheme();
|
|
33
|
+
const onLeaveStreamButtonPress = async () => {
|
|
34
|
+
if (onLeaveStreamHandler) {
|
|
35
|
+
onLeaveStreamHandler();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
setIsAwaitingResponse(true);
|
|
40
|
+
await (call === null || call === void 0 ? void 0 : call.leave());
|
|
41
|
+
setIsAwaitingResponse(false);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error('Error stopping livestream', error);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
47
|
+
style: [styles.container, {
|
|
48
|
+
backgroundColor: colors.dark_gray
|
|
49
|
+
}, viewerLeaveStreamButton.container],
|
|
50
|
+
onPress: onLeaveStreamButtonPress
|
|
51
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: [styles.icon, {
|
|
53
|
+
height: iconSizes.xs,
|
|
54
|
+
width: iconSizes.xs
|
|
55
|
+
}, viewerLeaveStreamButton.icon]
|
|
56
|
+
}, isAwaitingResponse ? /*#__PURE__*/React.createElement(ActivityIndicator, null) : /*#__PURE__*/React.createElement(LeaveStreamIcon, null)), /*#__PURE__*/React.createElement(Text, {
|
|
57
|
+
style: [styles.text, typefaces.subtitleBold, {
|
|
58
|
+
color: colors.static_white
|
|
59
|
+
}, viewerLeaveStreamButton.text]
|
|
60
|
+
}, isAwaitingResponse ? t('Loading...') : t('Leave Stream')));
|
|
61
|
+
};
|
|
62
|
+
const styles = StyleSheet.create({
|
|
63
|
+
container: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
padding: 8,
|
|
67
|
+
borderRadius: 4
|
|
68
|
+
},
|
|
69
|
+
icon: {},
|
|
70
|
+
text: {
|
|
71
|
+
marginLeft: 8,
|
|
72
|
+
includeFontPadding: false
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=ViewerLeaveStreamButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","ActivityIndicator","Pressable","StyleSheet","Text","View","useTheme","LeaveStreamIcon","useCall","useI18n","ViewerLeaveStreamButton","_ref","onLeaveStreamHandler","isAwaitingResponse","setIsAwaitingResponse","call","t","theme","colors","variants","iconSizes","typefaces","viewerLeaveStreamButton","onLeaveStreamButtonPress","leave","error","console","createElement","style","styles","container","backgroundColor","dark_gray","onPress","icon","height","xs","width","text","subtitleBold","color","static_white","create","flexDirection","alignItems","padding","borderRadius","marginLeft","includeFontPadding"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/ViewerLeaveStreamButton.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SACEC,iBAAiB,EACjBC,SAAS,EACTC,UAAU,EACVC,IAAI,EACJC,IAAI,QACC,cAAc;AACrB,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,OAAO,EAAEC,OAAO,QAAQ,iCAAiC;;AAElE;AACA;AACA;;AASA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAAGC,IAAA,IAEH;EAAA,IAFI;IACtCC;EAC4B,CAAC,GAAAD,IAAA;EAC7B,MAAM,CAACE,kBAAkB,EAAEC,qBAAqB,CAAC,GAAGd,QAAQ,CAAC,KAAK,CAAC;EACnE,MAAMe,IAAI,GAAGP,OAAO,CAAC,CAAC;EACtB,MAAM;IAAEQ;EAAE,CAAC,GAAGP,OAAO,CAAC,CAAC;EACvB,MAAM;IACJQ,KAAK,EAAE;MACLC,MAAM;MACNC,QAAQ,EAAE;QAAEC;MAAU,CAAC;MACvBC,SAAS;MACTC;IACF;EACF,CAAC,GAAGhB,QAAQ,CAAC,CAAC;EAEd,MAAMiB,wBAAwB,GAAG,MAAAA,CAAA,KAAY;IAC3C,IAAIX,oBAAoB,EAAE;MACxBA,oBAAoB,CAAC,CAAC;MACtB;IACF;IACA,IAAI;MACFE,qBAAqB,CAAC,IAAI,CAAC;MAC3B,OAAMC,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAES,KAAK,CAAC,CAAC;MACnBV,qBAAqB,CAAC,KAAK,CAAC;IAC9B,CAAC,CAAC,OAAOW,KAAK,EAAE;MACdC,OAAO,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+1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { ViewerLeaveStreamButton as DefaultViewerLeaveStreamButton } from './ViewerLeaveStreamButton';
|
|
4
|
+
import { useTheme } from '../../../contexts';
|
|
5
|
+
import { Z_INDEX } from '../../../constants';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the ViewerLivestreamControls component.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The ViewerLivestreamControls component displays the call controls for the live stream at viewer's end.
|
|
13
|
+
*/
|
|
14
|
+
export const ViewerLivestreamControls = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
ViewerLeaveStreamButton = DefaultViewerLeaveStreamButton,
|
|
17
|
+
onLeaveStreamHandler
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
theme: {
|
|
21
|
+
colors,
|
|
22
|
+
viewerLivestreamControls
|
|
23
|
+
}
|
|
24
|
+
} = useTheme();
|
|
25
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: [styles.container, {
|
|
27
|
+
backgroundColor: colors.static_overlay
|
|
28
|
+
}, viewerLivestreamControls.container]
|
|
29
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
style: [styles.leftElement, viewerLivestreamControls.leftElement]
|
|
31
|
+
}, ViewerLeaveStreamButton && /*#__PURE__*/React.createElement(ViewerLeaveStreamButton, {
|
|
32
|
+
onLeaveStreamHandler: onLeaveStreamHandler
|
|
33
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
34
|
+
style: [styles.rightElement, viewerLivestreamControls.rightElement]
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
container: {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
bottom: 0,
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
alignItems: 'center',
|
|
43
|
+
paddingVertical: 16,
|
|
44
|
+
paddingHorizontal: 8,
|
|
45
|
+
zIndex: Z_INDEX.IN_FRONT
|
|
46
|
+
},
|
|
47
|
+
content: {},
|
|
48
|
+
leftElement: {
|
|
49
|
+
flex: 1,
|
|
50
|
+
alignItems: 'flex-start'
|
|
51
|
+
},
|
|
52
|
+
rightElement: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
alignItems: 'flex-end'
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=ViewerLivestreamControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","ViewerLeaveStreamButton","DefaultViewerLeaveStreamButton","useTheme","Z_INDEX","ViewerLivestreamControls","_ref","onLeaveStreamHandler","theme","colors","viewerLivestreamControls","createElement","style","styles","container","backgroundColor","static_overlay","leftElement","rightElement","create","position","bottom","flexDirection","alignItems","paddingVertical","paddingHorizontal","zIndex","IN_FRONT","content","flex"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/ViewerLivestreamControls.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SACEC,uBAAuB,IAAIC,8BAA8B,QAEpD,2BAA2B;AAClC,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;;AAQA;AACA;AACA;AACA,OAAO,MAAMC,wBAAwB,GAAGC,IAAA,IAGH;EAAA,IAHI;IACvCL,uBAAuB,GAAGC,8BAA8B;IACxDK;EAC6B,CAAC,GAAAD,IAAA;EAC9B,MAAM;IACJE,KAAK,EAAE;MAAEC,MAAM;MAAEC;IAAyB;EAC5C,CAAC,GAAGP,QAAQ,CAAC,CAAC;EAEd,oBACEL,KAAA,CAAAa,aAAA,CAACX,IAAI;IACHY,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MACEC,eAAe,EAAEN,MAAM,CAACO;IAC1B,CAAC,EACDN,wBAAwB,CAACI,SAAS;EAClC,gBAEFhB,KAAA,CAAAa,aAAA,CAACX,IAAI;IAACY,KAAK,EAAE,CAACC,MAAM,CAACI,WAAW,EAAEP,wBAAwB,CAACO,WAAW;EAAE,GACrEhB,uBAAuB,iBACtBH,KAAA,CAAAa,aAAA,CAACV,uBAAuB;IACtBM,oBAAoB,EAAEA;EAAqB,CAC5C,CAEC,CAAC,eACPT,KAAA,CAAAa,aAAA,CAACX,IAAI;IACHY,KAAK,EAAE,CAACC,MAAM,CAACK,YAAY,EAAER,wBAAwB,CAACQ,YAAY;EAAE,CACrE,CACG,CAAC;AAEX,CAAC;AAED,MAAML,MAAM,GAAGd,UAAU,CAACoB,MAAM,CAAC;EAC/BL,SAAS,EAAE;IACTM,QAAQ,EAAE,UAAU;IACpBC,MAAM,EAAE,CAAC;IACTC,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE,CAAC;IACpBC,MAAM,EAAEtB,OAAO,CAACuB;EAClB,CAAC;EACDC,OAAO,EAAE,CAAC,CAAC;EACXX,WAAW,EAAE;IACXY,IAAI,EAAE,CAAC;IACPN,UAAU,EAAE;EACd,CAAC;EACDL,YAAY,EAAE;IACZW,IAAI,EAAE,CAAC;IACPN,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamControls/index.ts"],"mappings":"AAAA,cAAc,0BAA0B;AACxC,cAAc,2BAA2B;AACzC,cAAc,yBAAyB;AACvC,cAAc,gCAAgC;AAC9C,cAAc,gCAAgC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SfuModels } from '@stream-io/video-client';
|
|
3
|
+
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
4
|
+
import { StyleSheet, View } from 'react-native';
|
|
5
|
+
import { usePaginatedLayoutSortPreset } from '../../../hooks/usePaginatedLayoutSortPreset';
|
|
6
|
+
import { useTheme } from '../../../contexts';
|
|
7
|
+
import { VideoRenderer as DefaultVideoRenderer } from '../../Participant';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Props for the LivestreamLayout component.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
const hasScreenShare = p => p === null || p === void 0 ? void 0 : p.publishedTracks.includes(SfuModels.TrackType.SCREEN_SHARE);
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The LivestreamLayout component presents the live stream video layout.
|
|
17
|
+
*/
|
|
18
|
+
export const LivestreamLayout = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
landscape,
|
|
21
|
+
VideoRenderer = DefaultVideoRenderer
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
useParticipants,
|
|
25
|
+
useHasOngoingScreenShare
|
|
26
|
+
} = useCallStateHooks();
|
|
27
|
+
const call = useCall();
|
|
28
|
+
const {
|
|
29
|
+
theme: {
|
|
30
|
+
colors,
|
|
31
|
+
livestreamLayout
|
|
32
|
+
}
|
|
33
|
+
} = useTheme();
|
|
34
|
+
const [currentSpeaker, ...otherParticipants] = useParticipants();
|
|
35
|
+
const hasOngoingScreenShare = useHasOngoingScreenShare();
|
|
36
|
+
const presenter = hasOngoingScreenShare ? hasScreenShare(currentSpeaker) && currentSpeaker : otherParticipants.find(hasScreenShare);
|
|
37
|
+
usePaginatedLayoutSortPreset(call);
|
|
38
|
+
const landScapeStyles = {
|
|
39
|
+
flexDirection: landscape ? 'row' : 'column'
|
|
40
|
+
};
|
|
41
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
42
|
+
style: [styles.container, landScapeStyles, {
|
|
43
|
+
backgroundColor: colors.dark_gray
|
|
44
|
+
}, livestreamLayout.container]
|
|
45
|
+
}, VideoRenderer && hasOngoingScreenShare && presenter && /*#__PURE__*/React.createElement(VideoRenderer, {
|
|
46
|
+
trackType: "screenShareTrack",
|
|
47
|
+
participant: presenter
|
|
48
|
+
}), VideoRenderer && !hasOngoingScreenShare && currentSpeaker && /*#__PURE__*/React.createElement(VideoRenderer, {
|
|
49
|
+
participant: currentSpeaker,
|
|
50
|
+
trackType: "videoTrack"
|
|
51
|
+
}));
|
|
52
|
+
};
|
|
53
|
+
const styles = StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
flex: 1
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
//# sourceMappingURL=LivestreamLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","SfuModels","useCall","useCallStateHooks","StyleSheet","View","usePaginatedLayoutSortPreset","useTheme","VideoRenderer","DefaultVideoRenderer","hasScreenShare","p","publishedTracks","includes","TrackType","SCREEN_SHARE","LivestreamLayout","_ref","landscape","useParticipants","useHasOngoingScreenShare","call","theme","colors","livestreamLayout","currentSpeaker","otherParticipants","hasOngoingScreenShare","presenter","find","landScapeStyles","flexDirection","createElement","style","styles","container","backgroundColor","dark_gray","trackType","participant","create","flex"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamLayout/LivestreamLayout.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,QAAgC,yBAAyB;AAC3E,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;AAC5E,SAASC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAC1D,SAASC,4BAA4B,QAAQ,6CAA6C;AAC1F,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SACEC,aAAa,IAAIC,oBAAoB,QAEhC,mBAAmB;;AAE1B;AACA;AACA;;AAaA,MAAMC,cAAc,GAAIC,CAA0B,IAChDA,CAAC,aAADA,CAAC,uBAADA,CAAC,CAAEC,eAAe,CAACC,QAAQ,CAACZ,SAAS,CAACa,SAAS,CA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,CAElE,CAAC;AAEX,CAAC;AAED,MAAMJ,MAAM,GAAG9B,UAAU,CAACoC,MAAM,CAAC;EAC/BL,SAAS,EAAE;IACTM,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamLayout/index.ts"],"mappings":"AAAA,cAAc,oBAAoB"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { ShieldBadge } from '../../../icons';
|
|
5
|
+
import { useCall, useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the HostDurationBadge component.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The HostDurationBadge component displays the duration while the live stream is active.
|
|
13
|
+
*/
|
|
14
|
+
export const DurationBadge = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
mode
|
|
17
|
+
} = _ref;
|
|
18
|
+
const {
|
|
19
|
+
useCallSession
|
|
20
|
+
} = useCallStateHooks();
|
|
21
|
+
const session = useCallSession();
|
|
22
|
+
const [duration, setDuration] = useState(() => {
|
|
23
|
+
if (!session || !session.live_started_at) {
|
|
24
|
+
return 0;
|
|
25
|
+
}
|
|
26
|
+
const liveStartTime = new Date(session.live_started_at);
|
|
27
|
+
const now = new Date();
|
|
28
|
+
return Math.floor((now.getTime() - liveStartTime.getTime()) / 1000);
|
|
29
|
+
});
|
|
30
|
+
const call = useCall();
|
|
31
|
+
const {
|
|
32
|
+
theme: {
|
|
33
|
+
colors,
|
|
34
|
+
variants: {
|
|
35
|
+
iconSizes
|
|
36
|
+
},
|
|
37
|
+
durationBadge
|
|
38
|
+
}
|
|
39
|
+
} = useTheme();
|
|
40
|
+
|
|
41
|
+
// for host
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (mode !== 'host') {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
let intervalId;
|
|
47
|
+
const handleLiveStarted = () => {
|
|
48
|
+
intervalId = setInterval(() => {
|
|
49
|
+
setDuration(d => d + 1);
|
|
50
|
+
}, 1000);
|
|
51
|
+
};
|
|
52
|
+
const handleLiveEnded = event => {
|
|
53
|
+
const callDetails = event.call.session;
|
|
54
|
+
if ((callDetails === null || callDetails === void 0 ? void 0 : callDetails.live_ended_at) !== null) {
|
|
55
|
+
clearInterval(intervalId);
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const callLiveStartedUnsubscribe = call === null || call === void 0 ? void 0 : call.on('call.live_started', handleLiveStarted);
|
|
59
|
+
const callUpdatedUnsubscribe = call === null || call === void 0 ? void 0 : call.on('call.updated', handleLiveEnded);
|
|
60
|
+
return () => {
|
|
61
|
+
if (mode !== 'host') {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (callLiveStartedUnsubscribe && callUpdatedUnsubscribe) {
|
|
65
|
+
callLiveStartedUnsubscribe();
|
|
66
|
+
callUpdatedUnsubscribe();
|
|
67
|
+
}
|
|
68
|
+
if (intervalId) {
|
|
69
|
+
clearInterval(intervalId);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}, [call, mode]);
|
|
73
|
+
|
|
74
|
+
// for viewer
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (mode !== 'viewer') {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
let intervalId;
|
|
80
|
+
const handleLiveStarted = () => {
|
|
81
|
+
intervalId = setInterval(() => {
|
|
82
|
+
setDuration(d => d + 1);
|
|
83
|
+
}, 1000);
|
|
84
|
+
};
|
|
85
|
+
handleLiveStarted();
|
|
86
|
+
return () => {
|
|
87
|
+
if (mode !== 'viewer') {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (intervalId) {
|
|
91
|
+
clearInterval(intervalId);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}, [mode]);
|
|
95
|
+
const formatDuration = durationInMs => {
|
|
96
|
+
const days = Math.floor(durationInMs / 86400);
|
|
97
|
+
const hours = Math.floor(durationInMs / 3600);
|
|
98
|
+
const minutes = Math.floor(durationInMs % 3600 / 60);
|
|
99
|
+
const seconds = durationInMs % 60;
|
|
100
|
+
return `${days ? days + ' ' : ''}${hours ? hours + ':' : ''}${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
|
|
101
|
+
};
|
|
102
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
103
|
+
style: [styles.container, {
|
|
104
|
+
backgroundColor: colors.dark_gray
|
|
105
|
+
}, durationBadge.container]
|
|
106
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
107
|
+
style: [styles.icon, {
|
|
108
|
+
height: iconSizes.xs,
|
|
109
|
+
width: iconSizes.xs
|
|
110
|
+
}, durationBadge.icon]
|
|
111
|
+
}, /*#__PURE__*/React.createElement(ShieldBadge, null)), /*#__PURE__*/React.createElement(Text, {
|
|
112
|
+
style: [styles.label, {
|
|
113
|
+
color: colors.static_white
|
|
114
|
+
}, durationBadge.label]
|
|
115
|
+
}, formatDuration(duration)));
|
|
116
|
+
};
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
container: {
|
|
119
|
+
paddingHorizontal: 8,
|
|
120
|
+
paddingVertical: 4,
|
|
121
|
+
borderRadius: 4,
|
|
122
|
+
flexDirection: 'row',
|
|
123
|
+
alignItems: 'center',
|
|
124
|
+
justifyContent: 'center'
|
|
125
|
+
},
|
|
126
|
+
icon: {},
|
|
127
|
+
label: {
|
|
128
|
+
textAlign: 'center',
|
|
129
|
+
fontSize: 13,
|
|
130
|
+
fontWeight: '400',
|
|
131
|
+
flexShrink: 1,
|
|
132
|
+
includeFontPadding: false,
|
|
133
|
+
paddingLeft: 4
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=DurationBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","StyleSheet","Text","View","useTheme","ShieldBadge","useCall","useCallStateHooks","DurationBadge","_ref","mode","useCallSession","session","duration","setDuration","live_started_at","liveStartTime","Date","now","Math","floor","getTime","call","theme","colors","variants","iconSizes","durationBadge","intervalId","handleLiveStarted","setInterval","d","handleLiveEnded","event","callDetails","live_ended_at","clearInterval","callLiveStartedUnsubscribe","on","callUpdatedUnsubscribe","formatDuration","durationInMs","days","hours","minutes","seconds","createElement","style","styles","container","backgroundColor","dark_gray","icon","height","xs","width","label","color","static_white","create","paddingHorizontal","paddingVertical","borderRadius","flexDirection","alignItems","justifyContent","textAlign","fontSize","fontWeight","flexShrink","includeFontPadding","paddingLeft"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamTopView/DurationBadge.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,WAAW,QAAQ,gBAAgB;AAC5C,SAASC,OAAO,EAAEC,iBAAiB,QAAQ,iCAAiC;;AAG5E;AACA;AACA;;AAKA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGC,IAAA,IAAkC;EAAA,IAAjC;IAAEC;EAAyB,CAAC,GAAAD,IAAA;EACxD,MAAM;IAAEE;EAAe,CAAC,GAAGJ,iBAAiB,CAAC,CAAC;EAC9C,MAAMK,OAAO,GAAGD,cAAc,CAAC,CAAC;EAEhC,MAAM,CAACE,QAAQ,EAAEC,WAAW,CAAC,GAAGd,QAAQ,CAAC,MAAM;IAC7C,IAAI,CAACY,OAAO,IAAI,CAACA,OAAO,CAACG,eAAe,EAAE;MACxC,OAAO,CAAC;IACV;IACA,M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"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, Text, View } from 'react-native';
|
|
3
|
+
import { useTheme } from '../../../contexts';
|
|
4
|
+
import { useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
5
|
+
import { Eye } from '../../../icons';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Props for the FollowerCount component.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The FollowerCount component that displays the number of participants while in the call.
|
|
13
|
+
*/
|
|
14
|
+
export const FollowerCount = _ref => {
|
|
15
|
+
let {} = _ref;
|
|
16
|
+
const {
|
|
17
|
+
theme: {
|
|
18
|
+
colors,
|
|
19
|
+
variants: {
|
|
20
|
+
iconSizes
|
|
21
|
+
},
|
|
22
|
+
followerCount
|
|
23
|
+
}
|
|
24
|
+
} = useTheme();
|
|
25
|
+
const {
|
|
26
|
+
useParticipantCount
|
|
27
|
+
} = useCallStateHooks();
|
|
28
|
+
const totalParticipants = useParticipantCount();
|
|
29
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
style: [styles.container, {
|
|
31
|
+
backgroundColor: colors.dark_gray
|
|
32
|
+
}, followerCount.container]
|
|
33
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
34
|
+
style: [styles.icon, {
|
|
35
|
+
height: iconSizes.xs,
|
|
36
|
+
width: iconSizes.xs
|
|
37
|
+
}, followerCount.icon]
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Eye, null)), /*#__PURE__*/React.createElement(Text, {
|
|
39
|
+
style: [styles.label, {
|
|
40
|
+
color: colors.static_white
|
|
41
|
+
}, followerCount.label]
|
|
42
|
+
}, totalParticipants));
|
|
43
|
+
};
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
container: {
|
|
46
|
+
paddingHorizontal: 8,
|
|
47
|
+
paddingVertical: 4,
|
|
48
|
+
borderTopRightRadius: 4,
|
|
49
|
+
borderBottomRightRadius: 4,
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
justifyContent: 'center'
|
|
53
|
+
},
|
|
54
|
+
icon: {},
|
|
55
|
+
label: {
|
|
56
|
+
fontSize: 13,
|
|
57
|
+
fontWeight: '400',
|
|
58
|
+
flexShrink: 1,
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
includeFontPadding: false,
|
|
61
|
+
marginLeft: 4
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=FollowerCount.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","Text","View","useTheme","useCallStateHooks","Eye","FollowerCount","_ref","theme","colors","variants","iconSizes","followerCount","useParticipantCount","totalParticipants","createElement","style","styles","container","backgroundColor","dark_gray","icon","height","xs","width","label","color","static_white","create","paddingHorizontal","paddingVertical","borderTopRightRadius","borderBottomRightRadius","flexDirection","alignItems","justifyContent","fontSize","fontWeight","flexShrink","textAlign","includeFontPadding","marginLeft"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamTopView/FollowerCount.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,EAAEC,IAAI,QAAQ,cAAc;AACrD,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,GAAG,QAAQ,gBAAgB;;AAEpC;AACA;AACA;;AAGA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GAAGC,IAAA,IAA4B;EAAA,IAA3B,CAAqB,CAAC,GAAAA,IAAA;EAClD,MAAM;IACJC,KAAK,EAAE;MACLC,MAAM;MACNC,QAAQ,EAAE;QAAEC;MAAU,CAAC;MACvBC;IACF;EACF,CAAC,GAAGT,QAAQ,CAAC,CAAC;EACd,MAAM;IAAEU;EAAoB,CAAC,GAAGT,iBAAiB,CAAC,CAAC;EACnD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leSheet, View } from 'react-native';
|
|
3
|
+
import { DurationBadge as DefaultDurationBadge } from './DurationBadge';
|
|
4
|
+
import { LiveIndicator as DefaultLiveIndicator } from './LiveIndicator';
|
|
5
|
+
import { FollowerCount as DefaultFollowerCount } from './FollowerCount';
|
|
6
|
+
import { useTheme } from '../../../contexts';
|
|
7
|
+
import { useCallStateHooks } from '@stream-io/video-react-bindings';
|
|
8
|
+
import { Z_INDEX } from '../../../constants';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Props for the HostLivestreamTopView component.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The HostLivestreamTopView component displays the top view component of the host's live stream.
|
|
16
|
+
*/
|
|
17
|
+
export const HostLivestreamTopView = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
DurationBadge = DefaultDurationBadge,
|
|
20
|
+
LiveIndicator = DefaultLiveIndicator,
|
|
21
|
+
FollowerCount = DefaultFollowerCount
|
|
22
|
+
} = _ref;
|
|
23
|
+
const {
|
|
24
|
+
useIsCallLive,
|
|
25
|
+
useIsCallBroadcastingInProgress
|
|
26
|
+
} = useCallStateHooks();
|
|
27
|
+
const isCallLive = useIsCallLive();
|
|
28
|
+
const isBroadcasting = useIsCallBroadcastingInProgress();
|
|
29
|
+
const liveOrBroadcasting = isCallLive || isBroadcasting;
|
|
30
|
+
const {
|
|
31
|
+
theme: {
|
|
32
|
+
colors,
|
|
33
|
+
hostLivestreamTopView
|
|
34
|
+
}
|
|
35
|
+
} = useTheme();
|
|
36
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
37
|
+
style: [styles.container, {
|
|
38
|
+
backgroundColor: colors.static_overlay
|
|
39
|
+
}, hostLivestreamTopView.container]
|
|
40
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
41
|
+
style: [styles.leftElement, hostLivestreamTopView.leftElement]
|
|
42
|
+
}, DurationBadge && /*#__PURE__*/React.createElement(DurationBadge, {
|
|
43
|
+
mode: "host"
|
|
44
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: [styles.centerElement, hostLivestreamTopView.centerElement]
|
|
46
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
47
|
+
style: [styles.rightElement, hostLivestreamTopView.rightElement]
|
|
48
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
49
|
+
style: [styles.liveInfo, hostLivestreamTopView.liveInfo]
|
|
50
|
+
}, liveOrBroadcasting && LiveIndicator && /*#__PURE__*/React.createElement(LiveIndicator, null), FollowerCount && /*#__PURE__*/React.createElement(FollowerCount, null))));
|
|
51
|
+
};
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
container: {
|
|
54
|
+
position: 'absolute',
|
|
55
|
+
top: 0,
|
|
56
|
+
flexDirection: 'row',
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
paddingVertical: 16,
|
|
59
|
+
paddingHorizontal: 8,
|
|
60
|
+
borderBottomEndRadius: 8,
|
|
61
|
+
borderBottomStartRadius: 8,
|
|
62
|
+
zIndex: Z_INDEX.IN_FRONT
|
|
63
|
+
},
|
|
64
|
+
liveInfo: {
|
|
65
|
+
flexDirection: 'row'
|
|
66
|
+
},
|
|
67
|
+
leftElement: {
|
|
68
|
+
flex: 1,
|
|
69
|
+
alignItems: 'flex-start'
|
|
70
|
+
},
|
|
71
|
+
centerElement: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
alignItems: 'center'
|
|
74
|
+
},
|
|
75
|
+
rightElement: {
|
|
76
|
+
flex: 1,
|
|
77
|
+
alignItems: 'flex-end'
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
//# sourceMappingURL=HostLivestreamTopView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","DurationBadge","DefaultDurationBadge","LiveIndicator","DefaultLiveIndicator","FollowerCount","DefaultFollowerCount","useTheme","useCallStateHooks","Z_INDEX","HostLivestreamTopView","_ref","useIsCallLive","useIsCallBroadcastingInProgress","isCallLive","isBroadcasting","liveOrBroadcasting","theme","colors","hostLivestreamTopView","createElement","style","styles","container","backgroundColor","static_overlay","leftElement","mode","centerElement","rightElement","liveInfo","create","position","top","flexDirection","alignItems","paddingVertical","paddingHorizontal","borderBottomEndRadius","borderBottomStartRadius","zIndex","IN_FRONT","flex"],"sourceRoot":"../../../../../src","sources":["components/Livestream/LivestreamTopView/HostLivestreamTopView.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SACEC,aAAa,IAAIC,oBAAoB,QAEhC,iBAAiB;AACxB,SACEC,aAAa,IAAIC,oBAAoB,QAEhC,iBAAiB;AACxB,SACEC,aAAa,IAAIC,oBAAoB,QAEhC,iBAAiB;AACxB,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,iBAAiB,QAAQ,iCAAiC;AACnE,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;;AAgBA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,GAAGC,IAAA,IAIH;EAAA,IAJI;IACpCV,aAAa,GAAGC,oBAAoB;IACpCC,aAAa,GAAGC,oBAAoB;IACpCC,aAAa,GAAGC;EACU,CAAC,GAAAK,IAAA;EAC3B,MAAM;IAAEC,aAAa;IAAEC;EAAgC,CAAC,GACtDL,iBAAiB,CAAC,CAAC;EACrB,MAAMM,UAAU,GAAGF,aAAa,CAAC,CAAC;EAClC,MAAMG,cAAc,GAAGF,+BAA+B,CAAC,CAAC;EAExD,MAAMG,kBAAkB,GAAGF,UAAU,IAAIC,cAAc;EACvD,MAAM;IACJE,KAAK,EAAE;MAAEC,MAAM;MAAEC;IAAsB;EACzC,CAAC,GAAGZ,QAAQ,CAAC,CAAC;EACd,oBACET,KAAA,CAAAsB,aAAA,CAACpB,IAAI;IACHqB,KAAK,EAAE,CACLC,MAAM,CAACC,SAAS,EAChB;MAAEC,eAAe,EAAEN,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