@100mslive/react-native-room-kit 1.1.7 → 1.1.8
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/lib/commonjs/HMSRoomSetup.js +8 -0
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/Pencil/assets/pencil-board.png +0 -0
- package/lib/commonjs/Icons/Pencil/assets/pencil-board@2x.png +0 -0
- package/lib/commonjs/Icons/Pencil/assets/pencil-board@3x.png +0 -0
- package/lib/commonjs/Icons/Pencil/index.js +2 -1
- package/lib/commonjs/Icons/Pencil/index.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +2 -1
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/Footer.js +1 -1
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/FullScreenWhiteboard.js +58 -0
- package/lib/commonjs/components/FullScreenWhiteboard.js.map +1 -0
- package/lib/commonjs/components/GridView.js +6 -4
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/HLSChatView.js +7 -2
- package/lib/commonjs/components/HLSChatView.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerContainer.js +4 -1
- package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js +22 -2
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +63 -6
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/TilesContainer.js +4 -4
- package/lib/commonjs/components/TilesContainer.js.map +1 -1
- package/lib/commonjs/components/WebrtcView.js +2 -2
- package/lib/commonjs/components/WebrtcView.js.map +1 -1
- package/lib/commonjs/components/Whiteboard.js +72 -0
- package/lib/commonjs/components/Whiteboard.js.map +1 -0
- package/lib/commonjs/components/WhiteboardContainer.js +35 -0
- package/lib/commonjs/components/WhiteboardContainer.js.map +1 -0
- package/lib/commonjs/components/WhiteboardFullScreenButton.js +42 -0
- package/lib/commonjs/components/WhiteboardFullScreenButton.js.map +1 -0
- package/lib/commonjs/hooks-util.js +36 -6
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +3 -0
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +14 -2
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +8 -0
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/redux/reducers/hmsStates.js +7 -1
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +10 -2
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/Pencil/assets/pencil-board.png +0 -0
- package/lib/module/Icons/Pencil/assets/pencil-board@2x.png +0 -0
- package/lib/module/Icons/Pencil/assets/pencil-board@3x.png +0 -0
- package/lib/module/Icons/Pencil/index.js +2 -1
- package/lib/module/Icons/Pencil/index.js.map +1 -1
- package/lib/module/components/DisplayView.js +2 -1
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/Footer.js +1 -1
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/FullScreenWhiteboard.js +48 -0
- package/lib/module/components/FullScreenWhiteboard.js.map +1 -0
- package/lib/module/components/GridView.js +6 -4
- package/lib/module/components/GridView.js.map +1 -1
- package/lib/module/components/HLSChatView.js +7 -2
- package/lib/module/components/HLSChatView.js.map +1 -1
- package/lib/module/components/HLSPlayerContainer.js +4 -1
- package/lib/module/components/HLSPlayerContainer.js.map +1 -1
- package/lib/module/components/MeetingScreenContent.js +23 -3
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +65 -8
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/TilesContainer.js +4 -4
- package/lib/module/components/TilesContainer.js.map +1 -1
- package/lib/module/components/WebrtcView.js +2 -2
- package/lib/module/components/WebrtcView.js.map +1 -1
- package/lib/module/components/Whiteboard.js +64 -0
- package/lib/module/components/Whiteboard.js.map +1 -0
- package/lib/module/components/WhiteboardContainer.js +27 -0
- package/lib/module/components/WhiteboardContainer.js.map +1 -0
- package/lib/module/components/WhiteboardFullScreenButton.js +33 -0
- package/lib/module/components/WhiteboardFullScreenButton.js.map +1 -0
- package/lib/module/hooks-util.js +36 -6
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +3 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +10 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +8 -0
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +7 -1
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/Pencil/index.d.ts +1 -0
- package/lib/typescript/Icons/Pencil/index.d.ts.map +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/FullScreenWhiteboard.d.ts +3 -0
- package/lib/typescript/components/FullScreenWhiteboard.d.ts.map +1 -0
- package/lib/typescript/components/GridView.d.ts.map +1 -1
- package/lib/typescript/components/HLSChatView.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
- package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/TilesContainer.d.ts.map +1 -1
- package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
- package/lib/typescript/components/Whiteboard.d.ts +6 -0
- package/lib/typescript/components/Whiteboard.d.ts.map +1 -0
- package/lib/typescript/components/WhiteboardContainer.d.ts +6 -0
- package/lib/typescript/components/WhiteboardContainer.d.ts.map +1 -0
- package/lib/typescript/components/WhiteboardFullScreenButton.d.ts +5 -0
- package/lib/typescript/components/WhiteboardFullScreenButton.d.ts.map +1 -0
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +2 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +11 -1
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +2 -0
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +1 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts +7 -2
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +2 -0
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/HMSRoomSetup.tsx +21 -0
- package/src/Icons/Pencil/assets/pencil-board.png +0 -0
- package/src/Icons/Pencil/assets/pencil-board@2x.png +0 -0
- package/src/Icons/Pencil/assets/pencil-board@3x.png +0 -0
- package/src/Icons/Pencil/index.tsx +9 -2
- package/src/components/DisplayView.tsx +3 -0
- package/src/components/Footer.tsx +5 -2
- package/src/components/FullScreenWhiteboard.tsx +59 -0
- package/src/components/GridView.tsx +14 -5
- package/src/components/HLSChatView.tsx +7 -4
- package/src/components/HLSPlayerContainer.tsx +15 -7
- package/src/components/MeetingScreenContent.tsx +28 -2
- package/src/components/RoomSettingsModalContent.tsx +77 -2
- package/src/components/TilesContainer.tsx +7 -5
- package/src/components/WebrtcView.tsx +11 -4
- package/src/components/Whiteboard.tsx +101 -0
- package/src/components/WhiteboardContainer.tsx +35 -0
- package/src/components/WhiteboardFullScreenButton.tsx +52 -0
- package/src/hooks-util.ts +41 -9
- package/src/redux/actionTypes.ts +4 -0
- package/src/redux/actions/index.ts +11 -0
- package/src/redux/reducers/appState.ts +8 -0
- package/src/redux/reducers/hmsStates.ts +15 -1
|
@@ -49,8 +49,10 @@ export const WebrtcView = React.forwardRef<GridViewRefAttrs, WebrtcViewProps>(
|
|
|
49
49
|
(state: RootState) => state.user.spotlightTrackId
|
|
50
50
|
);
|
|
51
51
|
|
|
52
|
-
const
|
|
53
|
-
(state: RootState) =>
|
|
52
|
+
const screenshareTilesOrWhiteboardAcive = useSelector(
|
|
53
|
+
(state: RootState) =>
|
|
54
|
+
state.app.screensharePeerTrackNodes.length > 0 ||
|
|
55
|
+
!!state.hmsStates.whiteboard
|
|
54
56
|
);
|
|
55
57
|
|
|
56
58
|
const pairedPeers = useMemo(
|
|
@@ -58,13 +60,18 @@ export const WebrtcView = React.forwardRef<GridViewRefAttrs, WebrtcViewProps>(
|
|
|
58
60
|
pairData(
|
|
59
61
|
peerTrackNodes,
|
|
60
62
|
isPortrait
|
|
61
|
-
?
|
|
63
|
+
? screenshareTilesOrWhiteboardAcive
|
|
62
64
|
? MaxTilesInOnePage.IN_PORTRAIT_WITH_SCREENSHARES
|
|
63
65
|
: MaxTilesInOnePage.IN_PORTRAIT
|
|
64
66
|
: MaxTilesInOnePage.IN_LANDSCAPE,
|
|
65
67
|
spotlightTrackId
|
|
66
68
|
),
|
|
67
|
-
[
|
|
69
|
+
[
|
|
70
|
+
peerTrackNodes,
|
|
71
|
+
screenshareTilesOrWhiteboardAcive,
|
|
72
|
+
spotlightTrackId,
|
|
73
|
+
isPortrait,
|
|
74
|
+
]
|
|
68
75
|
);
|
|
69
76
|
|
|
70
77
|
const showWelcomeBanner = useSelector(
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Platform, View } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { WebView } from 'react-native-webview';
|
|
5
|
+
import type { WebViewProps } from 'react-native-webview';
|
|
6
|
+
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { PipModes } from '../utils/types';
|
|
9
|
+
import { useIsLandscapeOrientation } from '../utils/dimension';
|
|
10
|
+
import { WhiteboardFullScreenButton } from './WhiteboardFullScreenButton';
|
|
11
|
+
import type {
|
|
12
|
+
WebViewError,
|
|
13
|
+
WebViewErrorEvent,
|
|
14
|
+
} from 'react-native-webview/lib/WebViewTypes';
|
|
15
|
+
|
|
16
|
+
export type WhiteboardProps = {};
|
|
17
|
+
|
|
18
|
+
export const _Whiteboard = React.forwardRef<
|
|
19
|
+
React.Ref<React.ElementRef<typeof WebView> | null>,
|
|
20
|
+
WhiteboardProps
|
|
21
|
+
>((_props, webviewRef) => {
|
|
22
|
+
const localWebviewRef = React.useRef<null | React.ElementRef<typeof WebView>>(
|
|
23
|
+
null
|
|
24
|
+
);
|
|
25
|
+
React.useImperativeHandle(webviewRef, () => localWebviewRef, []);
|
|
26
|
+
|
|
27
|
+
const whiteboardUrl = useSelector(
|
|
28
|
+
(state: RootState) => state.hmsStates.whiteboard?.url
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
//#region reconnection handling
|
|
32
|
+
let webviewError = React.useRef<WebViewError | null>(null);
|
|
33
|
+
const webviewErrorHandler = React.useCallback((e: WebViewErrorEvent) => {
|
|
34
|
+
webviewError.current = e.nativeEvent;
|
|
35
|
+
}, []);
|
|
36
|
+
|
|
37
|
+
if (Platform.OS === 'ios') {
|
|
38
|
+
const prevReconnecting = React.useRef<boolean | null>(null);
|
|
39
|
+
const reconnecting = useSelector(
|
|
40
|
+
(state: RootState) => state.hmsStates.reconnecting
|
|
41
|
+
);
|
|
42
|
+
if (
|
|
43
|
+
whiteboardUrl &&
|
|
44
|
+
localWebviewRef.current !== null &&
|
|
45
|
+
webviewError.current !== null &&
|
|
46
|
+
prevReconnecting.current === true &&
|
|
47
|
+
reconnecting === false
|
|
48
|
+
) {
|
|
49
|
+
localWebviewRef.current.reload();
|
|
50
|
+
}
|
|
51
|
+
prevReconnecting.current = reconnecting;
|
|
52
|
+
}
|
|
53
|
+
//#endregion reconnection handling
|
|
54
|
+
|
|
55
|
+
const isPipModeActive = useSelector(
|
|
56
|
+
(state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
|
|
57
|
+
);
|
|
58
|
+
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
59
|
+
|
|
60
|
+
if (!whiteboardUrl) return null;
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<View style={{ flex: 1, position: 'relative' }}>
|
|
64
|
+
<HMSWebView
|
|
65
|
+
ref={localWebviewRef}
|
|
66
|
+
url={whiteboardUrl}
|
|
67
|
+
onError={webviewErrorHandler}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
{isPipModeActive || isLandscapeOrientation ? null : (
|
|
71
|
+
<WhiteboardFullScreenButton />
|
|
72
|
+
)}
|
|
73
|
+
</View>
|
|
74
|
+
);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const Whiteboard = React.memo(_Whiteboard);
|
|
78
|
+
|
|
79
|
+
//# Memoized Webview
|
|
80
|
+
|
|
81
|
+
interface HMSWebViewProps extends WebViewProps {
|
|
82
|
+
url: string;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const _HMSWebView = React.forwardRef<
|
|
86
|
+
React.ElementRef<typeof WebView>,
|
|
87
|
+
HMSWebViewProps
|
|
88
|
+
>((props, webviewRef) => {
|
|
89
|
+
return (
|
|
90
|
+
<WebView
|
|
91
|
+
ref={webviewRef}
|
|
92
|
+
source={{ uri: props.url }}
|
|
93
|
+
style={{ flex: 1 }}
|
|
94
|
+
javaScriptEnabled={true}
|
|
95
|
+
domStorageEnabled={true}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const HMSWebView = React.memo(_HMSWebView);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Platform, View } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { WebView } from 'react-native-webview';
|
|
5
|
+
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
|
|
6
|
+
|
|
7
|
+
import type { RootState } from '../redux';
|
|
8
|
+
import { Whiteboard } from './Whiteboard';
|
|
9
|
+
|
|
10
|
+
export type WhiteboardContainerProps = {};
|
|
11
|
+
|
|
12
|
+
export const _WhiteboardContainer = React.forwardRef<
|
|
13
|
+
React.RefObject<React.ElementRef<typeof WebView> | null>,
|
|
14
|
+
WhiteboardContainerProps
|
|
15
|
+
>((_props, webviewRef) => {
|
|
16
|
+
const fullScreenWhiteboard = useSelector(
|
|
17
|
+
(state: RootState) => state.app.fullScreenWhiteboard
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<View style={{ flex: 1, marginBottom: 4 }}>
|
|
22
|
+
{fullScreenWhiteboard ? null : Platform.OS === 'ios' ? (
|
|
23
|
+
<GestureDetector gesture={Gesture.Tap()}>
|
|
24
|
+
<View collapsable={false} style={{ flex: 1 }}>
|
|
25
|
+
<Whiteboard ref={webviewRef} />
|
|
26
|
+
</View>
|
|
27
|
+
</GestureDetector>
|
|
28
|
+
) : (
|
|
29
|
+
<Whiteboard ref={webviewRef} />
|
|
30
|
+
)}
|
|
31
|
+
</View>
|
|
32
|
+
);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const WhiteboardContainer = React.memo(_WhiteboardContainer);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
|
+
|
|
5
|
+
import { PressableIcon } from './PressableIcon';
|
|
6
|
+
import { MaximizeIcon, MinimizeIcon } from '../Icons';
|
|
7
|
+
import { useHMSRoomStyle } from '../hooks-util';
|
|
8
|
+
import { hexToRgbA } from '../utils/theme';
|
|
9
|
+
import type { RootState } from '../redux';
|
|
10
|
+
import { setFullScreenWhiteboard } from '../redux/actions';
|
|
11
|
+
|
|
12
|
+
export interface WhiteboardFullScreenButtonProps {}
|
|
13
|
+
|
|
14
|
+
export const WhiteboardFullScreenButton: React.FC<
|
|
15
|
+
WhiteboardFullScreenButtonProps
|
|
16
|
+
> = () => {
|
|
17
|
+
const dispatch = useDispatch();
|
|
18
|
+
const fullScreenWhiteboard = useSelector(
|
|
19
|
+
(state: RootState) => state.app.fullScreenWhiteboard
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
const buttonStyles = useHMSRoomStyle((theme) => ({
|
|
23
|
+
backgroundColor:
|
|
24
|
+
theme.palette.background_dim &&
|
|
25
|
+
hexToRgbA(theme.palette.background_dim, 0.64),
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const maximizeAction = !fullScreenWhiteboard;
|
|
29
|
+
|
|
30
|
+
const handleFullScreenPress = () => {
|
|
31
|
+
dispatch(setFullScreenWhiteboard(!fullScreenWhiteboard));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<PressableIcon
|
|
36
|
+
border={false}
|
|
37
|
+
onPress={handleFullScreenPress}
|
|
38
|
+
style={[styles.container, buttonStyles]}
|
|
39
|
+
>
|
|
40
|
+
{maximizeAction ? <MaximizeIcon /> : <MinimizeIcon />}
|
|
41
|
+
</PressableIcon>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
container: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
top: 8,
|
|
49
|
+
right: 8,
|
|
50
|
+
padding: 8,
|
|
51
|
+
},
|
|
52
|
+
});
|
package/src/hooks-util.ts
CHANGED
|
@@ -601,9 +601,11 @@ const useHMSTrackUpdate = (
|
|
|
601
601
|
const miniviewPeerTrackNode = reduxState.app.miniviewPeerTrackNode;
|
|
602
602
|
const localPeerTrackNode = reduxState.app.localPeerTrackNode;
|
|
603
603
|
|
|
604
|
+
const localPeerRole = reduxState.hmsStates.localPeer?.role ?? null;
|
|
605
|
+
|
|
604
606
|
const currentLayoutConfig = selectLayoutConfigForRole(
|
|
605
607
|
reduxState.hmsStates.layoutConfig,
|
|
606
|
-
|
|
608
|
+
localPeerRole
|
|
607
609
|
);
|
|
608
610
|
|
|
609
611
|
const localTileInsetEnabled =
|
|
@@ -617,6 +619,26 @@ const useHMSTrackUpdate = (
|
|
|
617
619
|
if (!peer.isLocal && track.type === HMSTrackType.VIDEO) {
|
|
618
620
|
dispatch(addScreenshareTile(newPeerTrackNode));
|
|
619
621
|
}
|
|
622
|
+
if (track.type === HMSTrackType.VIDEO) {
|
|
623
|
+
const whiteboard = reduxState.hmsStates.whiteboard;
|
|
624
|
+
// If white board is open and local peer is owner, close whiteboard
|
|
625
|
+
if (
|
|
626
|
+
whiteboard &&
|
|
627
|
+
// Is local peer has whiteboard admin permission
|
|
628
|
+
!!localPeerRole?.permissions?.whiteboard?.admin &&
|
|
629
|
+
// Is local peer owner of whiteboard
|
|
630
|
+
whiteboard.isOwner
|
|
631
|
+
) {
|
|
632
|
+
hmsInstance.interactivityCenter
|
|
633
|
+
.stopWhiteboard()
|
|
634
|
+
.then((success) => {
|
|
635
|
+
console.log('StopWhiteboard on Screenshare: ', success);
|
|
636
|
+
})
|
|
637
|
+
.catch((error) => {
|
|
638
|
+
console.log('StopWhiteboard error: ', error);
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
}
|
|
620
642
|
} else {
|
|
621
643
|
setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
622
644
|
if (
|
|
@@ -3100,6 +3122,11 @@ export const useCanShowRoomOptionsButton = () => {
|
|
|
3100
3122
|
return permissions?.pollRead || permissions?.pollWrite;
|
|
3101
3123
|
});
|
|
3102
3124
|
|
|
3125
|
+
const canStartStopWhiteboard = useSelector((state: RootState) => {
|
|
3126
|
+
const permissions = state.hmsStates.localPeer?.role?.permissions;
|
|
3127
|
+
return permissions?.whiteboard?.admin;
|
|
3128
|
+
});
|
|
3129
|
+
|
|
3103
3130
|
const { canShowParticipants } = useShowChatAndParticipants();
|
|
3104
3131
|
|
|
3105
3132
|
const canEditUsernameFromRoomModal = isViewer && !editUsernameDisabled;
|
|
@@ -3111,15 +3138,18 @@ export const useCanShowRoomOptionsButton = () => {
|
|
|
3111
3138
|
canStartRecording ||
|
|
3112
3139
|
canEditUsernameFromRoomModal ||
|
|
3113
3140
|
canReadOrWritePoll ||
|
|
3141
|
+
canStartStopWhiteboard ||
|
|
3114
3142
|
isNoiseCancellationAvailable;
|
|
3115
3143
|
|
|
3116
3144
|
return canShowOptions;
|
|
3117
3145
|
};
|
|
3118
3146
|
|
|
3119
3147
|
export const useHLSViewsConstraints = () => {
|
|
3120
|
-
const
|
|
3121
|
-
|
|
3122
|
-
|
|
3148
|
+
const fullScreenMode = useSelector((state: RootState) => {
|
|
3149
|
+
const hlsFullScreen = state.app.hlsFullScreen;
|
|
3150
|
+
const isPipModeActive = state.app.pipModeStatus === PipModes.ACTIVE;
|
|
3151
|
+
return hlsFullScreen || isPipModeActive;
|
|
3152
|
+
});
|
|
3123
3153
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
3124
3154
|
const { width: safeAreaWidthFrame, height: safeAreaHeightFrame } =
|
|
3125
3155
|
useSafeAreaFrame();
|
|
@@ -3130,7 +3160,7 @@ export const useHLSViewsConstraints = () => {
|
|
|
3130
3160
|
right: rightInset,
|
|
3131
3161
|
} = useSafeAreaInsets();
|
|
3132
3162
|
|
|
3133
|
-
const playerWrapperConstraints =
|
|
3163
|
+
const playerWrapperConstraints = fullScreenMode
|
|
3134
3164
|
? {
|
|
3135
3165
|
width: safeAreaWidthFrame - leftInset - rightInset,
|
|
3136
3166
|
height: isLandscapeOrientation
|
|
@@ -3165,9 +3195,11 @@ export const useHLSViewsConstraints = () => {
|
|
|
3165
3195
|
};
|
|
3166
3196
|
|
|
3167
3197
|
export const useHLSPlayerConstraints = () => {
|
|
3168
|
-
const
|
|
3169
|
-
|
|
3170
|
-
|
|
3198
|
+
const fullScreenMode = useSelector((state: RootState) => {
|
|
3199
|
+
const hlsFullScreen = state.app.hlsFullScreen;
|
|
3200
|
+
const isPipModeActive = state.app.pipModeStatus === PipModes.ACTIVE;
|
|
3201
|
+
return hlsFullScreen || isPipModeActive;
|
|
3202
|
+
});
|
|
3171
3203
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
3172
3204
|
|
|
3173
3205
|
const resolution = useHMSHLSPlayerResolution();
|
|
@@ -3205,7 +3237,7 @@ export const useHLSPlayerConstraints = () => {
|
|
|
3205
3237
|
/**
|
|
3206
3238
|
* Handling Portrait Orientation
|
|
3207
3239
|
*/
|
|
3208
|
-
if (
|
|
3240
|
+
if (fullScreenMode) {
|
|
3209
3241
|
return {
|
|
3210
3242
|
width: sr > wr ? wrapperWidth : wrapperHeight * sr,
|
|
3211
3243
|
height: sr > wr ? wrapperWidth / sr : wrapperHeight,
|
package/src/redux/actionTypes.ts
CHANGED
|
@@ -66,6 +66,8 @@ const UPDATE_MINI_VIEW_PEERTRACKNODE = 'UPDATE_MINI_VIEW_PEERTRACKNODE';
|
|
|
66
66
|
|
|
67
67
|
const SET_FULLSCREEN_PEERTRACKNODE = 'SET_FULLSCREEN_PEERTRACKNODE';
|
|
68
68
|
|
|
69
|
+
const SET_FULLSCREEN_WHITEBOARD = 'SET_FULLSCREEN_WHITEBOARD';
|
|
70
|
+
|
|
69
71
|
const UPDATE_FULLSCREEN_PEERTRACKNODE = 'UPDATE_FULLSCREEN_PEERTRACKNODE';
|
|
70
72
|
|
|
71
73
|
const SET_LOCAL_PEERTRACKNODE = 'SET_LOCAL_PEERTRACKNODE';
|
|
@@ -143,6 +145,7 @@ export default {
|
|
|
143
145
|
SET_MINI_VIEW_PEERTRACKNODE,
|
|
144
146
|
UPDATE_MINI_VIEW_PEERTRACKNODE,
|
|
145
147
|
SET_FULLSCREEN_PEERTRACKNODE,
|
|
148
|
+
SET_FULLSCREEN_WHITEBOARD,
|
|
146
149
|
UPDATE_FULLSCREEN_PEERTRACKNODE,
|
|
147
150
|
SET_LOCAL_PEERTRACKNODE,
|
|
148
151
|
UPDATE_LOCAL_PEERTRACKNODE,
|
|
@@ -195,6 +198,7 @@ export enum HmsStateActionTypes {
|
|
|
195
198
|
SET_ACTIVE_SPEAKERS = 'SET_ACTIVE_SPEAKERS',
|
|
196
199
|
SET_RECONNECTING = 'SET_RECONNECTING',
|
|
197
200
|
SET_NOISE_CANCELLATION_PLUGIN = 'SET_NOISE_CANCELLATION_PLUGIN',
|
|
201
|
+
SET_WHITEBOARD = 'SET_WHITEBOARD',
|
|
198
202
|
SET_INITIAL_ROLE = 'SET_INITIAL_ROLE',
|
|
199
203
|
}
|
|
200
204
|
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
HMSSDK,
|
|
15
15
|
HMSSessionStore,
|
|
16
16
|
HMSSpeaker,
|
|
17
|
+
HMSWhiteboard,
|
|
17
18
|
} from '@100mslive/react-native-hms';
|
|
18
19
|
import type { Layout } from '@100mslive/types-prebuilt';
|
|
19
20
|
|
|
@@ -285,6 +286,11 @@ export const setFullScreenPeerTrackNode = (
|
|
|
285
286
|
payload: { fullScreenPeerTrackNode },
|
|
286
287
|
});
|
|
287
288
|
|
|
289
|
+
export const setFullScreenWhiteboard = (fullScreenWhiteboard: boolean) => ({
|
|
290
|
+
type: actionTypes.SET_FULLSCREEN_WHITEBOARD,
|
|
291
|
+
payload: { fullScreenWhiteboard },
|
|
292
|
+
});
|
|
293
|
+
|
|
288
294
|
export const updateFullScreenPeerTrackNode = (
|
|
289
295
|
data: Partial<Omit<PeerTrackNode, 'id'>>
|
|
290
296
|
) => ({
|
|
@@ -439,6 +445,11 @@ export const setNoiseCancellationPlugin = (
|
|
|
439
445
|
noiseCancellationPlugin,
|
|
440
446
|
});
|
|
441
447
|
|
|
448
|
+
export const setWhiteboard = (whiteboard: HMSWhiteboard | null) => ({
|
|
449
|
+
type: HmsStateActionTypes.SET_WHITEBOARD,
|
|
450
|
+
whiteboard,
|
|
451
|
+
});
|
|
452
|
+
|
|
442
453
|
export const setHandleBackButton = (handleBackButton?: boolean) => ({
|
|
443
454
|
type: actionTypes.SET_HANDLE_BACK_BUTTON,
|
|
444
455
|
payload: { handleBackButton },
|
|
@@ -50,6 +50,7 @@ type IntialStateType = {
|
|
|
50
50
|
gridViewActivePage: number;
|
|
51
51
|
startingOrStoppingRecording: boolean;
|
|
52
52
|
fullScreenPeerTrackNode: null | PeerTrackNode;
|
|
53
|
+
fullScreenWhiteboard: boolean;
|
|
53
54
|
screensharePeerTrackNodes: PeerTrackNode[];
|
|
54
55
|
notifications: Notification[];
|
|
55
56
|
activeChatBottomSheetTab: (typeof ChatBottomSheetTabs)[number];
|
|
@@ -90,6 +91,7 @@ const INITIAL_STATE: IntialStateType = {
|
|
|
90
91
|
gridViewActivePage: 0,
|
|
91
92
|
startingOrStoppingRecording: false,
|
|
92
93
|
fullScreenPeerTrackNode: null,
|
|
94
|
+
fullScreenWhiteboard: false,
|
|
93
95
|
screensharePeerTrackNodes: [],
|
|
94
96
|
notifications: [],
|
|
95
97
|
activeChatBottomSheetTab: ChatBottomSheetTabs[0],
|
|
@@ -242,6 +244,12 @@ const appReducer = (
|
|
|
242
244
|
},
|
|
243
245
|
};
|
|
244
246
|
}
|
|
247
|
+
case ActionTypes.SET_FULLSCREEN_WHITEBOARD: {
|
|
248
|
+
return {
|
|
249
|
+
...state,
|
|
250
|
+
fullScreenWhiteboard: action.payload.fullScreenWhiteboard,
|
|
251
|
+
};
|
|
252
|
+
}
|
|
245
253
|
case ActionTypes.SET_STARTING_HLS_STREAM:
|
|
246
254
|
return { ...state, startingHLSStream: action.payload.startingHLSStream };
|
|
247
255
|
case ActionTypes.SET_GRID_VIEW_ACTIVE_PAGE:
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
HMSRoleChangeRequest,
|
|
7
7
|
HMSRoom,
|
|
8
8
|
HMSSpeaker,
|
|
9
|
+
HMSWhiteboard,
|
|
9
10
|
} from '@100mslive/react-native-hms';
|
|
10
11
|
import type { Layout } from '@100mslive/types-prebuilt';
|
|
11
12
|
import { HmsStateActionTypes } from '../actionTypes';
|
|
@@ -31,7 +32,8 @@ type ActionType =
|
|
|
31
32
|
| ReplaceParticipantsList
|
|
32
33
|
| SetActiveSpeakers
|
|
33
34
|
| SetReconnecting
|
|
34
|
-
| SetNoiseCancellationPlugin
|
|
35
|
+
| SetNoiseCancellationPlugin
|
|
36
|
+
| SetWhiteboard;
|
|
35
37
|
|
|
36
38
|
type SetRoomAction = {
|
|
37
39
|
type: HmsStateActionTypes.SET_ROOM_STATE;
|
|
@@ -138,6 +140,11 @@ type SetNoiseCancellationPlugin = {
|
|
|
138
140
|
noiseCancellationPlugin: HMSNoiseCancellationPlugin;
|
|
139
141
|
};
|
|
140
142
|
|
|
143
|
+
type SetWhiteboard = {
|
|
144
|
+
type: HmsStateActionTypes.SET_WHITEBOARD;
|
|
145
|
+
whiteboard: HMSWhiteboard | null;
|
|
146
|
+
};
|
|
147
|
+
|
|
141
148
|
type IntialStateType = {
|
|
142
149
|
isLocalAudioMuted: boolean | undefined;
|
|
143
150
|
isLocalVideoMuted: boolean | undefined;
|
|
@@ -153,6 +160,7 @@ type IntialStateType = {
|
|
|
153
160
|
layoutConfig: Layout[] | null;
|
|
154
161
|
roleChangeRequest: HMSRoleChangeRequest | null;
|
|
155
162
|
noiseCancellationPlugin: HMSNoiseCancellationPlugin | null;
|
|
163
|
+
whiteboard: HMSWhiteboard | null;
|
|
156
164
|
};
|
|
157
165
|
|
|
158
166
|
const INITIAL_STATE: IntialStateType = {
|
|
@@ -170,6 +178,7 @@ const INITIAL_STATE: IntialStateType = {
|
|
|
170
178
|
layoutConfig: null,
|
|
171
179
|
roleChangeRequest: null,
|
|
172
180
|
noiseCancellationPlugin: null,
|
|
181
|
+
whiteboard: null,
|
|
173
182
|
};
|
|
174
183
|
|
|
175
184
|
const hmsStatesReducer = (
|
|
@@ -571,6 +580,11 @@ const hmsStatesReducer = (
|
|
|
571
580
|
...state,
|
|
572
581
|
noiseCancellationPlugin: action.noiseCancellationPlugin,
|
|
573
582
|
};
|
|
583
|
+
case HmsStateActionTypes.SET_WHITEBOARD:
|
|
584
|
+
return {
|
|
585
|
+
...state,
|
|
586
|
+
whiteboard: action.whiteboard,
|
|
587
|
+
};
|
|
574
588
|
case HmsStateActionTypes.CLEAR_STATES:
|
|
575
589
|
return INITIAL_STATE;
|
|
576
590
|
default:
|