@100mslive/roomkit-react 0.3.24-alpha.5 → 0.3.24-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "prebuilt",
11
11
  "roomkit"
12
12
  ],
13
- "version": "0.3.24-alpha.5",
13
+ "version": "0.3.24-alpha.7",
14
14
  "author": "100ms",
15
15
  "license": "MIT",
16
16
  "repository": {
@@ -75,12 +75,12 @@
75
75
  "react": ">=17.0.2 <19.0.0"
76
76
  },
77
77
  "dependencies": {
78
- "@100mslive/hls-player": "0.3.24-alpha.5",
78
+ "@100mslive/hls-player": "0.3.24-alpha.7",
79
79
  "@100mslive/hms-noise-cancellation": "0.0.1",
80
- "@100mslive/hms-virtual-background": "1.13.24-alpha.5",
81
- "@100mslive/hms-whiteboard": "0.0.14-alpha.5",
82
- "@100mslive/react-icons": "0.10.24-alpha.5",
83
- "@100mslive/react-sdk": "0.10.24-alpha.5",
80
+ "@100mslive/hms-virtual-background": "1.13.24-alpha.7",
81
+ "@100mslive/hms-whiteboard": "0.0.14-alpha.7",
82
+ "@100mslive/react-icons": "0.10.24-alpha.7",
83
+ "@100mslive/react-sdk": "0.10.24-alpha.7",
84
84
  "@100mslive/types-prebuilt": "0.12.12",
85
85
  "@emoji-mart/data": "^1.0.6",
86
86
  "@emoji-mart/react": "^1.0.1",
@@ -117,5 +117,5 @@
117
117
  "uuid": "^8.3.2",
118
118
  "worker-timers": "^7.0.40"
119
119
  },
120
- "gitHead": "dc498407583217b11dc845e391849808c2ace147"
120
+ "gitHead": "8198b4df726edf43ed865408a68720e9bd4c9174"
121
121
  }
@@ -48,7 +48,7 @@ export const Flex = styled('div', {
48
48
  baseline: {
49
49
  alignItems: 'baseline',
50
50
  },
51
- strech: {
51
+ stretch: {
52
52
  alignItems: 'stretch',
53
53
  },
54
54
  },
@@ -27,7 +27,6 @@ import { PIPProvider } from './components/PIP/PIPProvider';
27
27
  import { PreviewScreen } from './components/Preview/PreviewScreen';
28
28
  // @ts-ignore: No implicit Any
29
29
  import { ToastContainer } from './components/Toast/ToastContainer';
30
- import { VBHandler } from './components/VirtualBackground/VBHandler';
31
30
  import { Sheet } from './layouts/Sheet';
32
31
  import { RoomLayoutContext, RoomLayoutProvider, useRoomLayout } from './provider/roomLayoutProvider';
33
32
  import { DialogContainerProvider } from '../context/DialogContext';
@@ -130,7 +129,6 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps
130
129
  useEffect(() => {
131
130
  // leave room when component unmounts
132
131
  return () => {
133
- VBHandler.reset();
134
132
  reactiveStore?.current?.hmsActions.leave();
135
133
  };
136
134
  }, []);
@@ -1,5 +1,6 @@
1
1
  import React, { useContext, useEffect } from 'react';
2
2
  import { usePreviousDistinct } from 'react-use';
3
+ import { HMSVirtualBackgroundTypes } from '@100mslive/hms-virtual-background';
3
4
  import { match, P } from 'ts-pattern';
4
5
  import { HMSRoomState, selectRoomState, useHMSActions, useHMSStore } from '@100mslive/react-sdk';
5
6
  import { VBHandler } from './components/VirtualBackground/VBHandler';
@@ -79,6 +80,7 @@ export const useAppStateManager = () => {
79
80
  .otherwise(() => PrebuiltStates.MEETING);
80
81
  });
81
82
  VBHandler.reset();
83
+ hmsActions.setAppData(APP_DATA.background, HMSVirtualBackgroundTypes.NONE);
82
84
  redirectToLeave(1000); // to clear toasts after 1 second
83
85
  },
84
86
  )
@@ -88,6 +90,6 @@ export const useAppStateManager = () => {
88
90
  .otherwise(() => {
89
91
  // do nothing
90
92
  });
91
- }, [roomLayout, roomState, isLeaveScreenEnabled, isPreviewScreenEnabled, prevRoomState, redirectToLeave]);
93
+ }, [roomLayout, roomState, isLeaveScreenEnabled, isPreviewScreenEnabled, prevRoomState, redirectToLeave, hmsActions]);
92
94
  return { activeState, rejoin };
93
95
  };
@@ -107,8 +107,8 @@ const AuthToken = React.memo<{
107
107
  const convertError = (error: HMSException) => {
108
108
  console.error('[error]', { error });
109
109
  console.warn(
110
- 'If you think this is a mistake on our side, please reach out to us over Discord:',
111
- 'https://discord.com/invite/kGdmszyzq2',
110
+ 'If you think this is a mistake on our side, please reach out to us on Dashboard:',
111
+ 'https://dashboard.100ms.live/dashboard',
112
112
  );
113
113
  return match([error.action, error.code])
114
114
  .with(['GET_TOKEN', 403], () => ({
@@ -49,8 +49,8 @@ export class ErrorBoundary extends Component {
49
49
  <Text>Message: ${this.state.error}</Text>
50
50
  <br />
51
51
  Please reload to see if it works. If you think this is a mistake on our side, please reach out to us on
52
- <a href="https://discord.com/invite/kGdmszyzq2" target="_blank" rel="noreferrer">
53
- Discord
52
+ <a href="https://dashboard.100ms.live/dashboard" target="_blank" rel="noreferrer">
53
+ Dashboard
54
54
  </a>
55
55
  </div>
56
56
  <Flex>
@@ -1,5 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
2
+ import {
3
+ HMSNotificationTypes,
4
+ HMSTrackException,
5
+ HMSTrackExceptionTrackType,
6
+ useHMSNotifications,
7
+ } from '@100mslive/react-sdk';
3
8
  import { Button, Dialog, Text } from '../../..';
4
9
  // @ts-ignore: No implicit Any
5
10
  import { DialogContent, DialogRow } from '../../primitives/DialogContent';
@@ -24,6 +29,11 @@ export function DeviceInUseError() {
24
29
  if (!error || error.code !== 3003) {
25
30
  return;
26
31
  }
32
+ const errorTrackExceptionType = (error as HMSTrackException)?.trackType;
33
+ const hasAudio = errorTrackExceptionType === HMSTrackExceptionTrackType.AUDIO;
34
+ const hasVideo = errorTrackExceptionType === HMSTrackExceptionTrackType.VIDEO;
35
+ const hasAudioVideo = errorTrackExceptionType === HMSTrackExceptionTrackType.AUDIO_VIDEO;
36
+ const hasScreen = errorTrackExceptionType === HMSTrackExceptionTrackType.SCREEN;
27
37
 
28
38
  const errorMessage = error?.message;
29
39
  ToastManager.addToast({
@@ -35,10 +45,7 @@ export function DeviceInUseError() {
35
45
  ),
36
46
  });
37
47
 
38
- const hasAudio = errorMessage.includes('audio');
39
- const hasVideo = errorMessage.includes('video');
40
- const hasScreen = errorMessage.includes('screen');
41
- if (hasAudio && hasVideo) {
48
+ if (hasAudioVideo) {
42
49
  setDeviceType('camera and microphone');
43
50
  } else if (hasAudio) {
44
51
  setDeviceType('microphone');
@@ -1,6 +1,12 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { useMedia } from 'react-use';
3
- import { HMSException, HMSNotificationTypes, useHMSNotifications } from '@100mslive/react-sdk';
3
+ import {
4
+ HMSException,
5
+ HMSNotificationTypes,
6
+ HMSTrackException,
7
+ HMSTrackExceptionTrackType,
8
+ useHMSNotifications,
9
+ } from '@100mslive/react-sdk';
4
10
  import { Button, config as cssConfig, Dialog, Flex, Text } from '../../..';
5
11
  // @ts-ignore: No implicit Any
6
12
  import androidPermissionAlert from '../../images/android-perm-1.png';
@@ -26,11 +32,13 @@ export const PermissionErrorModal = ({ error }: { error?: HMSException }) => {
26
32
  ) {
27
33
  return;
28
34
  }
29
- const errorMessage = error?.message;
30
- const hasAudio = errorMessage.includes('audio');
31
- const hasVideo = errorMessage.includes('video');
32
- const hasScreen = errorMessage.includes('screen');
33
- if (hasAudio && hasVideo) {
35
+
36
+ const errorTrackExceptionType = (error as HMSTrackException)?.trackType;
37
+ const hasAudio = errorTrackExceptionType === HMSTrackExceptionTrackType.AUDIO;
38
+ const hasVideo = errorTrackExceptionType === HMSTrackExceptionTrackType.VIDEO;
39
+ const hasAudioVideo = errorTrackExceptionType === HMSTrackExceptionTrackType.AUDIO_VIDEO;
40
+ const hasScreen = errorTrackExceptionType === HMSTrackExceptionTrackType.SCREEN;
41
+ if (hasAudioVideo) {
34
42
  setDeviceType('camera and microphone');
35
43
  } else if (hasAudio) {
36
44
  setDeviceType('microphone');
@@ -20,7 +20,7 @@ export const Grid = React.forwardRef<HTMLDivElement, { tiles: TrackWithPeerAndDi
20
20
  justifyContent: 'center',
21
21
  flexFlow: 'row wrap',
22
22
  minHeight: 0,
23
- '@md': { gap: edgeToEdge ? 0 : '$4' },
23
+ '@lg': { gap: edgeToEdge ? 0 : '$4' },
24
24
  }}
25
25
  >
26
26
  {tiles?.map(tile => {
@@ -77,7 +77,7 @@ export const useTileLayout = ({
77
77
  return rowElements;
78
78
  });
79
79
 
80
- const gap = edgeToEdge ? 0 : 8; // gap between flex items
80
+ const gap = edgeToEdge && isMobile ? 0 : 8; // gap between flex items
81
81
  const maxHeight = height - (maxRows - 1) * gap;
82
82
  const maxRowHeight = maxHeight / matrix.length;
83
83
  const aspectRatios =
@@ -115,11 +115,10 @@ export const useTileLayout = ({
115
115
  }
116
116
  }
117
117
  }
118
- // Beam layout breaks at 480p resolution because the gap of $4 between tiles is not accounted for
119
- // There could be more such cases, this is a generic fix
118
+
120
119
  for (let i = 0; i < row.length; i++) {
121
- row[i].width = tileWidth - (gap / maxCols) * (maxCols - 1);
122
- row[i].height = tileHeight - (gap / maxRows) * (maxRows - 1);
120
+ row[i].width = tileWidth;
121
+ row[i].height = tileHeight;
123
122
  }
124
123
  }
125
124
  }