@100mslive/roomkit-react 0.3.7 → 0.3.8-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. package/dist/{HLSView-J76FQQDB.js → HLSView-HUMJOIWO.js} +35 -17
  2. package/dist/{HLSView-J76FQQDB.js.map → HLSView-HUMJOIWO.js.map} +3 -3
  3. package/dist/Prebuilt/common/constants.d.ts +1 -0
  4. package/dist/Prebuilt/common/hooks.d.ts +10 -0
  5. package/dist/Prebuilt/components/FullPageProgress.d.ts +8 -0
  6. package/dist/Prebuilt/components/HMSVideo/utils.d.ts +1 -0
  7. package/dist/Prebuilt/components/VirtualBackground/VBHandler.d.ts +3 -3
  8. package/dist/{chunk-VKO5HF7B.js → chunk-IDAPJGWC.js} +346 -362
  9. package/dist/chunk-IDAPJGWC.js.map +7 -0
  10. package/dist/index.cjs.js +300 -299
  11. package/dist/index.cjs.js.map +4 -4
  12. package/dist/index.js +1 -1
  13. package/dist/meta.cjs.json +87 -62
  14. package/dist/meta.esbuild.json +99 -74
  15. package/package.json +6 -6
  16. package/src/Prebuilt/common/constants.ts +1 -0
  17. package/src/Prebuilt/common/hooks.ts +72 -1
  18. package/src/Prebuilt/components/AppData/AppData.tsx +1 -0
  19. package/src/Prebuilt/components/ConferenceScreen.tsx +0 -2
  20. package/src/Prebuilt/components/{FullPageProgress.jsx → FullPageProgress.tsx} +10 -1
  21. package/src/Prebuilt/components/HMSVideo/VideoProgress.tsx +3 -2
  22. package/src/Prebuilt/components/HMSVideo/VideoTime.tsx +16 -7
  23. package/src/Prebuilt/components/HMSVideo/utils.ts +10 -0
  24. package/src/Prebuilt/components/Header/StreamActions.tsx +3 -25
  25. package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +4 -26
  26. package/src/Prebuilt/components/Notifications/PeerNotifications.tsx +1 -11
  27. package/src/Prebuilt/components/Preview/PreviewJoin.tsx +4 -9
  28. package/src/Prebuilt/components/Preview/PreviewScreen.tsx +0 -3
  29. package/src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx +2 -2
  30. package/src/Prebuilt/components/Settings/StartRecording.jsx +4 -37
  31. package/src/Prebuilt/components/Toast/ToastConfig.jsx +0 -22
  32. package/src/Prebuilt/components/VirtualBackground/VBHandler.tsx +3 -3
  33. package/src/Prebuilt/components/VirtualBackground/VBOption.tsx +3 -1
  34. package/src/Prebuilt/components/VirtualBackground/VBPicker.tsx +23 -7
  35. package/src/Prebuilt/components/VirtualBackground/VBToggle.tsx +5 -3
  36. package/src/Prebuilt/layouts/SidePane.tsx +1 -1
  37. package/src/Prebuilt/layouts/VideoStreamingSection.tsx +0 -2
  38. package/dist/chunk-VKO5HF7B.js.map +0 -7
@@ -1,4 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react';
2
+ import { useMedia } from 'react-use';
2
3
  import {
3
4
  selectAppData,
4
5
  selectEffectsKey,
@@ -19,14 +20,14 @@ import {
19
20
  useHMSStore,
20
21
  } from '@100mslive/react-sdk';
21
22
  import { BlurPersonHighIcon, CrossCircleIcon, CrossIcon } from '@100mslive/react-icons';
22
- import { Box, Flex, Slider, Video } from '../../../index';
23
+ import { Box, config as cssConfig, Flex, Loading, Slider, Video } from '../../../index';
23
24
  import { Text } from '../../../Text';
24
25
  import { VBCollection } from './VBCollection';
25
26
  import { VBHandler } from './VBHandler';
26
27
  // @ts-ignore
27
28
  import { useSidepaneToggle } from '../AppData/useSidepane';
28
29
  // @ts-ignore
29
- import { useUISettings } from '../AppData/useUISettings';
30
+ import { useSetAppDataByKey, useUISettings } from '../AppData/useUISettings';
30
31
  import { APP_DATA, SIDE_PANE_OPTIONS, UI_SETTINGS } from '../../common/constants';
31
32
  import { defaultMedia } from './constants';
32
33
 
@@ -46,6 +47,8 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
46
47
  const isLargeRoom = useHMSStore(selectIsLargeRoom);
47
48
  const isEffectsEnabled = useHMSStore(selectIsEffectsEnabled);
48
49
  const effectsKey = useHMSStore(selectEffectsKey);
50
+ const isMobile = useMedia(cssConfig.media.md);
51
+ const [loadingEffects, setLoadingEffects] = useSetAppDataByKey(APP_DATA.loadingEffects);
49
52
  const isPluginAdded = useHMSStore(selectIsLocalVideoPluginPresent(VBHandler?.getName() || ''));
50
53
  const background = useHMSStore(selectAppData(APP_DATA.background));
51
54
  const mediaList = backgroundMedia.length
@@ -61,13 +64,15 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
61
64
  return;
62
65
  }
63
66
  if (!isPluginAdded) {
67
+ setLoadingEffects(true);
64
68
  let vbObject = VBHandler.getVBObject();
65
69
  if (!vbObject) {
66
- VBHandler.initialisePlugin(isEffectsEnabled && effectsKey ? effectsKey : '');
70
+ VBHandler.initialisePlugin(isEffectsEnabled && effectsKey ? effectsKey : '', () => setLoadingEffects(false));
67
71
  vbObject = VBHandler.getVBObject();
68
72
  if (isEffectsEnabled && effectsKey) {
69
73
  hmsActions.addPluginsToVideoStream([vbObject as HMSEffectsPlugin]);
70
74
  } else {
75
+ setLoadingEffects(false);
71
76
  if (!role) {
72
77
  return;
73
78
  }
@@ -89,19 +94,30 @@ export const VBPicker = ({ backgroundMedia = [] }: { backgroundMedia: VirtualBac
89
94
  };
90
95
  handleDefaultBackground();
91
96
  }
92
- }, [hmsActions, role, isPluginAdded, isEffectsEnabled, effectsKey, track?.id, background, blurAmount]);
97
+ }, [
98
+ hmsActions,
99
+ role,
100
+ isPluginAdded,
101
+ isEffectsEnabled,
102
+ effectsKey,
103
+ track?.id,
104
+ background,
105
+ blurAmount,
106
+ setLoadingEffects,
107
+ ]);
93
108
 
94
109
  useEffect(() => {
95
110
  if (!isVideoOn) {
96
111
  toggleVB();
97
112
  }
98
- }, [isVideoOn, toggleVB]);
113
+ return () => setLoadingEffects(false);
114
+ }, [isVideoOn, setLoadingEffects, toggleVB]);
99
115
 
100
116
  return (
101
117
  <Flex css={{ pr: '$6', size: '100%' }} direction="column">
102
118
  <Flex align="center" justify="between" css={{ w: '100%', background: '$surface_dim', pb: '$4' }}>
103
- <Text variant="h6" css={{ color: '$on_surface_high' }}>
104
- Virtual Background
119
+ <Text variant="h6" css={{ color: '$on_surface_high', display: 'flex', alignItems: 'center' }}>
120
+ Virtual Background {isMobile && loadingEffects ? <Loading size={18} style={{ marginLeft: '0.5rem' }} /> : ''}
105
121
  </Text>
106
122
  <Box
107
123
  css={{ color: '$on_surface_high', '&:hover': { color: '$on_surface_medium' }, cursor: 'pointer' }}
@@ -1,17 +1,19 @@
1
1
  import React from 'react';
2
- import { selectIsEffectsEnabled, selectIsLocalVideoEnabled, useHMSStore } from '@100mslive/react-sdk';
2
+ import { selectAppData, selectIsEffectsEnabled, selectIsLocalVideoEnabled, useHMSStore } from '@100mslive/react-sdk';
3
3
  import { VirtualBackgroundIcon } from '@100mslive/react-icons';
4
+ import { Loading } from '../../../Loading';
4
5
  import { Tooltip } from '../../../Tooltip';
5
6
  import IconButton from '../../IconButton';
6
7
  // @ts-ignore
7
8
  import { useIsSidepaneTypeOpen, useSidepaneToggle } from '../AppData/useSidepane';
8
- import { isSafari, SIDE_PANE_OPTIONS } from '../../common/constants';
9
+ import { APP_DATA, isSafari, SIDE_PANE_OPTIONS } from '../../common/constants';
9
10
 
10
11
  export const VBToggle = () => {
11
12
  const toggleVB = useSidepaneToggle(SIDE_PANE_OPTIONS.VB);
12
13
  const isVBOpen = useIsSidepaneTypeOpen(SIDE_PANE_OPTIONS.VB);
13
14
  const isVideoOn = useHMSStore(selectIsLocalVideoEnabled);
14
15
  const isEffectsEnabled = useHMSStore(selectIsEffectsEnabled);
16
+ const loadingEffects = useHMSStore(selectAppData(APP_DATA.loadingEffects));
15
17
 
16
18
  if (!isVideoOn || (!isEffectsEnabled && isSafari)) {
17
19
  return null;
@@ -20,7 +22,7 @@ export const VBToggle = () => {
20
22
  return (
21
23
  <Tooltip side="top" disabled={isVBOpen} title="Configure Virtual Background">
22
24
  <IconButton active={!isVBOpen} onClick={toggleVB} data-testid="virtual_bg_btn">
23
- <VirtualBackgroundIcon />
25
+ {loadingEffects ? <Loading size={18} /> : <VirtualBackgroundIcon />}
24
26
  </IconButton>
25
27
  </Tooltip>
26
28
  );
@@ -162,7 +162,7 @@ const SidePane = ({
162
162
  mobileStream: isMobileHLSStream,
163
163
  hideControls,
164
164
  overlayChat: !!elements?.chat?.is_overlay,
165
- roomDescription: isMobile && sidepane === SIDE_PANE_OPTIONS.ROOM_DETAILS,
165
+ roomDescription: sidepane === SIDE_PANE_OPTIONS.ROOM_DETAILS,
166
166
  virtualBackground: sidepane === SIDE_PANE_OPTIONS.VB,
167
167
  };
168
168
 
@@ -6,7 +6,6 @@ import {
6
6
  } from '@100mslive/types-prebuilt';
7
7
  import { match } from 'ts-pattern';
8
8
  import { selectIsConnectedToRoom, selectLocalPeerRoleName, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
9
- // @ts-ignore: No implicit Any
10
9
  import FullPageProgress from '../components/FullPageProgress';
11
10
  import { GridLayout } from '../components/VideoLayouts/GridLayout';
12
11
  import { Box, Flex } from '../../Layout';
@@ -25,7 +24,6 @@ import {
25
24
  } from '../components/AppData/useUISettings';
26
25
  import { useCloseScreenshareWhiteboard } from '../components/hooks/useCloseScreenshareWhiteboard';
27
26
  import { useLandscapeHLSStream, useMobileHLSStream } from '../common/hooks';
28
- // @ts-ignore: No implicit Any
29
27
  import { SESSION_STORE_KEY } from '../common/constants';
30
28
 
31
29
  // @ts-ignore: No implicit Any