@100mslive/roomkit-react 0.2.7-alpha.1 → 0.2.7-alpha.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/{HLSView-4B5MUDFR.js → HLSView-NDCESLVD.js} +2 -2
- package/dist/Prebuilt/common/constants.d.ts +5 -0
- package/dist/Prebuilt/components/AppData/useSheet.d.ts +4 -0
- package/dist/Prebuilt/components/Header/RoomDetailsHeader.d.ts +2 -0
- package/dist/Prebuilt/components/Polls/common/utils.d.ts +1 -1
- package/dist/Prebuilt/components/RoomDetails/Duration.d.ts +4 -0
- package/dist/Prebuilt/components/RoomDetails/RoomDetailsPane.d.ts +2 -0
- package/dist/Prebuilt/components/RoomDetails/RoomDetailsRow.d.ts +4 -0
- package/dist/Prebuilt/components/RoomDetails/RoomDetailsSheet.d.ts +2 -0
- package/dist/Prebuilt/layouts/Sheet.d.ts +2 -0
- package/dist/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.d.ts +5 -0
- package/dist/{chunk-KST24BRA.js → chunk-AGREPSFA.js} +1514 -1311
- package/dist/chunk-AGREPSFA.js.map +7 -0
- package/dist/index.cjs.js +2849 -2581
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.js +1 -1
- package/dist/meta.cjs.json +502 -59
- package/dist/meta.esbuild.json +511 -68
- package/package.json +7 -7
- package/src/Prebuilt/App.tsx +2 -0
- package/src/Prebuilt/common/constants.ts +6 -0
- package/src/Prebuilt/components/AppData/AppData.tsx +1 -0
- package/src/Prebuilt/components/AppData/useSheet.ts +33 -0
- package/src/Prebuilt/components/AppData/useUISettings.js +1 -1
- package/src/Prebuilt/components/AudioVideoToggle.tsx +31 -27
- package/src/Prebuilt/components/Chat/ChatFooter.tsx +0 -1
- package/src/Prebuilt/components/Header/Header.tsx +2 -0
- package/src/Prebuilt/components/Header/RoomDetailsHeader.tsx +51 -0
- package/src/Prebuilt/components/MoreSettings/SplitComponents/MwebOptions.tsx +18 -2
- package/src/Prebuilt/components/Notifications/HandRaisedNotifications.tsx +4 -8
- package/src/Prebuilt/components/Notifications/Notifications.tsx +15 -2
- package/src/Prebuilt/components/Polls/common/utils.ts +15 -9
- package/src/Prebuilt/components/RoomDetails/Duration.tsx +26 -0
- package/src/Prebuilt/components/RoomDetails/RoomDetailsPane.tsx +36 -0
- package/src/Prebuilt/components/RoomDetails/RoomDetailsRow.tsx +23 -0
- package/src/Prebuilt/components/RoomDetails/RoomDetailsSheet.tsx +45 -0
- package/src/Prebuilt/components/ScreenShareToggle.jsx +5 -3
- package/src/Prebuilt/layouts/Sheet.tsx +14 -0
- package/src/Prebuilt/layouts/SidePane.tsx +4 -0
- package/src/Prebuilt/provider/roomLayoutProvider/hooks/useRoomLayoutScreen.ts +40 -0
- package/dist/chunk-KST24BRA.js.map +0 -7
- /package/dist/{HLSView-4B5MUDFR.js.map → HLSView-NDCESLVD.js.map} +0 -0
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
|
|
2
2
|
import { useMedia } from 'react-use';
|
3
3
|
import { selectAppData, selectVideoTrackByPeerID, useHMSStore } from '@100mslive/react-sdk';
|
4
4
|
import { Polls } from '../components/Polls/Polls';
|
5
|
+
import { RoomDetailsPane } from '../components/RoomDetails/RoomDetailsPane';
|
5
6
|
import { LayoutMode } from '../components/Settings/LayoutSettings';
|
6
7
|
import { SidePaneTabs } from '../components/SidePaneTabs';
|
7
8
|
import { TileCustomisationProps } from '../components/VideoLayouts/GridLayout';
|
@@ -52,6 +53,9 @@ const SidePane = ({
|
|
52
53
|
if (sidepane === SIDE_PANE_OPTIONS.VB) {
|
53
54
|
ViewComponent = <VBPicker backgroundMedia={backgroundMedia} />;
|
54
55
|
}
|
56
|
+
if (sidepane === SIDE_PANE_OPTIONS.ROOM_DETAILS) {
|
57
|
+
ViewComponent = <RoomDetailsPane />;
|
58
|
+
}
|
55
59
|
|
56
60
|
useEffect(() => {
|
57
61
|
return () => {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { useMemo } from 'react';
|
1
2
|
import {
|
2
3
|
ConferencingScreen,
|
3
4
|
DefaultConferencingScreen_Elements,
|
@@ -7,7 +8,16 @@ import {
|
|
7
8
|
PreviewScreen,
|
8
9
|
Screens,
|
9
10
|
} from '@100mslive/types-prebuilt';
|
11
|
+
import {
|
12
|
+
selectHLSState,
|
13
|
+
selectPeerCount,
|
14
|
+
selectRoomStartTime,
|
15
|
+
useHMSStore,
|
16
|
+
useRecordingStreaming,
|
17
|
+
} from '@100mslive/react-sdk';
|
10
18
|
import { useRoomLayout } from '..';
|
19
|
+
// @ts-ignore
|
20
|
+
import { getFormattedCount } from '../../../common/utils';
|
11
21
|
|
12
22
|
export type useRoomLayoutScreenProps = {
|
13
23
|
screen: keyof Screens;
|
@@ -69,3 +79,33 @@ export function useRoomLayoutLeaveScreen() {
|
|
69
79
|
isLeaveScreenEnabled,
|
70
80
|
};
|
71
81
|
}
|
82
|
+
|
83
|
+
export function useRoomLayoutHeader() {
|
84
|
+
const { elements } = useRoomLayoutConferencingScreen();
|
85
|
+
// return elements.header;
|
86
|
+
const { isRecordingOn } = useRecordingStreaming();
|
87
|
+
const peerCount = useHMSStore(selectPeerCount);
|
88
|
+
const sessionStartedAt = useHMSStore(selectRoomStartTime);
|
89
|
+
const hlsState = useHMSStore(selectHLSState);
|
90
|
+
|
91
|
+
// People watching, start timestamp, recording status
|
92
|
+
const details = useMemo(() => {
|
93
|
+
const details = [];
|
94
|
+
if (hlsState?.variants[0]?.['startedAt']) {
|
95
|
+
details.push(`${getFormattedCount(peerCount)} watching`);
|
96
|
+
details.push(hlsState.variants[0]['startedAt']);
|
97
|
+
} else if (sessionStartedAt) {
|
98
|
+
details.push(sessionStartedAt);
|
99
|
+
}
|
100
|
+
if (isRecordingOn) {
|
101
|
+
details.push('Recording');
|
102
|
+
}
|
103
|
+
return details;
|
104
|
+
}, [hlsState?.variants, isRecordingOn, peerCount, sessionStartedAt]);
|
105
|
+
|
106
|
+
return {
|
107
|
+
title: elements.header?.title || '',
|
108
|
+
description: elements.header?.description || '',
|
109
|
+
details,
|
110
|
+
};
|
111
|
+
}
|