@100mslive/roomkit-react 0.3.14 → 0.3.15-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/dist/Diagnostics/components.d.ts +2 -0
  2. package/dist/{HLSView-67SFNI2P.js → HLSView-33JUAQ33.js} +2 -2
  3. package/dist/{HLSView-TYHCIAWX.css → HLSView-KKS3ZEYM.css} +3 -3
  4. package/dist/{HLSView-TYHCIAWX.css.map → HLSView-KKS3ZEYM.css.map} +1 -1
  5. package/dist/{chunk-VCXILOW6.js → chunk-MTS2LMGT.js} +2324 -11723
  6. package/dist/chunk-MTS2LMGT.js.map +7 -0
  7. package/dist/index.cjs.css +2 -2
  8. package/dist/index.cjs.css.map +1 -1
  9. package/dist/index.cjs.js +4232 -13646
  10. package/dist/index.cjs.js.map +4 -4
  11. package/dist/index.css +2 -2
  12. package/dist/index.css.map +1 -1
  13. package/dist/index.js +1 -1
  14. package/dist/meta.cjs.json +117 -214
  15. package/dist/meta.esbuild.json +126 -223
  16. package/package.json +8 -7
  17. package/src/Diagnostics/AudioTest.tsx +13 -11
  18. package/src/Diagnostics/BrowserTest.tsx +5 -5
  19. package/src/Diagnostics/ConnectivityTest.tsx +3 -4
  20. package/src/Diagnostics/Diagnostics.tsx +34 -18
  21. package/src/Diagnostics/VideoTest.tsx +7 -7
  22. package/src/Diagnostics/components.tsx +6 -5
  23. package/src/Prebuilt/components/Chat/ChatBody.tsx +23 -8
  24. package/src/Prebuilt/components/Header/AdditionalRoomState.jsx +4 -66
  25. package/src/Prebuilt/components/VideoLayouts/ScreenshareLayout.tsx +2 -2
  26. package/src/Prebuilt/components/VideoLayouts/WhiteboardLayout.tsx +4 -0
  27. package/dist/Diagnostics/hms.d.ts +0 -9
  28. package/dist/Prebuilt/components/HMSVideo/PlayButton.d.ts +0 -6
  29. package/dist/Prebuilt/components/Polls/common/VoterList.d.ts +0 -4
  30. package/dist/chunk-VCXILOW6.js.map +0 -7
  31. package/src/Diagnostics/hms.ts +0 -9
  32. package/src/Prebuilt/common/roles.js +0 -4
  33. package/src/Prebuilt/components/AppData/useAppConfig.js +0 -7
  34. package/src/Prebuilt/components/HMSVideo/PlayButton.tsx +0 -27
  35. package/src/Prebuilt/components/Header/AmbientMusic.jsx +0 -88
  36. package/src/Prebuilt/components/Image.jsx +0 -7
  37. package/src/Prebuilt/components/MetaActions.jsx +0 -37
  38. package/src/Prebuilt/components/Playlist/Playlist.jsx +0 -124
  39. package/src/Prebuilt/components/Playlist/PlaylistControls.jsx +0 -172
  40. package/src/Prebuilt/components/Playlist/PlaylistItem.jsx +0 -51
  41. package/src/Prebuilt/components/Playlist/VideoPlayer.jsx +0 -95
  42. package/src/Prebuilt/components/Polls/CreatePollQuiz/Timer.jsx +0 -71
  43. package/src/Prebuilt/components/Polls/common/VoterList.tsx +0 -22
  44. package/src/Prebuilt/components/ScreenshareHintModal.jsx +0 -37
  45. /package/dist/{HLSView-67SFNI2P.js.map → HLSView-33JUAQ33.js.map} +0 -0
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.14",
13
+ "version": "0.3.15-alpha.1",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -67,6 +67,7 @@
67
67
  "babel-loader": "^8.2.5",
68
68
  "babel-plugin-react-require": "3.1.3",
69
69
  "esbuild-loader": "^4.0.2",
70
+ "knip": "^5.11.0",
70
71
  "react": "^18.1.0",
71
72
  "storybook-dark-mode": "^3.0.0"
72
73
  },
@@ -74,12 +75,12 @@
74
75
  "react": ">=17.0.2 <19.0.0"
75
76
  },
76
77
  "dependencies": {
77
- "@100mslive/hls-player": "0.3.14",
78
+ "@100mslive/hls-player": "0.3.15-alpha.1",
78
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
79
- "@100mslive/hms-virtual-background": "1.13.14",
80
- "@100mslive/hms-whiteboard": "0.0.4",
81
- "@100mslive/react-icons": "0.10.14",
82
- "@100mslive/react-sdk": "0.10.14",
80
+ "@100mslive/hms-virtual-background": "1.13.15-alpha.1",
81
+ "@100mslive/hms-whiteboard": "0.0.5-alpha.1",
82
+ "@100mslive/react-icons": "0.10.15-alpha.1",
83
+ "@100mslive/react-sdk": "0.10.15-alpha.1",
83
84
  "@100mslive/types-prebuilt": "0.12.9",
84
85
  "@emoji-mart/data": "^1.0.6",
85
86
  "@emoji-mart/react": "^1.0.1",
@@ -115,5 +116,5 @@
115
116
  "uuid": "^8.3.2",
116
117
  "worker-timers": "^7.0.40"
117
118
  },
118
- "gitHead": "0e76f9d5dee8b4eec991bda145a3157c5a45593c"
119
+ "gitHead": "d841ae70e97bfd176bcfc86b44f6ad939832fe13"
119
120
  }
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable react/prop-types */
2
- import React, { useEffect, useState } from 'react';
2
+ import React, { useContext, useEffect, useState } from 'react';
3
3
  import {
4
4
  HMSException,
5
5
  selectDevices,
@@ -11,14 +11,13 @@ import {
11
11
  } from '@100mslive/react-sdk';
12
12
  import { MicOnIcon, SpeakerIcon, StopIcon } from '@100mslive/react-icons';
13
13
  import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
14
- import { TestContainer, TestFooter } from './components';
14
+ import { DiagnosticsContext, TestContainer, TestFooter } from './components';
15
15
  import { Button } from '../Button';
16
16
  import { Box, Flex } from '../Layout';
17
17
  import { Progress } from '../Progress';
18
18
  import { Text } from '../Text';
19
19
  // @ts-ignore: No implicit any
20
20
  import { DeviceSelector } from './DeviceSelector';
21
- import { hmsDiagnostics } from './hms';
22
21
  import { useAudioOutputTest } from '../Prebuilt/components/hooks/useAudioOutputTest';
23
22
  import { TEST_AUDIO_URL } from '../Prebuilt/common/constants';
24
23
 
@@ -27,6 +26,7 @@ const SelectContainer = ({ children }: { children: React.ReactNode }) => (
27
26
  );
28
27
 
29
28
  const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<Error | undefined>> }) => {
29
+ const { hmsDiagnostics } = useContext(DiagnosticsContext);
30
30
  const devices = useHMSStore(selectDevices);
31
31
  const [isRecording, setIsRecording] = useState(false);
32
32
  const [selectedMic, setSelectedMic] = useState(devices.audioInput[0]?.deviceId || 'default');
@@ -45,8 +45,9 @@ const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<E
45
45
  selection={selectedMic}
46
46
  icon={<MicOnIcon />}
47
47
  onChange={(deviceId: string) => {
48
+ setError(undefined);
48
49
  setSelectedMic(deviceId);
49
- hmsDiagnostics.stopMicCheck();
50
+ hmsDiagnostics?.stopMicCheck();
50
51
  }}
51
52
  />
52
53
  <Flex css={{ gap: '$6', alignItems: 'center' }}>
@@ -55,9 +56,9 @@ const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<E
55
56
  icon
56
57
  onClick={() => {
57
58
  isRecording
58
- ? hmsDiagnostics.stopMicCheck()
59
+ ? hmsDiagnostics?.stopMicCheck()
59
60
  : hmsDiagnostics
60
- .startMicCheck({
61
+ ?.startMicCheck({
61
62
  inputDevice: selectedMic,
62
63
  onError: (err: Error) => {
63
64
  setError(err);
@@ -79,14 +80,14 @@ const MicTest = ({ setError }: { setError: React.Dispatch<React.SetStateAction<E
79
80
  <Button
80
81
  icon
81
82
  variant="standard"
82
- outlined={hmsDiagnostics.getRecordedAudio() === TEST_AUDIO_URL}
83
+ outlined={hmsDiagnostics?.getRecordedAudio() === TEST_AUDIO_URL}
83
84
  onClick={() => {
84
85
  if (audioRef.current) {
85
- audioRef.current.src = hmsDiagnostics.getRecordedAudio() || '';
86
+ audioRef.current.src = hmsDiagnostics?.getRecordedAudio() || '';
86
87
  audioRef.current.play();
87
88
  }
88
89
  }}
89
- disabled={playing || hmsDiagnostics.getRecordedAudio() === TEST_AUDIO_URL}
90
+ disabled={playing || hmsDiagnostics?.getRecordedAudio() === TEST_AUDIO_URL}
90
91
  >
91
92
  <SpeakerIcon />
92
93
  {playing ? 'Playing...' : 'Playback'}
@@ -141,10 +142,11 @@ const SpeakerTest = () => {
141
142
  };
142
143
 
143
144
  export const AudioTest = () => {
145
+ const { hmsDiagnostics } = useContext(DiagnosticsContext);
144
146
  const [error, setError] = useState<Error | undefined>();
145
147
  useEffect(() => {
146
- hmsDiagnostics.requestPermission({ audio: true }).catch(error => setError(error));
147
- }, []);
148
+ hmsDiagnostics?.requestPermission({ audio: true }).catch(error => setError(error));
149
+ }, [hmsDiagnostics]);
148
150
 
149
151
  return (
150
152
  <>
@@ -1,9 +1,8 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useContext, useEffect, useState } from 'react';
2
2
  import { parsedUserAgent } from '@100mslive/react-sdk';
3
- import { TestContainer, TestFooter } from './components';
3
+ import { DiagnosticsContext, TestContainer, TestFooter } from './components';
4
4
  import { Box, Flex } from '../Layout';
5
5
  import { Text } from '../Text';
6
- import { hmsDiagnostics } from './hms';
7
6
 
8
7
  const CMS_MEDIA_SERVER = 'https://storage.googleapis.com/100ms-cms-prod/';
9
8
 
@@ -103,14 +102,15 @@ const CheckDetails = ({ title, value, iconURL }: { title: string; value: string;
103
102
  );
104
103
 
105
104
  export const BrowserTest = () => {
105
+ const { hmsDiagnostics } = useContext(DiagnosticsContext);
106
106
  const [error, setError] = useState<Error | undefined>();
107
107
  useEffect(() => {
108
108
  try {
109
- hmsDiagnostics.checkBrowserSupport();
109
+ hmsDiagnostics?.checkBrowserSupport();
110
110
  } catch (err) {
111
111
  setError(err as Error);
112
112
  }
113
- }, []);
113
+ }, [hmsDiagnostics]);
114
114
  return (
115
115
  <>
116
116
  <TestContainer css={{ display: 'flex', gap: '$8', '@lg': { display: 'block' } }}>
@@ -7,7 +7,6 @@ import { Box, Flex } from '../Layout';
7
7
  import { Loading } from '../Loading';
8
8
  import { formatBytes } from '../Stats';
9
9
  import { Text } from '../Text';
10
- import { hmsDiagnostics } from './hms';
11
10
 
12
11
  const Regions = {
13
12
  in: 'India',
@@ -237,7 +236,7 @@ const ConnectivityTestReport = ({
237
236
  if (progress !== undefined) {
238
237
  return (
239
238
  <TestContainer css={{ textAlign: 'center' }}>
240
- <Text css={{ c: '$primary_bright', textAlign: 'center' }}>
239
+ <Text css={{ c: '$primary_bright', display: 'flex', justifyContent: 'center' }}>
241
240
  <Loading size="3.5rem" color="currentColor" />
242
241
  </Text>
243
242
  <Text variant="h6" css={{ mt: '$8' }}>
@@ -310,7 +309,7 @@ const RegionSelector = ({
310
309
  };
311
310
 
312
311
  export const ConnectivityTest = () => {
313
- const { setConnectivityTested } = useContext(DiagnosticsContext);
312
+ const { hmsDiagnostics, setConnectivityTested } = useContext(DiagnosticsContext);
314
313
  const [region, setRegion] = useState<string | undefined>(Object.keys(Regions)[0]);
315
314
  const [error, setError] = useState<Error | undefined>();
316
315
  const [progress, setProgress] = useState<ConnectivityState>();
@@ -321,7 +320,7 @@ export const ConnectivityTest = () => {
321
320
  setError(undefined);
322
321
  setResult(undefined);
323
322
  hmsDiagnostics
324
- .startConnectivityCheck(
323
+ ?.startConnectivityCheck(
325
324
  state => {
326
325
  setProgress(state);
327
326
  },
@@ -1,5 +1,5 @@
1
- import React, { useContext } from 'react';
2
- import { HMSRoomProvider } from '@100mslive/react-sdk';
1
+ import React, { useContext, useRef, useState } from 'react';
2
+ import { HMSRoomProvider, useHMSActions } from '@100mslive/react-sdk';
3
3
  import { CheckCircleIcon, ConnectivityIcon, GlobeIcon, MicOnIcon, VideoOnIcon } from '@100mslive/react-icons';
4
4
  import { DiagnosticsContext, DiagnosticsSteps } from './components';
5
5
  import { Box, Flex } from '../Layout';
@@ -8,7 +8,6 @@ import { HMSThemeProvider } from '../Theme';
8
8
  import { AudioTest } from './AudioTest';
9
9
  import { BrowserTest } from './BrowserTest';
10
10
  import { ConnectivityTest } from './ConnectivityTest';
11
- import { hmsActions, hmsNotifications, hmsStats, hmsStore } from './hms';
12
11
  import { VideoTest } from './VideoTest';
13
12
 
14
13
  const DiagnosticsStepIcon: Record<string, React.ReactNode> = {
@@ -110,24 +109,41 @@ const DiagnosticsStepsList = () => {
110
109
  );
111
110
  };
112
111
 
112
+ const DiagnosticsProvider = () => {
113
+ const actions = useHMSActions();
114
+ const [activeStep, setActiveStep] = useState(Object.keys(DiagnosticsSteps)[0]);
115
+ const [connectivityTested, setConnectivityTested] = useState(false);
116
+ const diagnosticsRef = useRef(actions.initDiagnostics());
117
+
118
+ return (
119
+ <DiagnosticsContext.Provider
120
+ value={{
121
+ hmsDiagnostics: diagnosticsRef.current,
122
+ activeStep,
123
+ setActiveStep,
124
+ connectivityTested,
125
+ setConnectivityTested,
126
+ }}
127
+ >
128
+ <Container>
129
+ <Text variant="h4">Pre-call Test</Text>
130
+ <Text variant="md" css={{ c: '$on_primary_medium' }}>
131
+ Make sure your devices and network are good to go, let's get started.
132
+ </Text>
133
+ <Flex css={{ direction: 'column', mt: '$12', justifyItems: 'center' }}>
134
+ <DiagnosticsStepsList />
135
+ <DiagnosticsStep />
136
+ </Flex>
137
+ </Container>
138
+ </DiagnosticsContext.Provider>
139
+ );
140
+ };
141
+
113
142
  export const Diagnostics = () => {
114
- const [activeStep, setActiveStep] = React.useState(Object.keys(DiagnosticsSteps)[0]);
115
- const [connectivityTested, setConnectivityTested] = React.useState(false);
116
143
  return (
117
- <HMSRoomProvider store={hmsStore} actions={hmsActions} notifications={hmsNotifications} stats={hmsStats}>
144
+ <HMSRoomProvider>
118
145
  <HMSThemeProvider themeType="default">
119
- <DiagnosticsContext.Provider value={{ activeStep, setActiveStep, connectivityTested, setConnectivityTested }}>
120
- <Container>
121
- <Text variant="h4">Pre-call Test</Text>
122
- <Text variant="md" css={{ c: '$on_primary_medium' }}>
123
- Make sure your devices and network are good to go, let's get started.
124
- </Text>
125
- <Flex css={{ direction: 'column', mt: '$12', justifyItems: 'center' }}>
126
- <DiagnosticsStepsList />
127
- <DiagnosticsStep />
128
- </Flex>
129
- </Container>
130
- </DiagnosticsContext.Provider>
146
+ <DiagnosticsProvider />
131
147
  </HMSThemeProvider>
132
148
  </HMSRoomProvider>
133
149
  );
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import React, { useContext, useEffect, useState } from 'react';
2
2
  import {
3
3
  HMSException,
4
4
  selectDevices,
@@ -8,16 +8,16 @@ import {
8
8
  } from '@100mslive/react-sdk';
9
9
  import { VideoOnIcon } from '@100mslive/react-icons';
10
10
  import { PermissionErrorModal } from '../Prebuilt/components/Notifications/PermissionErrorModal';
11
- import { TestContainer, TestFooter } from './components';
11
+ import { DiagnosticsContext, TestContainer, TestFooter } from './components';
12
12
  import { Flex } from '../Layout';
13
13
  import { Text } from '../Text';
14
14
  import { Video } from '../Video';
15
15
  import { StyledVideoTile } from '../VideoTile';
16
16
  // @ts-ignore: No implicit any
17
17
  import { DeviceSelector } from './DeviceSelector';
18
- import { hmsDiagnostics } from './hms';
19
18
 
20
19
  export const VideoTest = () => {
20
+ const { hmsDiagnostics } = useContext(DiagnosticsContext);
21
21
  const allDevices = useHMSStore(selectDevices);
22
22
  const { videoInput } = allDevices;
23
23
  const trackID = useHMSStore(selectLocalVideoTrackID);
@@ -25,8 +25,8 @@ export const VideoTest = () => {
25
25
  const [error, setError] = useState<HMSException | undefined>();
26
26
 
27
27
  useEffect(() => {
28
- hmsDiagnostics.startCameraCheck().catch(err => setError(err));
29
- }, []);
28
+ hmsDiagnostics?.startCameraCheck().catch(err => setError(err));
29
+ }, [hmsDiagnostics]);
30
30
 
31
31
  return (
32
32
  <>
@@ -55,8 +55,8 @@ export const VideoTest = () => {
55
55
  icon={<VideoOnIcon />}
56
56
  selection={sdkSelectedDevices.videoInputDeviceId}
57
57
  onChange={async (deviceId: string) => {
58
- hmsDiagnostics.stopCameraCheck();
59
- hmsDiagnostics.startCameraCheck(deviceId);
58
+ hmsDiagnostics?.stopCameraCheck();
59
+ hmsDiagnostics?.startCameraCheck(deviceId);
60
60
  }}
61
61
  />
62
62
  </Flex>
@@ -1,9 +1,9 @@
1
1
  import React, { useContext } from 'react';
2
+ import { HMSDiagnosticsInterface } from '@100mslive/react-sdk';
2
3
  import { Button } from '../Button';
3
4
  import { Box, Flex } from '../Layout';
4
5
  import { Text } from '../Text';
5
6
  import { CSS } from '../Theme';
6
- import { hmsDiagnostics } from './hms';
7
7
 
8
8
  export const DiagnosticsSteps: Record<string, string> = {
9
9
  browser: 'Browser Support',
@@ -13,6 +13,7 @@ export const DiagnosticsSteps: Record<string, string> = {
13
13
  };
14
14
 
15
15
  export const DiagnosticsContext = React.createContext<{
16
+ hmsDiagnostics?: HMSDiagnosticsInterface;
16
17
  activeStep: string;
17
18
  setActiveStep: React.Dispatch<React.SetStateAction<string>>;
18
19
  connectivityTested: boolean;
@@ -41,15 +42,15 @@ export const TestFooter = ({
41
42
  error?: Error;
42
43
  children?: React.ReactNode;
43
44
  }) => {
44
- const { activeStep, setActiveStep } = useContext(DiagnosticsContext);
45
+ const { hmsDiagnostics, activeStep, setActiveStep } = useContext(DiagnosticsContext);
45
46
 
46
47
  const onNextStep = () => {
47
48
  if (activeStep === 'audio') {
48
- hmsDiagnostics.stopMicCheck();
49
+ hmsDiagnostics?.stopMicCheck();
49
50
  } else if (activeStep === 'video') {
50
- hmsDiagnostics.stopCameraCheck();
51
+ hmsDiagnostics?.stopCameraCheck();
51
52
  } else if (activeStep === 'connectivity') {
52
- hmsDiagnostics.stopConnectivityCheck();
53
+ hmsDiagnostics?.stopConnectivityCheck();
53
54
  }
54
55
 
55
56
  const keys = Object.keys(DiagnosticsSteps);
@@ -75,28 +75,35 @@ const MessageTypeContainer = ({ left, right }: { left?: string; right?: string }
75
75
  ml: '$2',
76
76
  mr: '$4',
77
77
  gap: '$space$2',
78
+ flexWrap: 'nowrap',
78
79
  }}
79
80
  >
80
81
  {left && (
81
- <SenderName
82
+ <Text
82
83
  variant="xs"
83
84
  as="span"
84
- css={{ color: '$on_surface_medium', textTransform: 'capitalize', fontWeight: '$regular' }}
85
+ css={{
86
+ color: '$on_surface_medium',
87
+ textTransform: 'capitalize',
88
+ fontWeight: '$regular',
89
+ whiteSpace: 'nowrap',
90
+ }}
85
91
  >
86
92
  {left}
87
- </SenderName>
93
+ </Text>
88
94
  )}
89
95
  {right && (
90
- <SenderName
96
+ <Text
91
97
  as="span"
92
98
  variant="overline"
93
99
  css={{
94
100
  color: '$on_surface_medium',
95
101
  fontWeight: '$regular',
102
+ whiteSpace: 'nowrap',
96
103
  }}
97
104
  >
98
105
  {right}
99
- </SenderName>
106
+ </Text>
100
107
  )}
101
108
  </Flex>
102
109
  );
@@ -169,7 +176,7 @@ const SenderName = styled(Text, {
169
176
  overflow: 'hidden',
170
177
  textOverflow: 'ellipsis',
171
178
  whiteSpace: 'nowrap',
172
- maxWidth: '14ch',
179
+ width: '100%',
173
180
  minWidth: 0,
174
181
  color: '$on_surface_high',
175
182
  fontWeight: '$semiBold',
@@ -251,7 +258,15 @@ const ChatMessage = React.memo(
251
258
  }}
252
259
  as="div"
253
260
  >
254
- <Flex align="baseline">
261
+ <Flex
262
+ align="baseline"
263
+ css={{
264
+ flexWrap: 'nowrap',
265
+ maxWidth: 'calc(100% - 10ch)',
266
+ textOverflow: 'ellipsis',
267
+ whiteSpace: 'nowrap',
268
+ }}
269
+ >
255
270
  {message.senderName === 'You' || !message.senderName ? (
256
271
  <SenderName
257
272
  as="span"
@@ -261,7 +276,7 @@ const ChatMessage = React.memo(
261
276
  {message.senderName || 'Anonymous'}
262
277
  </SenderName>
263
278
  ) : (
264
- <Tooltip title={message.senderName} side="top" align="start">
279
+ <Tooltip title={message.senderName} side="top" align="start" boxCss={{ zIndex: 50 }}>
265
280
  <SenderName
266
281
  as="span"
267
282
  variant="sub2"
@@ -1,16 +1,8 @@
1
1
  import React, { useState } from 'react';
2
- import { selectLocalPeerID, selectPeerSharingVideoPlaylist, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
3
- import {
4
- AudioPlayerIcon,
5
- ChevronDownIcon,
6
- ChevronUpIcon,
7
- MusicIcon,
8
- ShareScreenIcon,
9
- VideoPlayerIcon,
10
- } from '@100mslive/react-icons';
2
+ import { selectLocalPeerID, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
3
+ import { ChevronDownIcon, ChevronUpIcon, MusicIcon, ShareScreenIcon, VideoPlayerIcon } from '@100mslive/react-icons';
11
4
  import { Box, Dropdown, Flex, Text, Tooltip } from '../../../';
12
5
  import { useUISettings } from '../AppData/useUISettings';
13
- import { usePlaylistMusic } from '../hooks/usePlaylistMusic';
14
6
  import { useScreenshareAudio } from '../hooks/useScreenshareAudio';
15
7
  import { UI_SETTINGS } from '../../common/constants';
16
8
 
@@ -35,29 +27,21 @@ export const getRecordingText = ({ isBrowserRecordingOn, isServerRecordingOn, is
35
27
  * Display state of recording, streaming, playlist, whiteboard
36
28
  */
37
29
  export const AdditionalRoomState = () => {
38
- const playlist = usePlaylistMusic();
39
30
  const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
40
31
  const screenshareAudio = useScreenshareAudio();
41
32
  const [open, setOpen] = useState(false);
42
- const isPlaylistInactive = [
43
- !playlist.peer || !playlist.track,
44
- !playlist.peer?.isLocal && !playlist.track?.enabled,
45
- playlist.peer?.isLocal && !playlist.selection,
46
- ].some(Boolean);
47
33
  const isAudioshareInactive = [
48
34
  !screenshareAudio.peer || !screenshareAudio.track,
49
35
  !screenshareAudio.peer?.isLocal && !screenshareAudio.track?.enabled,
50
36
  ].some(Boolean);
51
37
 
52
- const peerSharingPlaylist = useHMSStore(selectPeerSharingVideoPlaylist);
53
38
  const localPeerID = useHMSStore(selectLocalPeerID);
54
- const isVideoPlayListPlaying = !!peerSharingPlaylist?.id;
55
39
  const { screenSharingPeerName, screenSharingPeerId, screenShareVideoTrackId } = useScreenShare();
56
40
 
57
41
  const isVideoScreenSharingOn = !!screenShareVideoTrackId;
58
42
  const shouldShowScreenShareState = isAudioOnly && isVideoScreenSharingOn;
59
- const shouldShowVideoState = isAudioOnly && isVideoPlayListPlaying;
60
- if (isPlaylistInactive && isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState) {
43
+ const shouldShowVideoState = isAudioOnly;
44
+ if (isAudioshareInactive && !shouldShowScreenShareState && !shouldShowVideoState) {
61
45
  return null;
62
46
  }
63
47
 
@@ -96,50 +80,12 @@ export const AdditionalRoomState = () => {
96
80
  </Flex>
97
81
  </Tooltip>
98
82
  )}
99
- {!isPlaylistInactive && (
100
- <Tooltip title="Playlist Music">
101
- <Flex align="center" css={{ color: '$on_primary_high', mx: '$2' }}>
102
- <AudioPlayerIcon width={24} height={24} />
103
- </Flex>
104
- </Tooltip>
105
- )}
106
83
  <Box css={{ '@lg': { display: 'none' }, color: '$on_surface_low' }}>
107
84
  {open ? <ChevronUpIcon /> : <ChevronDownIcon />}
108
85
  </Box>
109
86
  </Flex>
110
87
  </Dropdown.Trigger>
111
88
  <Dropdown.Content sideOffset={5} align="end" css={{ w: '$60' }}>
112
- {!isPlaylistInactive && (
113
- <Dropdown.Item css={{ color: '$on_primary_high' }}>
114
- <AudioPlayerIcon width={24} height={24} />
115
- <Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
116
- Playlist is playing
117
- </Text>
118
- {playlist.peer.isLocal ? (
119
- <Text
120
- variant="sm"
121
- css={{ color: '$alert_error_default', cursor: 'pointer', ml: '$2' }}
122
- onClick={e => {
123
- e.preventDefault();
124
- playlist.selection.playing ? playlist.pause() : playlist.play(playlist.selection.id);
125
- }}
126
- >
127
- {playlist.selection.playing ? 'Pause' : 'Play'}
128
- </Text>
129
- ) : (
130
- <Text
131
- variant="sm"
132
- css={{ color: '$alert_error_default', ml: '$2', cursor: 'pointer' }}
133
- onClick={e => {
134
- e.preventDefault();
135
- playlist.setVolume(!playlist.track.volume ? 100 : 0);
136
- }}
137
- >
138
- {playlist.track.volume === 0 ? 'Unmute' : 'Mute'}
139
- </Text>
140
- )}
141
- </Dropdown.Item>
142
- )}
143
89
  {!isAudioshareInactive && (
144
90
  <Dropdown.Item css={{ color: '$on_primary_high' }}>
145
91
  <MusicIcon width={24} height={24} />
@@ -166,14 +112,6 @@ export const AdditionalRoomState = () => {
166
112
  </Text>
167
113
  </Dropdown.Item>
168
114
  )}
169
- {shouldShowVideoState && (
170
- <Dropdown.Item css={{ color: '$on_primary_high' }}>
171
- <VideoPlayerIcon width={24} height={24} />
172
- <Text variant="sm" css={{ ml: '$2', flex: '1 1 0' }}>
173
- {`Shared by: ${peerSharingPlaylist.id === localPeerID ? 'You' : peerSharingPlaylist.name}`}
174
- </Text>
175
- </Dropdown.Item>
176
- )}
177
115
  </Dropdown.Content>
178
116
  </Dropdown.Root>
179
117
  );
@@ -49,11 +49,11 @@ export const ScreenshareLayout = ({ peers, onPageChange, onPageSize, edgeToEdge
49
49
  };
50
50
  }, [isMobile]); // eslint-disable-line react-hooks/exhaustive-deps
51
51
  useEffect(() => {
52
- setActiveScreenSharePeer(isMobile ? '' : activeSharePeer?.id);
52
+ setActiveScreenSharePeer(activeSharePeer?.id);
53
53
  return () => {
54
54
  setActiveScreenSharePeer('');
55
55
  };
56
- }, [activeSharePeer?.id, isMobile, setActiveScreenSharePeer]);
56
+ }, [activeSharePeer?.id, setActiveScreenSharePeer]);
57
57
 
58
58
  return (
59
59
  <ProminenceLayout.Root edgeToEdge={edgeToEdge} hasSidebar={hasSidebar}>
@@ -19,6 +19,10 @@ const WhiteboardEmbed = () => {
19
19
  const isMobile = useMedia(cssConfig.media.md);
20
20
  const { token, endpoint, zoomToContent } = useWhiteboard(isMobile);
21
21
 
22
+ if (!token) {
23
+ return null;
24
+ }
25
+
22
26
  return (
23
27
  <Box
24
28
  css={{
@@ -1,9 +0,0 @@
1
- export declare const hmsStore: import("@100mslive/hms-video-store").HMSStoreWrapper<{
2
- sessionStore: Record<string, any>;
3
- }>;
4
- export declare const hmsActions: import("@100mslive/hms-video-store").HMSActions<{
5
- sessionStore: Record<string, any>;
6
- }>;
7
- export declare const hmsNotifications: import("@100mslive/hms-video-store").HMSNotifications;
8
- export declare const hmsStats: import("@100mslive/hms-video-store").HMSStatsStoreWrapper;
9
- export declare const hmsDiagnostics: import("@100mslive/hms-video-store").HMSDiagnosticsInterface;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export declare const PlayButton: ({ isPaused, width, height, }: {
3
- isPaused: boolean;
4
- width: number;
5
- height: number;
6
- }) => React.JSX.Element;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const VoterList: ({ voters }: {
3
- voters: string[];
4
- }) => React.JSX.Element[];