@100mslive/roomkit-react 0.2.7-alpha.2 → 0.2.7-alpha.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-DQJBCEW4.js → HLSView-AP53XUDF.js} +2 -2
- package/dist/{chunk-GEXL6KL2.js → chunk-LZKKW4D6.js} +117 -98
- package/dist/chunk-LZKKW4D6.js.map +7 -0
- package/dist/index.cjs.js +114 -97
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +32 -22
- package/dist/meta.esbuild.json +38 -28
- package/package.json +6 -6
- package/src/Prebuilt/components/AppData/useUISettings.js +1 -1
- package/src/Prebuilt/components/AudioVideoToggle.tsx +31 -27
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +6 -2
- package/src/Prebuilt/components/Notifications/HandRaisedNotifications.tsx +4 -8
- package/src/Prebuilt/components/Notifications/Notifications.tsx +15 -2
- package/src/Prebuilt/components/ScreenShareToggle.jsx +5 -3
- package/dist/chunk-GEXL6KL2.js.map +0 -7
- /package/dist/{HLSView-DQJBCEW4.js.map → HLSView-AP53XUDF.js.map} +0 -0
@@ -4,9 +4,11 @@ import {
|
|
4
4
|
HMSNotificationTypes,
|
5
5
|
HMSRoleChangeRequest,
|
6
6
|
HMSRoomState,
|
7
|
+
selectIsLocalScreenShared,
|
7
8
|
selectLocalPeerID,
|
8
9
|
selectPeerNameByID,
|
9
10
|
selectRoomState,
|
11
|
+
useAwayNotifications,
|
10
12
|
useCustomEvent,
|
11
13
|
useHMSNotifications,
|
12
14
|
useHMSStore,
|
@@ -14,7 +16,7 @@ import {
|
|
14
16
|
} from '@100mslive/react-sdk';
|
15
17
|
import { GroupIcon } from '@100mslive/react-icons';
|
16
18
|
import { Box, Button } from '../../..';
|
17
|
-
import { useUpdateRoomLayout } from '../../provider/roomLayoutProvider';
|
19
|
+
import { useRoomLayout, useUpdateRoomLayout } from '../../provider/roomLayoutProvider';
|
18
20
|
// @ts-ignore: No implicit Any
|
19
21
|
import { ToastManager } from '../Toast/ToastManager';
|
20
22
|
import { AutoplayBlockedModal } from './AutoplayBlockedModal';
|
@@ -39,13 +41,16 @@ const pollToastKey: Record<string, string> = {};
|
|
39
41
|
export function Notifications() {
|
40
42
|
const localPeerID = useHMSStore(selectLocalPeerID);
|
41
43
|
const notification = useHMSNotifications();
|
42
|
-
const subscribedNotifications = useSubscribedNotifications();
|
44
|
+
const subscribedNotifications = useSubscribedNotifications() || {};
|
43
45
|
const roomState = useHMSStore(selectRoomState);
|
44
46
|
const updateRoomLayoutForRole = useUpdateRoomLayout();
|
45
47
|
const isNotificationDisabled = useIsNotificationDisabled();
|
46
48
|
const screenProps = useRoomLayoutConferencingScreen();
|
47
49
|
const vanillaStore = useHMSVanillaStore();
|
48
50
|
const togglePollView = usePollViewToggle();
|
51
|
+
const { showNotification } = useAwayNotifications();
|
52
|
+
const amIScreenSharing = useHMSStore(selectIsLocalScreenShared);
|
53
|
+
const logoURL = useRoomLayout()?.logo?.url;
|
49
54
|
|
50
55
|
const handleRoleChangeDenied = useCallback((request: HMSRoleChangeRequest & { peerName: string }) => {
|
51
56
|
ToastManager.addToast({
|
@@ -165,6 +170,14 @@ export function Notifications() {
|
|
165
170
|
delete pollToastKey[notification?.data.id];
|
166
171
|
}
|
167
172
|
break;
|
173
|
+
case HMSNotificationTypes.NEW_MESSAGE:
|
174
|
+
if (amIScreenSharing) {
|
175
|
+
showNotification(`New message from ${notification.data.senderName}`, {
|
176
|
+
body: notification.data.message,
|
177
|
+
icon: logoURL,
|
178
|
+
});
|
179
|
+
}
|
180
|
+
break;
|
168
181
|
default:
|
169
182
|
break;
|
170
183
|
}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React, { Fragment } from 'react';
|
2
|
-
import { selectIsAllowedToPublish, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
|
2
|
+
import { selectIsAllowedToPublish, useAwayNotifications, useHMSStore, useScreenShare } from '@100mslive/react-sdk';
|
3
3
|
import { ShareScreenIcon } from '@100mslive/react-icons';
|
4
4
|
import { ShareScreenOptions } from './pdfAnnotator/shareScreenOptions';
|
5
5
|
import { Box, Flex } from '../../Layout';
|
@@ -14,6 +14,7 @@ export const ScreenshareToggle = ({ css = {} }) => {
|
|
14
14
|
const isAudioOnly = useUISettings(UI_SETTINGS.isAudioOnly);
|
15
15
|
|
16
16
|
const { amIScreenSharing, screenShareVideoTrackId: video, toggleScreenShare } = useScreenShare();
|
17
|
+
const { requestPermission } = useAwayNotifications();
|
17
18
|
const isVideoScreenshare = amIScreenSharing && !!video;
|
18
19
|
if (!isAllowedToPublish.screen || !isScreenshareSupported()) {
|
19
20
|
return null;
|
@@ -28,8 +29,9 @@ export const ScreenshareToggle = ({ css = {} }) => {
|
|
28
29
|
active={!isVideoScreenshare}
|
29
30
|
css={css}
|
30
31
|
disabled={isAudioOnly}
|
31
|
-
onClick={() => {
|
32
|
-
toggleScreenShare();
|
32
|
+
onClick={async () => {
|
33
|
+
await toggleScreenShare();
|
34
|
+
await requestPermission();
|
33
35
|
}}
|
34
36
|
>
|
35
37
|
<Tooltip title={`${!isVideoScreenshare ? 'Start' : 'Stop'} screen sharing`}>
|