@100mslive/roomkit-react 0.3.18-alpha.1 → 0.3.19-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-PDIKZHHT.css → HLSView-6CQOPAJJ.css} +3 -3
- package/dist/{HLSView-PDIKZHHT.css.map → HLSView-6CQOPAJJ.css.map} +1 -1
- package/dist/{HLSView-ZNO3JMRM.js → HLSView-LJQ65VXH.js} +2 -2
- package/dist/Prebuilt/components/AuthToken.d.ts +17 -0
- package/dist/Prebuilt/components/Header/StreamActions.d.ts +5 -0
- package/dist/{chunk-JNJ2XTDI.js → chunk-O3I4DN7I.js} +3619 -3676
- package/dist/chunk-O3I4DN7I.js.map +7 -0
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +3045 -3109
- 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 +276 -369
- package/dist/meta.esbuild.json +293 -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/PIPChatOption.tsx +1 -1
- package/dist/chunk-JNJ2XTDI.js.map +0 -7
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +0 -118
- /package/dist/{HLSView-ZNO3JMRM.js.map → HLSView-LJQ65VXH.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
|