@100mslive/roomkit-react 0.3.18 → 0.3.19-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-DC5IFLGP.js → HLSView-6KUW45BA.js} +2 -2
- package/dist/{HLSView-43CZZXAA.css → HLSView-MI7WHLIB.css} +3 -3
- package/dist/{HLSView-43CZZXAA.css.map → HLSView-MI7WHLIB.css.map} +1 -1
- package/dist/Prebuilt/components/AuthToken.d.ts +17 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +5 -0
- package/dist/{chunk-MTOOCG7G.js → chunk-NC3PKPDD.js} +3738 -3775
- package/dist/chunk-NC3PKPDD.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +3003 -3048
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +290 -368
- package/dist/meta.esbuild.json +308 -386
- package/package.json +7 -7
- package/src/Prebuilt/App.tsx +5 -1
- package/src/Prebuilt/AppStateContext.tsx +5 -2
- package/src/Prebuilt/components/{AuthToken.jsx → AuthToken.tsx} +34 -12
- package/src/Prebuilt/components/Header/StreamActions.tsx +24 -3
- package/src/Prebuilt/components/MoreSettings/SplitComponents/DesktopOptions.tsx +2 -1
- package/src/Prebuilt/components/PIP/PIPChat.tsx +14 -2
- package/src/Prebuilt/components/PIP/PIPChatOption.tsx +1 -1
- package/src/Prebuilt/components/VirtualBackground/VBToggle.tsx +14 -1
- package/dist/chunk-MTOOCG7G.js.map +0 -7
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +0 -118
- /package/dist/{HLSView-DC5IFLGP.js.map → HLSView-6KUW45BA.js.map} +0 -0
@@ -1,118 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react';
|
2
|
-
import { selectLocalPeerID, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
|
3
|
-
import { ChevronDownIcon, ChevronUpIcon, MusicIcon, ShareScreenIcon, VideoPlayerIcon } from '@100mslive/react-icons';
|
4
|
-
import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
|
5
|
-
import { useUISettings } from '../AppData/useUISettings';
|
6
|
-
import { useScreenshareAudio } from '../hooks/useScreenshareAudio';
|
7
|
-
import { UI_SETTINGS } from '../../common/constants';
|
8
|
-
|
9
|
-
export const getRecordingText = ({ isBrowserRecordingOn, isServerRecordingOn, isHLSRecordingOn }, delimiter = ', ') => {
|
10
|
-
if (!isBrowserRecordingOn && !isServerRecordingOn && !isHLSRecordingOn) {
|
11
|
-
return '';
|
12
|
-
}
|
13
|
-
const title = [];
|
14
|
-
if (isBrowserRecordingOn) {
|
15
|
-
title.push('Browser');
|
16
|
-
}
|
17
|
-
if (isServerRecordingOn) {
|
18
|
-
title.push('Server');
|
19
|
-
}
|
20
|
-
if (isHLSRecordingOn) {
|
21
|
-
title.push('HLS');
|
22
|
-
}
|
23
|
-
return title.join(delimiter);
|
24
|
-
};
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Display state of recording, streaming, playlist, whiteboard
|
28
|
-
*/
|
29
|
-
export const AdditionalRoomState = () => {
|
30
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
31
|
-
const screenshareAudio = useScreenshareAudio();
|
32
|
-
const [open, setOpen] = useState(false);
|
33
|
-
const isAudioshareInactive = [
|
34
|
-
!screenshareAudio.peer || !screenshareAudio.track,
|
35
|
-
!screenshareAudio.peer?.isLocal && !screenshareAudio.track?.enabled,
|
36
|
-
].some(Boolean);
|
37
|
-
|
38
|
-
const localPeerID = useHMSStore(selectLocalPeerID);
|
39
|
-
const { screenSharingPeerName, screenSharingPeerId, screenShareVideoTrackId } = useScreenShare();
|
40
|
-
|
41
|
-
const isVideoScreenSharingOn = !!screenShareVideoTrackId;
|
42
|
-
const shouldShowScreenShareState = isAudioOnly && isVideoScreenSharingOn;
|
43
|
-
const shouldShowVideoState = isAudioOnly;
|
44
|
-
if (isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState) {
|
45
|
-
return null;
|
46
|
-
}
|
47
|
-
|
48
|
-
return (
|
49
|
-
<Dropdown.Root open={open} onOpenChange={setOpen}>
|
50
|
-
<Dropdown.Trigger asChild>
|
51
|
-
<Flex
|
52
|
-
align="center"
|
53
|
-
css={{
|
54
|
-
color: '$on_primary_high',
|
55
|
-
borderRadius: '$1',
|
56
|
-
border: '1px solid $on_surface_low',
|
57
|
-
padding: '$4',
|
58
|
-
'@sm': { display: 'none' },
|
59
|
-
}}
|
60
|
-
data-testid="record_status_dropdown"
|
61
|
-
>
|
62
|
-
{!isAudioshareInactive && (
|
63
|
-
<Tooltip title="Screenshare Audio">
|
64
|
-
<Flex align="center" css={{ color: '$on_primary_high', mx: '$2' }}>
|
65
|
-
<MusicIcon width={24} height={24} />
|
66
|
-
</Flex>
|
67
|
-
</Tooltip>
|
68
|
-
)}
|
69
|
-
{shouldShowScreenShareState && (
|
70
|
-
<Tooltip title="Screenshare">
|
71
|
-
<Flex align="center" css={{ color: '$on_primary_high', mx: '$2' }}>
|
72
|
-
<ShareScreenIcon width={24} height={24} />
|
73
|
-
</Flex>
|
74
|
-
</Tooltip>
|
75
|
-
)}
|
76
|
-
{shouldShowVideoState && (
|
77
|
-
<Tooltip title="video playlist">
|
78
|
-
<Flex align="center" css={{ color: '$on_primary_high', mx: '$2' }}>
|
79
|
-
<VideoPlayerIcon width={24} height={24} />
|
80
|
-
</Flex>
|
81
|
-
</Tooltip>
|
82
|
-
)}
|
83
|
-
<Box css={{ '@lg': { display: 'none' }, color: '$on_surface_low' }}>
|
84
|
-
{open ? <ChevronUpIcon /> : <ChevronDownIcon />}
|
85
|
-
</Box>
|
86
|
-
</Flex>
|
87
|
-
</Dropdown.Trigger>
|
88
|
-
<Dropdown.Content sideOffset={5} align="end" css={{ w: '$60' }}>
|
89
|
-
{!isAudioshareInactive && (
|
90
|
-
<Dropdown.Item css={{ color: '$on_primary_high' }}>
|
91
|
-
<MusicIcon width={24} height={24} />
|
92
|
-
<Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
|
93
|
-
Music is playing
|
94
|
-
</Text>
|
95
|
-
<Text
|
96
|
-
variant="sm"
|
97
|
-
css={{ color: '$alert_error_default', ml: '$2', cursor: 'pointer' }}
|
98
|
-
onClick={e => {
|
99
|
-
e.preventDefault();
|
100
|
-
screenshareAudio.onToggle();
|
101
|
-
}}
|
102
|
-
>
|
103
|
-
{screenshareAudio.muted ? 'Unmute' : 'Mute'}
|
104
|
-
</Text>
|
105
|
-
</Dropdown.Item>
|
106
|
-
)}
|
107
|
-
{shouldShowScreenShareState && (
|
108
|
-
<Dropdown.Item css={{ color: '$on_primary_high' }}>
|
109
|
-
<ShareScreenIcon width={24} height={24} />
|
110
|
-
<Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
|
111
|
-
{`Shared by: ${screenSharingPeerId === localPeerID ? 'You' : screenSharingPeerName}`}
|
112
|
-
</Text>
|
113
|
-
</Dropdown.Item>
|
114
|
-
)}
|
115
|
-
</Dropdown.Content>
|
116
|
-
</Dropdown.Root>
|
117
|
-
);
|
118
|
-
};
|
File without changes
|