@100mslive/roomkit-react 0.3.14-alpha.11 → 0.3.14-alpha.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-72D4HXOZ.js → HLSView-6X6A7QVC.js} +2 -2
- package/dist/{HLSView-X4TA7M5M.css → HLSView-J7FHXBEW.css} +3 -3
- package/dist/{HLSView-X4TA7M5M.css.map → HLSView-J7FHXBEW.css.map} +1 -1
- package/dist/{chunk-OZVDS5TG.js → chunk-2VGMEGOM.js} +460 -511
- package/dist/{chunk-OZVDS5TG.js.map → chunk-2VGMEGOM.js.map} +4 -4
- package/dist/index.cjs.css +2 -2
- package/dist/index.cjs.css.map +1 -1
- package/dist/index.cjs.js +2220 -2265
- 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 +21 -65
- package/dist/meta.esbuild.json +33 -77
- package/package.json +8 -7
- package/src/Prebuilt/components/Chat/ChatBody.tsx +23 -8
- package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +4 -66
- package/dist/Prebuilt/components/HMSVideo/PlayButton.d.ts +0 -6
- package/dist/Prebuilt/components/Polls/common/VoterList.d.ts +0 -4
- package/src/Prebuilt/common/roles.js +0 -4
- package/src/Prebuilt/components/AppData/useAppConfig.js +0 -7
- package/src/Prebuilt/components/HMSVideo/PlayButton.tsx +0 -27
- package/src/Prebuilt/components/Header/AmbientMusic.jsx +0 -88
- package/src/Prebuilt/components/Image.jsx +0 -7
- package/src/Prebuilt/components/MetaActions.jsx +0 -37
- package/src/Prebuilt/components/Playlist/Playlist.jsx +0 -124
- package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +0 -172
- package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +0 -51
- package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +0 -95
- package/src/Prebuilt/components/Polls/CreatePollQuiz/Timer.jsx +0 -71
- package/src/Prebuilt/components/Polls/common/VoterList.tsx +0 -22
- package/src/Prebuilt/components/ScreenshareHintModal.jsx +0 -37
- /package/dist/{HLSView-72D4HXOZ.js.map → HLSView-6X6A7QVC.js.map} +0 -0
@@ -1,37 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { selectIsConnectedToRoom, useHMSStore } from '@100mslive/react-sdk';
|
3
|
-
import { BrbIcon, HandIcon } from '@100mslive/react-icons';
|
4
|
-
import { Flex } from '../../Layout';
|
5
|
-
import { Tooltip } from '../../Tooltip';
|
6
|
-
import IconButton from '../IconButton';
|
7
|
-
import { useMyMetadata } from './hooks/useMetadata';
|
8
|
-
|
9
|
-
const MetaActions = ({ isMobile = false, compact = false }) => {
|
10
|
-
const isConnected = useHMSStore(selectIsConnectedToRoom);
|
11
|
-
const { isHandRaised, isBRBOn, toggleHandRaise, toggleBRB } = useMyMetadata();
|
12
|
-
|
13
|
-
if (!isConnected) {
|
14
|
-
return null;
|
15
|
-
}
|
16
|
-
|
17
|
-
return (
|
18
|
-
<Flex align="center" css={{ gap: compact ? '$4' : '$8' }}>
|
19
|
-
<Tooltip title={`${!isHandRaised ? 'Raise' : 'Unraise'} hand`}>
|
20
|
-
<IconButton
|
21
|
-
onClick={toggleHandRaise}
|
22
|
-
active={!isHandRaised}
|
23
|
-
data-testid={isMobile ? 'raise_hand_btn_mobile' : 'raise_hand_btn'}
|
24
|
-
>
|
25
|
-
<HandIcon />
|
26
|
-
</IconButton>
|
27
|
-
</Tooltip>
|
28
|
-
<Tooltip title={isBRBOn ? `I'm back` : `I'll be right back`}>
|
29
|
-
<IconButton onClick={toggleBRB} active={!isBRBOn} data-testid="brb_btn">
|
30
|
-
<BrbIcon />
|
31
|
-
</IconButton>
|
32
|
-
</Tooltip>
|
33
|
-
</Flex>
|
34
|
-
);
|
35
|
-
};
|
36
|
-
|
37
|
-
export default MetaActions;
|
@@ -1,124 +0,0 @@
|
|
1
|
-
import React, { Fragment, useState } from 'react';
|
2
|
-
import { HMSPlaylistType, selectIsAllowedToPublish, useHMSStore } from '@100mslive/react-sdk';
|
3
|
-
import { AudioPlayerIcon, CrossIcon, VideoPlayerIcon } from '@100mslive/react-icons';
|
4
|
-
import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
|
5
|
-
import IconButton from '../../IconButton';
|
6
|
-
import { AudioPlaylistControls } from './PlaylistControls';
|
7
|
-
import { PlaylistItem } from './PlaylistItem';
|
8
|
-
import { usePlaylist } from '../hooks/usePlaylist';
|
9
|
-
|
10
|
-
const BrowseAndPlayFromLocal = ({ type, actions }) => {
|
11
|
-
return (
|
12
|
-
<Fragment>
|
13
|
-
<Text as="label" htmlFor={`${type}PlaylistBrowse`} variant="sm" css={{ cursor: 'pointer', mr: '$2' }}>
|
14
|
-
Browse
|
15
|
-
</Text>
|
16
|
-
<input
|
17
|
-
type="file"
|
18
|
-
id={`${type}PlaylistBrowse`}
|
19
|
-
accept={type === HMSPlaylistType.audio ? 'audio/*' : 'video/*'}
|
20
|
-
onChange={e => {
|
21
|
-
const file = e.target.files[0];
|
22
|
-
const id = file.lastModified;
|
23
|
-
actions.setList([
|
24
|
-
{
|
25
|
-
type,
|
26
|
-
id,
|
27
|
-
name: file.name,
|
28
|
-
url: URL.createObjectURL(file),
|
29
|
-
},
|
30
|
-
]);
|
31
|
-
actions.play(id);
|
32
|
-
}}
|
33
|
-
style={{ display: 'none' }}
|
34
|
-
/>
|
35
|
-
</Fragment>
|
36
|
-
);
|
37
|
-
};
|
38
|
-
|
39
|
-
export const Playlist = ({ type }) => {
|
40
|
-
const isAudioPlaylist = type === HMSPlaylistType.audio;
|
41
|
-
const { active, list: playlist, actions } = usePlaylist(type);
|
42
|
-
const [open, setOpen] = useState(false);
|
43
|
-
const [collapse, setCollapse] = useState(false);
|
44
|
-
const isAllowedToPublish = useHMSStore(selectIsAllowedToPublish);
|
45
|
-
if (!isAllowedToPublish.screen || playlist.length === 0) {
|
46
|
-
return null;
|
47
|
-
}
|
48
|
-
|
49
|
-
return (
|
50
|
-
<Fragment>
|
51
|
-
<Dropdown.Root open={open} onOpenChange={setOpen}>
|
52
|
-
<Dropdown.Trigger asChild data-testid={type === HMSPlaylistType.audio ? 'audio_playlist' : 'video_playlist'}>
|
53
|
-
<IconButton active={!active}>
|
54
|
-
<Tooltip title={isAudioPlaylist ? 'Audio Playlist' : 'Video Playlist'}>
|
55
|
-
<Box>{isAudioPlaylist ? <AudioPlayerIcon /> : <VideoPlayerIcon />}</Box>
|
56
|
-
</Tooltip>
|
57
|
-
</IconButton>
|
58
|
-
</Dropdown.Trigger>
|
59
|
-
<Dropdown.Content
|
60
|
-
sideOffset={5}
|
61
|
-
align="center"
|
62
|
-
css={{
|
63
|
-
maxHeight: 'unset',
|
64
|
-
width: '$60',
|
65
|
-
p: '$0',
|
66
|
-
bg: '$surface_bright',
|
67
|
-
border: '1px solid $border_default',
|
68
|
-
}}
|
69
|
-
>
|
70
|
-
<Flex
|
71
|
-
align="center"
|
72
|
-
css={{
|
73
|
-
p: '$4 $8',
|
74
|
-
borderBottom: '1px solid $border_bright',
|
75
|
-
bg: '$surface_default',
|
76
|
-
}}
|
77
|
-
>
|
78
|
-
<Text variant="md" css={{ flex: '1 1 0' }}>
|
79
|
-
{isAudioPlaylist ? 'Audio Player' : 'Video Playlist'}
|
80
|
-
</Text>
|
81
|
-
<BrowseAndPlayFromLocal type={type} actions={actions} />
|
82
|
-
<IconButton
|
83
|
-
css={{ mr: '-$4' }}
|
84
|
-
onClick={async () => {
|
85
|
-
if (active) {
|
86
|
-
await actions.stop();
|
87
|
-
}
|
88
|
-
setOpen(false);
|
89
|
-
setCollapse(false);
|
90
|
-
}}
|
91
|
-
>
|
92
|
-
<CrossIcon width={24} height={24} />
|
93
|
-
</IconButton>
|
94
|
-
</Flex>
|
95
|
-
{!collapse && (
|
96
|
-
<Box css={{ maxHeight: '$96', overflowY: 'auto' }}>
|
97
|
-
{playlist.map(playlistItem => {
|
98
|
-
return (
|
99
|
-
<PlaylistItem
|
100
|
-
key={playlistItem.id}
|
101
|
-
{...playlistItem}
|
102
|
-
onClick={async e => {
|
103
|
-
e.preventDefault();
|
104
|
-
try {
|
105
|
-
await actions.play(playlistItem.id);
|
106
|
-
} catch (e) {
|
107
|
-
// error in playlist, stop or play next
|
108
|
-
}
|
109
|
-
// Close the dropdown list for videoplaylist
|
110
|
-
if (!isAudioPlaylist) {
|
111
|
-
setOpen(false);
|
112
|
-
}
|
113
|
-
}}
|
114
|
-
/>
|
115
|
-
);
|
116
|
-
})}
|
117
|
-
</Box>
|
118
|
-
)}
|
119
|
-
{isAudioPlaylist && <AudioPlaylistControls onToggle={() => setCollapse(value => !value)} />}
|
120
|
-
</Dropdown.Content>
|
121
|
-
</Dropdown.Root>
|
122
|
-
</Fragment>
|
123
|
-
);
|
124
|
-
};
|
@@ -1,172 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import {
|
3
|
-
HMSPlaylistType,
|
4
|
-
selectAudioPlaylist,
|
5
|
-
selectAudioTrackVolume,
|
6
|
-
selectPeerSharingVideoPlaylist,
|
7
|
-
selectVideoPlaylist,
|
8
|
-
selectVideoPlaylistAudioTrackByPeerID,
|
9
|
-
useHMSActions,
|
10
|
-
useHMSStore,
|
11
|
-
} from '@100mslive/react-sdk';
|
12
|
-
import { NextIcon, PauseIcon, PlayIcon, PlaylistIcon, PrevIcon, SpeakerIcon } from '@100mslive/react-icons';
|
13
|
-
import { Box, Flex, IconButton, Slider, Text } from '../../../';
|
14
|
-
import { usePlaylist } from '../hooks/usePlaylist';
|
15
|
-
|
16
|
-
const Progress = ({ type, duration }) => {
|
17
|
-
const selectPlaylist = type === HMSPlaylistType.audio ? selectAudioPlaylist : selectVideoPlaylist;
|
18
|
-
const progress = useHMSStore(selectPlaylist.progress);
|
19
|
-
const hmsActions = useHMSActions();
|
20
|
-
const playlistAction = type === HMSPlaylistType.audio ? hmsActions.audioPlaylist : hmsActions.videoPlaylist;
|
21
|
-
|
22
|
-
if (!duration) {
|
23
|
-
return null;
|
24
|
-
}
|
25
|
-
|
26
|
-
return (
|
27
|
-
<Slider
|
28
|
-
step={1}
|
29
|
-
value={[progress]}
|
30
|
-
onValueChange={e => {
|
31
|
-
playlistAction.seekTo(e[0] * 0.01 * duration);
|
32
|
-
}}
|
33
|
-
/>
|
34
|
-
);
|
35
|
-
};
|
36
|
-
|
37
|
-
export const PlaylistActive = ({ type, onToggle }) => {
|
38
|
-
const isAudioPlaylist = type === HMSPlaylistType.audio;
|
39
|
-
const selector = isAudioPlaylist ? selectAudioPlaylist : selectVideoPlaylist;
|
40
|
-
const active = useHMSStore(selector.selectedItem);
|
41
|
-
if (!active) {
|
42
|
-
return null;
|
43
|
-
}
|
44
|
-
return (
|
45
|
-
<Box css={{ mt: '$8' }}>
|
46
|
-
<Flex justify="between" css={{ w: '100%' }}>
|
47
|
-
<Box>
|
48
|
-
<Text variant="md">{active.name}</Text>
|
49
|
-
{active.metadata?.description && <Text variant="xs">{active.metadata?.description}</Text>}
|
50
|
-
</Box>
|
51
|
-
<IconButton onClick={onToggle} css={{ alignSelf: 'center' }} data-testid="playlist_collapse_btn">
|
52
|
-
<PlaylistIcon />
|
53
|
-
</IconButton>
|
54
|
-
</Flex>
|
55
|
-
</Box>
|
56
|
-
);
|
57
|
-
};
|
58
|
-
|
59
|
-
const Controls = ({ type, css = {} }) => {
|
60
|
-
const { active, hasNext, hasPrevious, actions } = usePlaylist(type);
|
61
|
-
if (!active) {
|
62
|
-
return null;
|
63
|
-
}
|
64
|
-
return (
|
65
|
-
<Flex justify="center" css={css}>
|
66
|
-
<IconButton
|
67
|
-
disabled={!hasPrevious}
|
68
|
-
onClick={() => {
|
69
|
-
actions.playPrevious();
|
70
|
-
}}
|
71
|
-
data-testid="playlist_prev_btn"
|
72
|
-
>
|
73
|
-
<PrevIcon />
|
74
|
-
</IconButton>
|
75
|
-
<IconButton
|
76
|
-
onClick={() => {
|
77
|
-
active.playing ? actions.pause() : actions.play(active.id);
|
78
|
-
}}
|
79
|
-
data-testid="playlist_play_pause_btn"
|
80
|
-
>
|
81
|
-
{active.playing ? <PauseIcon width={32} height={32} /> : <PlayIcon width={32} height={32} />}
|
82
|
-
</IconButton>
|
83
|
-
<IconButton
|
84
|
-
disabled={!hasNext}
|
85
|
-
onClick={() => {
|
86
|
-
actions.playNext();
|
87
|
-
}}
|
88
|
-
data-testid="playlist_next_btn"
|
89
|
-
>
|
90
|
-
<NextIcon />
|
91
|
-
</IconButton>
|
92
|
-
</Flex>
|
93
|
-
);
|
94
|
-
};
|
95
|
-
|
96
|
-
const VolumeControl = () => {
|
97
|
-
const hmsActions = useHMSActions();
|
98
|
-
const volume = useHMSStore(selectVideoPlaylist.volume);
|
99
|
-
const active = useHMSStore(selectVideoPlaylist.selectedItem);
|
100
|
-
const peerSharingPlaylist = useHMSStore(selectPeerSharingVideoPlaylist);
|
101
|
-
const audioTrack = useHMSStore(selectVideoPlaylistAudioTrackByPeerID(peerSharingPlaylist?.id));
|
102
|
-
const audioTrackVolume = useHMSStore(selectAudioTrackVolume(audioTrack?.id));
|
103
|
-
const sliderVolume = active ? volume : audioTrackVolume;
|
104
|
-
|
105
|
-
return (
|
106
|
-
<Flex align="center" css={{ color: '$on_primary_high' }}>
|
107
|
-
<SpeakerIcon />
|
108
|
-
<Slider
|
109
|
-
css={{ mx: '$4', w: '$20' }}
|
110
|
-
min={0}
|
111
|
-
max={100}
|
112
|
-
step={1}
|
113
|
-
value={[Math.floor(sliderVolume ?? 100)]}
|
114
|
-
onValueChange={e => {
|
115
|
-
const value = e[0];
|
116
|
-
if (active) {
|
117
|
-
hmsActions.videoPlaylist.setVolume(value);
|
118
|
-
} else if (audioTrack) {
|
119
|
-
hmsActions.setVolume(value, audioTrack.id);
|
120
|
-
}
|
121
|
-
}}
|
122
|
-
thumbStyles={{ w: '$6', h: '$6' }}
|
123
|
-
/>
|
124
|
-
</Flex>
|
125
|
-
);
|
126
|
-
};
|
127
|
-
|
128
|
-
export const AudioPlaylistControls = ({ onToggle }) => {
|
129
|
-
const { active } = usePlaylist(HMSPlaylistType.audio);
|
130
|
-
if (!active) {
|
131
|
-
return null;
|
132
|
-
}
|
133
|
-
return (
|
134
|
-
<Box
|
135
|
-
css={{
|
136
|
-
p: '$8',
|
137
|
-
borderTop: '1px solid $border_bright',
|
138
|
-
bg: '$surface_default',
|
139
|
-
}}
|
140
|
-
>
|
141
|
-
<Controls type={HMSPlaylistType.audio} />
|
142
|
-
<Progress type={HMSPlaylistType.audio} duration={active.duration} />
|
143
|
-
<PlaylistActive type={HMSPlaylistType.audio} onToggle={onToggle} />
|
144
|
-
</Box>
|
145
|
-
);
|
146
|
-
};
|
147
|
-
|
148
|
-
export const VideoPlaylistControls = ({ children }) => {
|
149
|
-
const { active } = usePlaylist(HMSPlaylistType.video);
|
150
|
-
|
151
|
-
return (
|
152
|
-
<Box
|
153
|
-
css={{
|
154
|
-
p: '$8',
|
155
|
-
mt: '-$24',
|
156
|
-
w: '100%',
|
157
|
-
zIndex: 1,
|
158
|
-
'@lg': {
|
159
|
-
mt: 0,
|
160
|
-
p: '$6',
|
161
|
-
},
|
162
|
-
}}
|
163
|
-
>
|
164
|
-
{active && <Progress type={HMSPlaylistType.video} duration={active.duration} />}
|
165
|
-
<Flex align="center" justify="between">
|
166
|
-
<VolumeControl />
|
167
|
-
{active && <Controls css={{ flex: '1 1 0' }} />}
|
168
|
-
{children}
|
169
|
-
</Flex>
|
170
|
-
</Box>
|
171
|
-
);
|
172
|
-
};
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Dropdown, Flex, Text } from '../../../';
|
3
|
-
|
4
|
-
function formatDuration(duration) {
|
5
|
-
if (!duration) {
|
6
|
-
return '';
|
7
|
-
}
|
8
|
-
let mins = Math.floor(duration / 60);
|
9
|
-
if (mins < 10) {
|
10
|
-
mins = `0${String(mins)}`;
|
11
|
-
}
|
12
|
-
let secs = Math.floor(duration % 60);
|
13
|
-
if (secs < 10) {
|
14
|
-
secs = `0${String(secs)}`;
|
15
|
-
}
|
16
|
-
|
17
|
-
return `${mins}:${secs}`;
|
18
|
-
}
|
19
|
-
|
20
|
-
export const PlaylistItem = React.memo(({ name, metadata, duration, selected, onClick }) => {
|
21
|
-
return (
|
22
|
-
<Dropdown.Item
|
23
|
-
css={{
|
24
|
-
flexDirection: 'column',
|
25
|
-
alignItems: 'flex-start',
|
26
|
-
h: '$18',
|
27
|
-
p: '$8',
|
28
|
-
'&:hover': {
|
29
|
-
cursor: 'pointer',
|
30
|
-
bg: '$surface_default',
|
31
|
-
},
|
32
|
-
'&:focus-visible': {
|
33
|
-
bg: '$surface_default',
|
34
|
-
},
|
35
|
-
}}
|
36
|
-
onClick={onClick}
|
37
|
-
>
|
38
|
-
<Flex align="center" justify="between" css={{ width: '100%', minHeight: 0 }}>
|
39
|
-
<Text variant="md" css={{ color: selected ? '$primary_default' : '$on_primary_high' }}>
|
40
|
-
{name}
|
41
|
-
</Text>
|
42
|
-
<Text variant="xs">{formatDuration(duration)}</Text>
|
43
|
-
</Flex>
|
44
|
-
{metadata?.description && (
|
45
|
-
<Text variant="xs" css={{ mt: '$4' }}>
|
46
|
-
{metadata?.description}
|
47
|
-
</Text>
|
48
|
-
)}
|
49
|
-
</Dropdown.Item>
|
50
|
-
);
|
51
|
-
});
|
@@ -1,95 +0,0 @@
|
|
1
|
-
import React, { useRef } from 'react';
|
2
|
-
import { useFullscreen, useToggle } from 'react-use';
|
3
|
-
import screenfull from 'screenfull';
|
4
|
-
import {
|
5
|
-
selectVideoPlaylist,
|
6
|
-
selectVideoPlaylistAudioTrackByPeerID,
|
7
|
-
selectVideoPlaylistVideoTrackByPeerID,
|
8
|
-
useHMSActions,
|
9
|
-
useHMSStore,
|
10
|
-
} from '@100mslive/react-sdk';
|
11
|
-
import { CrossIcon, ExpandIcon, ShrinkIcon } from '@100mslive/react-icons';
|
12
|
-
import { Box, Flex, IconButton, Text, Video, VideoTileStats } from '../../../';
|
13
|
-
import { VideoPlaylistControls } from './PlaylistControls';
|
14
|
-
import { useUISettings } from '../AppData/useUISettings';
|
15
|
-
import { UI_SETTINGS } from '../../common/constants';
|
16
|
-
|
17
|
-
export const VideoPlayer = React.memo(({ peerId }) => {
|
18
|
-
const videoTrack = useHMSStore(selectVideoPlaylistVideoTrackByPeerID(peerId));
|
19
|
-
const audioTrack = useHMSStore(selectVideoPlaylistAudioTrackByPeerID(peerId));
|
20
|
-
const active = useHMSStore(selectVideoPlaylist.selectedItem);
|
21
|
-
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
22
|
-
const hmsActions = useHMSActions();
|
23
|
-
const ref = useRef(null);
|
24
|
-
const [show, toggle] = useToggle(false);
|
25
|
-
const isFullscreen = useFullscreen(ref, show, {
|
26
|
-
onClose: () => toggle(false),
|
27
|
-
});
|
28
|
-
const showStatsOnTiles = useUISettings(UI_SETTINGS.showStatsOnTiles);
|
29
|
-
|
30
|
-
return (
|
31
|
-
<Flex direction="column" justify="center" css={{ w: '100%', h: '100%' }} ref={ref}>
|
32
|
-
{active && (
|
33
|
-
<Flex
|
34
|
-
justify="between"
|
35
|
-
align="center"
|
36
|
-
css={{
|
37
|
-
bg: '$surface_default',
|
38
|
-
p: '$2 $2 $2 $6',
|
39
|
-
borderTopLeftRadius: '$1',
|
40
|
-
borderTopRightRadius: '$1',
|
41
|
-
}}
|
42
|
-
>
|
43
|
-
<Text css={{ color: '$on_primary_high' }}>{active.name}</Text>
|
44
|
-
<IconButton
|
45
|
-
css={{
|
46
|
-
color: '$on_primary_high',
|
47
|
-
}}
|
48
|
-
onClick={() => {
|
49
|
-
hmsActions.videoPlaylist.stop();
|
50
|
-
}}
|
51
|
-
data-testid="videoplaylist_cross_btn"
|
52
|
-
>
|
53
|
-
<CrossIcon />
|
54
|
-
</IconButton>
|
55
|
-
</Flex>
|
56
|
-
)}
|
57
|
-
{showStatsOnTiles ? (
|
58
|
-
<Box css={{ '& > div': { top: '$14', left: '$8' } }}>
|
59
|
-
<VideoTileStats
|
60
|
-
audioTrackID={audioTrack?.id}
|
61
|
-
videoTrackID={videoTrack?.id}
|
62
|
-
peerID={peerId}
|
63
|
-
isLocal={active}
|
64
|
-
/>
|
65
|
-
</Box>
|
66
|
-
) : null}
|
67
|
-
<Video
|
68
|
-
trackId={videoTrack?.id}
|
69
|
-
attach={!isAudioOnly}
|
70
|
-
css={{
|
71
|
-
objectFit: 'contain',
|
72
|
-
h: 'auto',
|
73
|
-
r: '$1',
|
74
|
-
borderTopLeftRadius: 0,
|
75
|
-
borderTopRightRadius: 0,
|
76
|
-
}}
|
77
|
-
/>
|
78
|
-
<VideoPlaylistControls>
|
79
|
-
{screenfull.enabled && (
|
80
|
-
<IconButton
|
81
|
-
onClick={toggle}
|
82
|
-
css={{
|
83
|
-
color: '$on_primary_high',
|
84
|
-
height: 'max-content',
|
85
|
-
alignSelf: 'center',
|
86
|
-
cursor: 'pointer',
|
87
|
-
}}
|
88
|
-
>
|
89
|
-
{isFullscreen ? <ShrinkIcon /> : <ExpandIcon />}
|
90
|
-
</IconButton>
|
91
|
-
)}
|
92
|
-
</VideoPlaylistControls>
|
93
|
-
</Flex>
|
94
|
-
);
|
95
|
-
});
|
@@ -1,71 +0,0 @@
|
|
1
|
-
// @ts-check
|
2
|
-
import React, { useRef, useState } from 'react';
|
3
|
-
import { Dropdown, Flex, Switch, Text } from '../../../../';
|
4
|
-
import { DialogDropdownTrigger } from '../../../primitives/DropdownTrigger';
|
5
|
-
import { useDropdownSelection } from '../../hooks/useDropdownSelection';
|
6
|
-
|
7
|
-
const timerSettings = {
|
8
|
-
10: '10 secs',
|
9
|
-
15: '15 secs',
|
10
|
-
20: '20 secs',
|
11
|
-
25: '25 secs',
|
12
|
-
30: '30 secs',
|
13
|
-
60: '1 min',
|
14
|
-
120: '2 mins',
|
15
|
-
300: '5 mins',
|
16
|
-
};
|
17
|
-
|
18
|
-
export const Timer = ({ timer, setTimer, showTimerDropDown, setShowTimerDropDown }) => {
|
19
|
-
const selectionBg = useDropdownSelection();
|
20
|
-
const [timerDropdownToggle, setTimerDropdownToggle] = useState(false);
|
21
|
-
const timerDropdownRef = useRef();
|
22
|
-
|
23
|
-
return (
|
24
|
-
<Flex justify="between" align="center" css={{ mt: '$10' }}>
|
25
|
-
<Flex align="center">
|
26
|
-
<Switch checked={showTimerDropDown} onCheckedChange={setShowTimerDropDown} css={{ mr: '$6' }} />
|
27
|
-
<Text variant="body2" css={{ c: '$on_surface_medium' }}>
|
28
|
-
Timer
|
29
|
-
</Text>
|
30
|
-
</Flex>
|
31
|
-
<Flex align="center">
|
32
|
-
{showTimerDropDown ? (
|
33
|
-
<Dropdown.Root open={timerDropdownToggle} onOpenChange={setTimerDropdownToggle}>
|
34
|
-
<DialogDropdownTrigger
|
35
|
-
ref={timerDropdownRef}
|
36
|
-
title={timerSettings[timer]}
|
37
|
-
open={timerDropdownToggle}
|
38
|
-
titleCss={{ c: '$on_surface_high', ml: '$md' }}
|
39
|
-
/>
|
40
|
-
<Dropdown.Portal>
|
41
|
-
<Dropdown.Content
|
42
|
-
align="start"
|
43
|
-
sideOffset={8}
|
44
|
-
css={{
|
45
|
-
w: timerDropdownRef.current?.clientWidth,
|
46
|
-
zIndex: 1000,
|
47
|
-
}}
|
48
|
-
>
|
49
|
-
{Object.keys(timerSettings).map(value => {
|
50
|
-
const val = parseInt(value);
|
51
|
-
return (
|
52
|
-
<Dropdown.Item
|
53
|
-
key={value}
|
54
|
-
onSelect={() => setTimer(val)}
|
55
|
-
css={{
|
56
|
-
px: '$9',
|
57
|
-
bg: timer === val ? selectionBg : undefined,
|
58
|
-
}}
|
59
|
-
>
|
60
|
-
{timerSettings[val]}
|
61
|
-
</Dropdown.Item>
|
62
|
-
);
|
63
|
-
})}
|
64
|
-
</Dropdown.Content>
|
65
|
-
</Dropdown.Portal>
|
66
|
-
</Dropdown.Root>
|
67
|
-
) : null}
|
68
|
-
</Flex>
|
69
|
-
</Flex>
|
70
|
-
);
|
71
|
-
};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Avatar, Flex, Text } from '../../../../';
|
3
|
-
|
4
|
-
export const VoterList = ({ voters }: { voters: string[] }) => {
|
5
|
-
return voters.map((voter, index) => (
|
6
|
-
<Flex align="center" key={`${voter}-${index}`} css={{ gap: '$4', py: '$2' }}>
|
7
|
-
<Avatar
|
8
|
-
name={voter}
|
9
|
-
css={{
|
10
|
-
position: 'relative',
|
11
|
-
transform: 'unset',
|
12
|
-
fontSize: '$tiny',
|
13
|
-
size: '$9',
|
14
|
-
p: '$4',
|
15
|
-
}}
|
16
|
-
/>
|
17
|
-
<Text variant="xs" css={{ color: '$on_surface_medium', fontWeight: '$semiBold' }}>
|
18
|
-
{voter}
|
19
|
-
</Text>
|
20
|
-
</Flex>
|
21
|
-
));
|
22
|
-
};
|
@@ -1,37 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { useHMSActions } from '@100mslive/react-sdk';
|
3
|
-
import { Button } from '../../Button';
|
4
|
-
import { Dialog } from '../../Modal';
|
5
|
-
import { DialogContent, DialogRow } from '../primitives/DialogContent';
|
6
|
-
|
7
|
-
export const ScreenShareHintModal = ({ onClose }) => {
|
8
|
-
const hmsActions = useHMSActions();
|
9
|
-
return (
|
10
|
-
<Dialog.Root defaultOpen onOpenChange={value => !value && onClose()}>
|
11
|
-
<DialogContent title="AudioOnly Screenshare">
|
12
|
-
<img
|
13
|
-
src="https://images.app.100ms.live/share-audio.png"
|
14
|
-
alt="AudioOnly Screenshare instructions"
|
15
|
-
width="100%"
|
16
|
-
/>
|
17
|
-
<DialogRow justify="end">
|
18
|
-
<Button
|
19
|
-
variant="primary"
|
20
|
-
onClick={() => {
|
21
|
-
hmsActions
|
22
|
-
.setScreenShareEnabled(true, {
|
23
|
-
audioOnly: true,
|
24
|
-
displaySurface: 'browser',
|
25
|
-
})
|
26
|
-
.catch(console.error);
|
27
|
-
onClose();
|
28
|
-
}}
|
29
|
-
data-testid="audio_screenshare_continue"
|
30
|
-
>
|
31
|
-
Continue
|
32
|
-
</Button>
|
33
|
-
</DialogRow>
|
34
|
-
</DialogContent>
|
35
|
-
</Dialog.Root>
|
36
|
-
);
|
37
|
-
};
|
File without changes
|