@100mslive/roomkit-react 0.1.1 → 0.1.2-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +18 -0
- package/dist/Accordion/Accordion.d.ts +62 -138
- package/dist/Accordion/index.d.ts +62 -138
- package/dist/{ActiveSpeakerView-G32BDM5F.js → ActiveSpeakerView-4XPIRZOK.js} +6 -6
- package/dist/{ActiveSpeakerView-LW4WDBC6.css → ActiveSpeakerView-ADEYHQMU.css} +2 -2
- package/dist/{PinnedTrackView-OAA4HAID.css.map → ActiveSpeakerView-ADEYHQMU.css.map} +2 -2
- package/dist/Avatar/Avatar.d.ts +31 -69
- package/dist/Button/Button.d.ts +31 -69
- package/dist/Checkbox/Checkbox.d.ts +62 -138
- package/dist/Collapsible/Collapsible.d.ts +93 -207
- package/dist/Divider/Divider.d.ts +62 -138
- package/dist/Dropdown/Dropdown.d.ts +372 -828
- package/dist/Fieldset/Fieldset.d.ts +31 -69
- package/dist/Footer/Footer.d.ts +248 -552
- package/dist/{HLSView-DIQQF2PP.css → HLSView-DWEEMZ6Z.css} +2 -2
- package/dist/{HLSView-DIQQF2PP.css.map → HLSView-DWEEMZ6Z.css.map} +2 -2
- package/dist/{HLSView-ZYNT3HJD.js → HLSView-I26CVF5U.js} +16 -16
- package/dist/HLSView-I26CVF5U.js.map +7 -0
- package/dist/IconButton/IconButton.d.ts +31 -69
- package/dist/Input/Input.d.ts +189 -417
- package/dist/Label/Label.d.ts +31 -69
- package/dist/Layout/Box.d.ts +31 -69
- package/dist/Layout/Flex.d.ts +31 -69
- package/dist/Link/Link.d.ts +31 -69
- package/dist/Modal/Dialog.d.ts +248 -552
- package/dist/Modal/DialogContent.d.ts +217 -483
- package/dist/Pagination/StyledPagination.d.ts +124 -276
- package/dist/{PinnedTrackView-OAA4HAID.css → PinnedTrackView-5DPVVOZW.css} +2 -2
- package/dist/{conference-LE4T3ZNF.css.map → PinnedTrackView-5DPVVOZW.css.map} +2 -2
- package/dist/{PinnedTrackView-GTXL2UTS.js → PinnedTrackView-GGTCNH5V.js} +6 -6
- package/dist/Popover/index.d.ts +93 -207
- package/dist/Prebuilt/provider/roomLayoutProvider/constants/index.d.ts +2 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.d.ts +9 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/index.d.ts +9 -0
- package/dist/Progress/index.d.ts +62 -138
- package/dist/RadioGroup/RadioGroup.d.ts +93 -207
- package/dist/ReactSelect/ReactSelect.d.ts +310 -690
- package/dist/Select/Select.d.ts +93 -207
- package/dist/Slider/Slider.d.ts +31 -69
- package/dist/Stats/StyledStats.d.ts +186 -414
- package/dist/Switch/Switch.d.ts +31 -69
- package/dist/Tabs/Tabs.d.ts +124 -276
- package/dist/Text/Text.d.ts +31 -69
- package/dist/Theme/ThemeProvider.d.ts +63 -140
- package/dist/Theme/base.config.d.ts +31 -53
- package/dist/Theme/index.d.ts +0 -1
- package/dist/Theme/stitches.config.d.ts +404 -915
- package/dist/TileMenu/StyledMenuTile.d.ts +217 -483
- package/dist/Toast/Toast.d.ts +187 -415
- package/dist/Video/Video.d.ts +31 -69
- package/dist/VideoList/StyledVideoList.d.ts +93 -207
- package/dist/VideoTile/StyledVideoTile.d.ts +279 -621
- package/dist/{VirtualBackground-HWU22Q6S.js → VirtualBackground-ZRRE4DUA.js} +4 -3
- package/dist/{VirtualBackground-HWU22Q6S.js.map → VirtualBackground-ZRRE4DUA.js.map} +2 -2
- package/dist/{chunk-4VY5NUK7.js → chunk-4ISMCWQA.js} +49 -146
- package/dist/chunk-4ISMCWQA.js.map +7 -0
- package/dist/{chunk-TEHZYXCJ.js → chunk-KKLZ7K2L.js} +167 -164
- package/dist/chunk-KKLZ7K2L.js.map +7 -0
- package/dist/chunk-LUND6FLY.js +8626 -0
- package/dist/chunk-LUND6FLY.js.map +7 -0
- package/dist/chunk-MYK3T45M.js +58 -0
- package/dist/chunk-MYK3T45M.js.map +7 -0
- package/dist/{chunk-A2PNZIK7.js → chunk-THORW2WT.js} +4 -4
- package/dist/{chunk-A2PNZIK7.js.map → chunk-THORW2WT.js.map} +1 -1
- package/dist/{conference-YHO2J3Z6.js → conference-5TDUAQ6K.js} +593 -532
- package/dist/conference-5TDUAQ6K.js.map +7 -0
- package/dist/{conference-LE4T3ZNF.css → conference-BDCDGBIS.css} +2 -2
- package/dist/{ActiveSpeakerView-LW4WDBC6.css.map → conference-BDCDGBIS.css.map} +2 -2
- package/dist/index.cjs.css +1 -1
- package/dist/index.cjs.css.map +2 -2
- package/dist/index.cjs.js +2952 -2662
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +1 -1
- package/dist/index.css.map +2 -2
- package/dist/index.js +4 -8
- package/dist/meta.cjs.json +750 -484
- package/dist/meta.esbuild.json +844 -581
- package/dist/{transcription-L6VBK75V.js → transcription-PYTSSAOB.js} +3 -3
- package/package.json +13 -9
- package/src/Accordion/Accordion.tsx +3 -3
- package/src/AudioLevel/AudioLevel.tsx +1 -1
- package/src/Avatar/Avatar.tsx +8 -3
- package/src/Button/Button.tsx +76 -20
- package/src/Checkbox/Checkbox.tsx +4 -4
- package/src/Collapsible/Collapsible.tsx +1 -1
- package/src/Divider/Divider.tsx +2 -2
- package/src/Divider/HorizontalDivider.stories.tsx +2 -2
- package/src/Divider/VerticalDivider.stories.tsx +1 -1
- package/src/Dropdown/Dropdown.stories.tsx +3 -3
- package/src/Dropdown/Dropdown.tsx +16 -14
- package/src/IconButton/IconButton.tsx +8 -7
- package/src/Input/Input.tsx +9 -8
- package/src/Input/PasswordInput.stories.tsx +2 -2
- package/src/Label/Label.tsx +1 -1
- package/src/Link/Link.tsx +4 -4
- package/src/Loading/Loading.tsx +7 -10
- package/src/Modal/Dialog.stories.tsx +2 -2
- package/src/Modal/DialogContent.tsx +3 -3
- package/src/Pagination/StyledPagination.tsx +4 -4
- package/src/Popover/Popover.stories.tsx +5 -5
- package/src/Popover/index.tsx +1 -1
- package/src/Prebuilt/App.jsx +101 -68
- package/src/Prebuilt/IconButton.jsx +2 -2
- package/src/Prebuilt/Prebuilt.stories.tsx +8 -2
- package/src/Prebuilt/common/constants.js +0 -1
- package/src/Prebuilt/common/utils.js +0 -6
- package/src/Prebuilt/components/AppData/AppData.jsx +7 -4
- package/src/Prebuilt/components/AppData/useUISettings.js +0 -4
- package/src/Prebuilt/components/AudioVideoToggle.jsx +73 -20
- package/src/Prebuilt/components/BottomActionSheet/BottomActionSheet.jsx +1 -1
- package/src/Prebuilt/components/Chat/Chat.jsx +6 -2
- package/src/Prebuilt/components/Chat/ChatBody.jsx +13 -11
- package/src/Prebuilt/components/Chat/ChatFooter.jsx +2 -2
- package/src/Prebuilt/components/Chat/ChatHeader.jsx +3 -3
- package/src/Prebuilt/components/Chat/ChatSelector.jsx +2 -2
- package/src/Prebuilt/components/Chat/useEmojiPickerStyles.js +6 -6
- package/src/Prebuilt/components/Chip.jsx +24 -0
- package/src/Prebuilt/components/Connection/ConnectionIndicator.jsx +6 -6
- package/src/Prebuilt/components/Connection/TileConnection.jsx +2 -2
- package/src/Prebuilt/components/Connection/connectionQualityUtils.js +4 -4
- package/src/Prebuilt/components/EmojiReaction.jsx +13 -10
- package/src/Prebuilt/components/ErrorBoundary.jsx +2 -2
- package/src/Prebuilt/components/FullPageProgress.jsx +5 -3
- package/src/Prebuilt/components/GoLiveButton.jsx +1 -4
- package/src/Prebuilt/components/HMSVideo/HLSQualitySelector.jsx +2 -2
- package/src/Prebuilt/components/HMSVideo/PlayButton.jsx +1 -1
- package/src/Prebuilt/components/HMSVideo/VideoProgress.jsx +3 -3
- package/src/Prebuilt/components/HMSVideo/VideoTime.jsx +3 -1
- package/src/Prebuilt/components/HMSVideo/VolumeControl.jsx +1 -1
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +17 -17
- package/src/Prebuilt/components/Header/AmbientMusic.jsx +1 -1
- package/src/Prebuilt/components/Header/ConferencingHeader.jsx +4 -6
- package/src/Prebuilt/components/Header/HeaderComponents.jsx +10 -5
- package/src/Prebuilt/components/Header/ParticipantFilter.jsx +2 -2
- package/src/Prebuilt/components/Header/ParticipantList.jsx +2 -2
- package/src/Prebuilt/components/Header/StreamActions.jsx +9 -19
- package/src/Prebuilt/components/Header/StreamingHeader.jsx +5 -6
- package/src/Prebuilt/components/HlsStatsOverlay.jsx +2 -2
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.jsx +102 -0
- package/src/Prebuilt/components/IconButtonWithOptions/IconButtonWithOptions.stories.tsx +40 -0
- package/src/Prebuilt/components/LeaveRoom.jsx +11 -11
- package/src/Prebuilt/components/MetaActions.jsx +2 -2
- package/src/Prebuilt/components/MoreSettings/BulkRoleChangeModal.jsx +2 -2
- package/src/Prebuilt/components/MoreSettings/ChangeSelfRole.jsx +1 -1
- package/src/Prebuilt/components/MoreSettings/MoreSettings.jsx +1 -0
- package/src/Prebuilt/components/Notifications/HLSFailureModal.jsx +69 -0
- package/src/Prebuilt/components/Notifications/Notifications.jsx +1 -3
- package/src/Prebuilt/components/Notifications/PermissionErrorModal.jsx +108 -26
- package/src/Prebuilt/components/Notifications/ReconnectNotifications.jsx +1 -1
- package/src/Prebuilt/components/PIP/pipUtils.js +2 -2
- package/src/Prebuilt/components/Playlist/Playlist.jsx +4 -4
- package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +3 -3
- package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +3 -3
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +4 -4
- package/src/Prebuilt/components/PostLeave.jsx +4 -4
- package/src/Prebuilt/components/Preview/PreviewContainer.jsx +17 -6
- package/src/Prebuilt/components/Preview/PreviewForm.jsx +74 -0
- package/src/Prebuilt/components/Preview/PreviewJoin.jsx +100 -37
- package/src/Prebuilt/components/RoleChangeModal.jsx +3 -3
- package/src/Prebuilt/components/ScreenshareDisplay.jsx +2 -2
- package/src/Prebuilt/components/Settings/DeviceSettings.jsx +3 -9
- package/src/Prebuilt/components/Settings/SettingsModal.jsx +8 -32
- package/src/Prebuilt/components/Settings/StartRecording.jsx +4 -12
- package/src/Prebuilt/components/Settings/SwitchWithLabel.jsx +2 -3
- package/src/Prebuilt/components/Settings/common.js +26 -0
- package/src/Prebuilt/components/StatsForNerds.jsx +5 -5
- package/src/Prebuilt/components/Streaming/Common.jsx +11 -11
- package/src/Prebuilt/components/Streaming/HLSStreaming.jsx +6 -12
- package/src/Prebuilt/components/Streaming/RTMPStreaming.jsx +4 -6
- package/src/Prebuilt/components/Streaming/StreamingLanding.jsx +4 -4
- package/src/Prebuilt/components/TileMenu.jsx +7 -7
- package/src/Prebuilt/components/Toast/ToastConfig.jsx +12 -20
- package/src/Prebuilt/components/conference.jsx +9 -2
- package/src/Prebuilt/components/hooks/useDropdownSelection.jsx +1 -4
- package/src/Prebuilt/components/pdfAnnotator/pdfErrorView.jsx +2 -2
- package/src/Prebuilt/components/pdfAnnotator/pdfFileOptions.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfHeader.jsx +1 -1
- package/src/Prebuilt/components/pdfAnnotator/pdfInfo.jsx +2 -2
- package/src/Prebuilt/components/pdfAnnotator/shareScreenOptions.jsx +12 -20
- package/src/Prebuilt/components/pdfAnnotator/uploadedFile.jsx +4 -4
- package/src/Prebuilt/images/Logo.svg +8 -0
- package/src/Prebuilt/images/first_person.png +0 -0
- package/src/Prebuilt/images/rtmp.png +0 -0
- package/src/Prebuilt/index.d.ts +6 -1
- package/src/Prebuilt/layouts/HLSView.jsx +1 -1
- package/src/Prebuilt/layouts/InsetView.jsx +0 -3
- package/src/Prebuilt/layouts/NonPublisherView.jsx +2 -2
- package/src/Prebuilt/layouts/SidePane.jsx +1 -1
- package/src/Prebuilt/layouts/WaitingView.jsx +2 -2
- package/src/Prebuilt/layouts/mainView.jsx +42 -5
- package/src/Prebuilt/plugins/FlyingEmoji.jsx +2 -2
- package/src/Prebuilt/plugins/VirtualBackground/VirtualBackground.jsx +1 -0
- package/src/Prebuilt/plugins/whiteboard/ToggleWhiteboard.jsx +1 -3
- package/src/Prebuilt/primitives/DialogContent.jsx +4 -4
- package/src/Prebuilt/primitives/DropdownTrigger.jsx +3 -3
- package/src/Prebuilt/provider/roomLayoutProvider/constants/index.ts +33 -0
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useFetchRoomLayout.ts +57 -0
- package/src/Prebuilt/provider/roomLayoutProvider/index.tsx +26 -0
- package/src/Progress/index.tsx +2 -2
- package/src/RadioGroup/RadioGroup.tsx +3 -3
- package/src/ReactSelect/ReactSelect.stories.tsx +7 -7
- package/src/ReactSelect/ReactSelect.tsx +8 -8
- package/src/Select/Select.tsx +6 -6
- package/src/Slider/Slider.tsx +5 -5
- package/src/Stats/Stats.tsx +12 -2
- package/src/Stats/StyledStats.tsx +3 -3
- package/src/Switch/Switch.tsx +5 -5
- package/src/Tabs/Tabs.stories.tsx +2 -2
- package/src/Tabs/Tabs.tsx +2 -2
- package/src/Text/Text.tsx +2 -2
- package/src/Theme/ThemeProvider.tsx +4 -7
- package/src/Theme/ThemeStory.jsx +17 -19
- package/src/Theme/base.config.ts +31 -59
- package/src/Theme/index.tsx +0 -1
- package/src/Theme/stitches.config.ts +2 -7
- package/src/TileMenu/StyledMenuTile.tsx +9 -8
- package/src/Toast/Toast.tsx +10 -9
- package/src/Tooltip/Tooltip.stories.tsx +1 -1
- package/src/Tooltip/Tooltip.tsx +4 -4
- package/src/Video/Video.tsx +1 -1
- package/src/VideoTile/StyledVideoTile.tsx +12 -12
- package/src/assets/android-perm-0.png +0 -0
- package/src/assets/android-perm-1.png +0 -0
- package/src/assets/ios-perm-0.png +0 -0
- package/src/fixtures/chats.ts +1 -1
- package/dist/HLSView-ZYNT3HJD.js.map +0 -7
- package/dist/Theme/themes.d.ts +0 -64
- package/dist/chunk-4VY5NUK7.js.map +0 -7
- package/dist/chunk-BSQIN5RC.js +0 -65
- package/dist/chunk-BSQIN5RC.js.map +0 -7
- package/dist/chunk-TEHZYXCJ.js.map +0 -7
- package/dist/chunk-ZET2HMGS.js +0 -8331
- package/dist/chunk-ZET2HMGS.js.map +0 -7
- package/dist/conference-YHO2J3Z6.js.map +0 -7
- package/src/Prebuilt/components/Preview/PreviewName.jsx +0 -37
- package/src/Prebuilt/components/Streaming/RTMPIcon.jsx +0 -69
- package/src/Prebuilt/hms.js +0 -7
- package/src/Prebuilt/plugins/confetti.jsx +0 -60
- package/src/Theme/themes.ts +0 -70
- /package/dist/{ActiveSpeakerView-G32BDM5F.js.map → ActiveSpeakerView-4XPIRZOK.js.map} +0 -0
- /package/dist/{PinnedTrackView-GTXL2UTS.js.map → PinnedTrackView-GGTCNH5V.js.map} +0 -0
- /package/dist/{transcription-L6VBK75V.js.map → transcription-PYTSSAOB.js.map} +0 -0
@@ -1,11 +1,25 @@
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
2
3
|
import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
|
3
|
-
import { Dialog, Text } from '../../../';
|
4
|
+
import { Button, config as cssConfig, Dialog, Flex, Text } from '../../../';
|
5
|
+
import androidPermissions from '../../../assets/android-perm-0.png';
|
6
|
+
import androidPermissionAlert from '../../../assets/android-perm-1.png';
|
7
|
+
import iosPermissions from '../../../assets/ios-perm-0.png';
|
8
|
+
import { isAndroid, isIOS } from '../../common/constants';
|
4
9
|
|
5
10
|
export function PermissionErrorModal() {
|
6
11
|
const notification = useHMSNotifications(HMSNotificationTypes.ERROR);
|
7
12
|
const [deviceType, setDeviceType] = useState('');
|
8
13
|
const [isSystemError, setIsSystemError] = useState(false);
|
14
|
+
const [showAndroidPrompt, setShowAndroidPrompt] = useState(true);
|
15
|
+
const isMobile = useMedia(cssConfig.media.md);
|
16
|
+
|
17
|
+
useEffect(() => {
|
18
|
+
if (showAndroidPrompt && isAndroid && isMobile) {
|
19
|
+
setDeviceType('camera and microphone');
|
20
|
+
}
|
21
|
+
}, []);
|
22
|
+
|
9
23
|
useEffect(() => {
|
10
24
|
if (
|
11
25
|
!notification ||
|
@@ -20,46 +34,114 @@ export function PermissionErrorModal() {
|
|
20
34
|
const hasVideo = errorMessage.includes('video');
|
21
35
|
const hasScreen = errorMessage.includes('screen');
|
22
36
|
if (hasAudio && hasVideo) {
|
23
|
-
setDeviceType('
|
37
|
+
setDeviceType('camera and microphone');
|
24
38
|
} else if (hasAudio) {
|
25
|
-
setDeviceType('
|
39
|
+
setDeviceType('microphone');
|
26
40
|
} else if (hasVideo) {
|
27
|
-
setDeviceType('
|
41
|
+
setDeviceType('camera');
|
28
42
|
} else if (hasScreen) {
|
29
|
-
setDeviceType('
|
43
|
+
setDeviceType('screen');
|
30
44
|
}
|
31
45
|
setIsSystemError(notification.data.code === 3011);
|
32
46
|
}, [notification]);
|
47
|
+
|
33
48
|
return deviceType ? (
|
34
|
-
<Dialog.Root
|
35
|
-
open
|
36
|
-
onOpenChange={value => {
|
37
|
-
if (!value) {
|
38
|
-
setDeviceType('');
|
39
|
-
}
|
40
|
-
}}
|
41
|
-
>
|
49
|
+
<Dialog.Root open={!!deviceType}>
|
42
50
|
<Dialog.Portal>
|
43
51
|
<Dialog.Overlay />
|
44
|
-
<Dialog.Content css={{ w: 'min(
|
52
|
+
<Dialog.Content css={{ w: 'min(380px, 90%)', p: '$8' }}>
|
45
53
|
<Dialog.Title
|
46
54
|
css={{
|
47
|
-
|
48
|
-
alignItems: 'center',
|
49
|
-
justifyContent: 'space-between',
|
50
|
-
borderBottom: '1px solid $borderDefault',
|
51
|
-
pb: '$8',
|
55
|
+
borderBottom: '1px solid $border_default',
|
52
56
|
}}
|
53
57
|
>
|
54
|
-
<
|
55
|
-
|
58
|
+
{isMobile && isIOS ? <img style={{ maxWidth: '100%', maxHeight: '100%' }} src={iosPermissions} /> : null}
|
59
|
+
|
60
|
+
{/* Images for android */}
|
61
|
+
{isMobile && isAndroid ? (
|
62
|
+
showAndroidPrompt ? (
|
63
|
+
<img src={androidPermissions} style={{ maxWidth: '100%', maxHeight: '100%' }} />
|
64
|
+
) : (
|
65
|
+
<img src={androidPermissionAlert} style={{ maxWidth: '100%', maxHeight: '100%' }} />
|
66
|
+
)
|
67
|
+
) : null}
|
68
|
+
|
69
|
+
<Text variant="h6">
|
70
|
+
{showAndroidPrompt ? `Allow access to your ${deviceType}` : `We can't access your ${deviceType}`}
|
71
|
+
</Text>
|
56
72
|
</Dialog.Title>
|
57
|
-
|
58
|
-
|
59
|
-
{
|
60
|
-
|
61
|
-
|
73
|
+
|
74
|
+
<Text variant="sm" css={{ pt: '$4', pb: '$10', color: '$on_surface_medium' }}>
|
75
|
+
{/* IOS prompt text */}
|
76
|
+
{isMobile && isIOS
|
77
|
+
? 'Enable permissions by reloading this page and clicking “Allow” on the pop-up, or change settings from the address bar.'
|
78
|
+
: null}
|
79
|
+
|
80
|
+
{/* Initial prompt for android devices */}
|
81
|
+
{isMobile && showAndroidPrompt && isAndroid
|
82
|
+
? 'In order for others to see and hear you, your browser will request camera and microphone access.'
|
83
|
+
: null}
|
84
|
+
|
85
|
+
{/* Successive prompts for android devices */}
|
86
|
+
{isMobile && !showAndroidPrompt && isAndroid
|
87
|
+
? 'To allow other users to see and hear you, click the blocked camera icon in your browser’s address bar.'
|
88
|
+
: null}
|
89
|
+
|
90
|
+
{/* Prompt for desktops */}
|
91
|
+
{!isMobile ? `Access to ${deviceType} is required. ` : null}
|
92
|
+
|
93
|
+
{isSystemError && !isMobile
|
94
|
+
? `Enable permissions for ${deviceType}${deviceType === 'screen' ? 'share' : ''} from sytem settings`
|
95
|
+
: null}
|
96
|
+
{!isSystemError && !isMobile
|
97
|
+
? `Enable permissions for ${deviceType}${
|
98
|
+
deviceType === 'screen' ? 'share' : ''
|
99
|
+
} from address bar or browser settings.`
|
100
|
+
: null}
|
62
101
|
</Text>
|
102
|
+
|
103
|
+
{/* CTA section */}
|
104
|
+
{isMobile && isIOS ? (
|
105
|
+
<>
|
106
|
+
<Button onClick={() => window.location.reload()} css={{ w: '100%', mb: '$6' }}>
|
107
|
+
Reload
|
108
|
+
</Button>
|
109
|
+
<Button outlined variant="standard" onClick={() => setDeviceType('')} css={{ w: '100%' }}>
|
110
|
+
Continue anyway
|
111
|
+
</Button>
|
112
|
+
</>
|
113
|
+
) : null}
|
114
|
+
|
115
|
+
{isMobile && isAndroid ? (
|
116
|
+
showAndroidPrompt ? (
|
117
|
+
<Button
|
118
|
+
css={{ w: '100%' }}
|
119
|
+
onClick={() => {
|
120
|
+
setDeviceType('');
|
121
|
+
setShowAndroidPrompt(false);
|
122
|
+
}}
|
123
|
+
>
|
124
|
+
Continue
|
125
|
+
</Button>
|
126
|
+
) : (
|
127
|
+
<>
|
128
|
+
<Button onClick={() => setDeviceType('')} css={{ w: '100%', mb: '$6' }}>
|
129
|
+
I've allowed access
|
130
|
+
</Button>
|
131
|
+
<Button outlined variant="standard" onClick={() => setDeviceType('')} css={{ w: '100%' }}>
|
132
|
+
Continue anyway
|
133
|
+
</Button>
|
134
|
+
</>
|
135
|
+
)
|
136
|
+
) : null}
|
137
|
+
|
138
|
+
{!isMobile ? (
|
139
|
+
<Flex justify="end" css={{ w: '100%' }}>
|
140
|
+
<Button outlined variant="standard" onClick={() => setDeviceType('')}>
|
141
|
+
Dismiss
|
142
|
+
</Button>
|
143
|
+
</Flex>
|
144
|
+
) : null}
|
63
145
|
</Dialog.Content>
|
64
146
|
</Dialog.Portal>
|
65
147
|
</Dialog.Root>
|
@@ -58,7 +58,7 @@ export const ReconnectNotifications = () => {
|
|
58
58
|
<div style={{ display: 'inline', margin: '0.25rem' }}>
|
59
59
|
<Loading size={16} />
|
60
60
|
</div>
|
61
|
-
<Text css={{ fontSize: '$space$8', color: '$
|
61
|
+
<Text css={{ fontSize: '$space$8', color: '$on_surface_high' }}>
|
62
62
|
You lost your network connection. Trying to reconnect.
|
63
63
|
</Text>
|
64
64
|
</Flex>
|
@@ -5,12 +5,12 @@ function setPIPCanvasColors() {
|
|
5
5
|
if (!CANVAS_FILL_COLOR) {
|
6
6
|
CANVAS_FILL_COLOR = window
|
7
7
|
.getComputedStyle(document.documentElement)
|
8
|
-
.getPropertyValue('--hms-ui-colors-
|
8
|
+
.getPropertyValue('--hms-ui-colors-surface_bright');
|
9
9
|
}
|
10
10
|
if (!CANVAS_STROKE_COLOR) {
|
11
11
|
CANVAS_STROKE_COLOR = window
|
12
12
|
.getComputedStyle(document.documentElement)
|
13
|
-
.getPropertyValue('--hms-ui-colors-
|
13
|
+
.getPropertyValue('--hms-ui-colors-border_bright');
|
14
14
|
}
|
15
15
|
}
|
16
16
|
|
@@ -68,16 +68,16 @@ export const Playlist = ({ type }) => {
|
|
68
68
|
maxHeight: 'unset',
|
69
69
|
width: '$60',
|
70
70
|
p: '$0',
|
71
|
-
bg: '$
|
72
|
-
border: '1px solid $
|
71
|
+
bg: '$surface_bright',
|
72
|
+
border: '1px solid $border_default',
|
73
73
|
}}
|
74
74
|
>
|
75
75
|
<Flex
|
76
76
|
align="center"
|
77
77
|
css={{
|
78
78
|
p: '$4 $8',
|
79
|
-
borderBottom: '1px solid $
|
80
|
-
bg: '$
|
79
|
+
borderBottom: '1px solid $border_bright',
|
80
|
+
bg: '$surface_default',
|
81
81
|
}}
|
82
82
|
>
|
83
83
|
<Text variant="md" css={{ flex: '1 1 0' }}>
|
@@ -103,7 +103,7 @@ const VolumeControl = () => {
|
|
103
103
|
const sliderVolume = active ? volume : audioTrackVolume;
|
104
104
|
|
105
105
|
return (
|
106
|
-
<Flex align="center" css={{ color: '$
|
106
|
+
<Flex align="center" css={{ color: '$on_primary_high' }}>
|
107
107
|
<SpeakerIcon />
|
108
108
|
<Slider
|
109
109
|
css={{ mx: '$4', w: '$20' }}
|
@@ -134,8 +134,8 @@ export const AudioPlaylistControls = ({ onToggle }) => {
|
|
134
134
|
<Box
|
135
135
|
css={{
|
136
136
|
p: '$8',
|
137
|
-
borderTop: '1px solid $
|
138
|
-
bg: '$
|
137
|
+
borderTop: '1px solid $border_bright',
|
138
|
+
bg: '$surface_default',
|
139
139
|
}}
|
140
140
|
>
|
141
141
|
<Controls type={HMSPlaylistType.audio} />
|
@@ -27,16 +27,16 @@ export const PlaylistItem = React.memo(({ name, metadata, duration, selected, on
|
|
27
27
|
p: '$8',
|
28
28
|
'&:hover': {
|
29
29
|
cursor: 'pointer',
|
30
|
-
bg: '$
|
30
|
+
bg: '$surface_default',
|
31
31
|
},
|
32
32
|
'&:focus-visible': {
|
33
|
-
bg: '$
|
33
|
+
bg: '$surface_default',
|
34
34
|
},
|
35
35
|
}}
|
36
36
|
onClick={onClick}
|
37
37
|
>
|
38
38
|
<Flex align="center" justify="between" css={{ width: '100%', minHeight: 0 }}>
|
39
|
-
<Text variant="md" css={{ color: selected ? '$
|
39
|
+
<Text variant="md" css={{ color: selected ? '$primary_default' : '$on_primary_high' }}>
|
40
40
|
{name}
|
41
41
|
</Text>
|
42
42
|
<Text variant="xs">{formatDuration(duration)}</Text>
|
@@ -34,16 +34,16 @@ export const VideoPlayer = React.memo(({ peerId }) => {
|
|
34
34
|
justify="between"
|
35
35
|
align="center"
|
36
36
|
css={{
|
37
|
-
bg: '$
|
37
|
+
bg: '$surface_default',
|
38
38
|
p: '$2 $2 $2 $6',
|
39
39
|
borderTopLeftRadius: '$1',
|
40
40
|
borderTopRightRadius: '$1',
|
41
41
|
}}
|
42
42
|
>
|
43
|
-
<Text css={{ color: '$
|
43
|
+
<Text css={{ color: '$on_primary_high' }}>{active.name}</Text>
|
44
44
|
<IconButton
|
45
45
|
css={{
|
46
|
-
color: '$
|
46
|
+
color: '$on_primary_high',
|
47
47
|
}}
|
48
48
|
onClick={() => {
|
49
49
|
hmsActions.videoPlaylist.stop();
|
@@ -80,7 +80,7 @@ export const VideoPlayer = React.memo(({ peerId }) => {
|
|
80
80
|
<IconButton
|
81
81
|
onClick={() => toggle()}
|
82
82
|
css={{
|
83
|
-
color: '$
|
83
|
+
color: '$on_primary_high',
|
84
84
|
height: 'max-content',
|
85
85
|
alignSelf: 'center',
|
86
86
|
cursor: 'pointer',
|
@@ -26,18 +26,18 @@ const PostLeave = () => {
|
|
26
26
|
justify="center"
|
27
27
|
direction="column"
|
28
28
|
align="center"
|
29
|
-
css={{ bg: '$
|
29
|
+
css={{ bg: '$background_dim', flex: '1 1 0', position: 'relative' }}
|
30
30
|
>
|
31
31
|
<Text variant="h2" css={{ fontWeight: '$semiBold' }}>
|
32
32
|
👋
|
33
33
|
</Text>
|
34
|
-
<Text variant="h4" css={{ color: '$
|
34
|
+
<Text variant="h4" css={{ color: '$on_surface_high', fontWeight: '$semiBold', mt: '$12' }}>
|
35
35
|
You left the {getRoutePrefix() ? 'stream' : 'room'}
|
36
36
|
</Text>
|
37
37
|
<Text
|
38
38
|
variant="body1"
|
39
39
|
css={{
|
40
|
-
color: '$
|
40
|
+
color: '$on_surface_medium',
|
41
41
|
mt: '$8',
|
42
42
|
fontWeight: '$regular',
|
43
43
|
textAlign: 'center',
|
@@ -52,7 +52,7 @@ const PostLeave = () => {
|
|
52
52
|
!
|
53
53
|
</Text>
|
54
54
|
<Flex css={{ mt: '$14', gap: '$10', alignItems: 'center' }}>
|
55
|
-
<Text variant="body1" css={{ color: '$
|
55
|
+
<Text variant="body1" css={{ color: '$on_surface_medium', fontWeight: '$regular' }}>
|
56
56
|
Left by mistake?
|
57
57
|
</Text>
|
58
58
|
<Button
|
@@ -1,8 +1,10 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { useParams } from 'react-router-dom';
|
3
3
|
import { useSearchParam } from 'react-use';
|
4
|
-
import {
|
4
|
+
import { HMSRoomState, selectRoomState, useHMSStore } from '@100mslive/react-sdk';
|
5
|
+
import { Box, Flex } from '../../../';
|
5
6
|
import SidePane from '../../layouts/SidePane';
|
7
|
+
import FullPageProgress from '../FullPageProgress';
|
6
8
|
import { Header } from '../Header';
|
7
9
|
import PreviewJoin from './PreviewJoin';
|
8
10
|
import { useAuthToken } from '../AppData/useUISettings';
|
@@ -18,6 +20,9 @@ const PreviewContainer = () => {
|
|
18
20
|
const { roomId: urlRoomId, role: userRole } = useParams(); // from the url
|
19
21
|
const authToken = useAuthToken();
|
20
22
|
|
23
|
+
const roomState = useHMSStore(selectRoomState);
|
24
|
+
const isPreview = roomState === HMSRoomState.Preview;
|
25
|
+
|
21
26
|
const onJoin = () => {
|
22
27
|
let meetingURL = `/meeting/${urlRoomId}`;
|
23
28
|
if (userRole) {
|
@@ -27,14 +32,20 @@ const PreviewContainer = () => {
|
|
27
32
|
};
|
28
33
|
return (
|
29
34
|
<Flex direction="column" css={{ size: '100%' }}>
|
30
|
-
|
31
|
-
<
|
32
|
-
|
33
|
-
|
35
|
+
{isPreview ? null : (
|
36
|
+
<Box css={{ h: '$18', '@md': { h: '$17', flexShrink: 0 } }} data-testid="header">
|
37
|
+
<Header />
|
38
|
+
</Box>
|
39
|
+
)}
|
40
|
+
<Flex
|
41
|
+
css={{ flex: '1 1 0', position: 'relative', overflowY: 'auto', color: '$primary_default' }}
|
42
|
+
justify="center"
|
43
|
+
align="center"
|
44
|
+
>
|
34
45
|
{authToken ? (
|
35
46
|
<PreviewJoin initialName={initialName} skipPreview={skipPreview} asRole={previewAsRole} onJoin={onJoin} />
|
36
47
|
) : (
|
37
|
-
<
|
48
|
+
<FullPageProgress />
|
38
49
|
)}
|
39
50
|
<SidePane
|
40
51
|
css={{
|
@@ -0,0 +1,74 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useMedia } from 'react-use';
|
3
|
+
import { JoinForm_JoinBtnType } from '@100mslive/types-prebuilt/elements/join_form';
|
4
|
+
import { selectPermissions, useHMSStore, useRecordingStreaming } from '@100mslive/react-sdk';
|
5
|
+
import { RadioIcon } from '@100mslive/react-icons';
|
6
|
+
import { Button, config as cssConfig, Flex, Input, styled } from '../../..';
|
7
|
+
import { useRoomLayout } from '../../provider/roomLayoutProvider';
|
8
|
+
import { PreviewSettings } from './PreviewJoin';
|
9
|
+
|
10
|
+
const PreviewForm = ({
|
11
|
+
name,
|
12
|
+
onChange,
|
13
|
+
onJoin,
|
14
|
+
enableJoin,
|
15
|
+
cannotPublishVideo = false,
|
16
|
+
cannotPublishAudio = false,
|
17
|
+
}) => {
|
18
|
+
const formSubmit = e => {
|
19
|
+
e.preventDefault();
|
20
|
+
};
|
21
|
+
const mediaQueryLg = cssConfig.media.md;
|
22
|
+
const isMobile = useMedia(mediaQueryLg);
|
23
|
+
const { isHLSRunning } = useRecordingStreaming();
|
24
|
+
const permissions = useHMSStore(selectPermissions);
|
25
|
+
const layout = useRoomLayout();
|
26
|
+
const { join_form: joinForm = {} } = layout?.screens?.preview?.default?.elements || {};
|
27
|
+
const showGoLive =
|
28
|
+
joinForm.join_btn_type === JoinForm_JoinBtnType.JOIN_BTN_TYPE_JOIN_AND_GO_LIVE &&
|
29
|
+
!isHLSRunning &&
|
30
|
+
permissions?.hlsStreaming;
|
31
|
+
|
32
|
+
return (
|
33
|
+
<Form
|
34
|
+
css={{ flexDirection: cannotPublishVideo ? 'column' : 'row', '@md': { flexDirection: 'row' } }}
|
35
|
+
onSubmit={formSubmit}
|
36
|
+
>
|
37
|
+
<Flex align="center" css={{ gap: '$8', w: '100%' }}>
|
38
|
+
<Input
|
39
|
+
required
|
40
|
+
id="name"
|
41
|
+
css={{ w: '100%', boxSizing: 'border-box' }}
|
42
|
+
value={name}
|
43
|
+
onChange={e => onChange(e.target.value.trimStart())}
|
44
|
+
placeholder="Enter name"
|
45
|
+
autoFocus
|
46
|
+
autoComplete="name"
|
47
|
+
/>
|
48
|
+
{cannotPublishAudio && cannotPublishVideo && !isMobile ? <PreviewSettings /> : null}
|
49
|
+
</Flex>
|
50
|
+
|
51
|
+
{Object.keys(joinForm).length > 0 ? (
|
52
|
+
<Button type="submit" icon disabled={!name || !enableJoin} onClick={onJoin}>
|
53
|
+
{/* Conditions to show go live: The first broadcaster joins a streaming kit that is not live */}
|
54
|
+
{showGoLive ? <RadioIcon height={18} width={18} /> : null}
|
55
|
+
{showGoLive ? joinForm.go_live_btn_label : joinForm.join_btn_label}
|
56
|
+
</Button>
|
57
|
+
) : null}
|
58
|
+
</Form>
|
59
|
+
);
|
60
|
+
};
|
61
|
+
|
62
|
+
const Form = styled('form', {
|
63
|
+
width: '100%',
|
64
|
+
display: 'flex',
|
65
|
+
alignItems: 'center',
|
66
|
+
gap: '$8',
|
67
|
+
mt: '$10',
|
68
|
+
mb: '$10',
|
69
|
+
'@md': {
|
70
|
+
gap: '$4',
|
71
|
+
},
|
72
|
+
});
|
73
|
+
|
74
|
+
export default PreviewForm;
|