@100mslive/react-native-room-kit 0.0.2 → 0.0.3
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 +1 -1
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone.png +0 -0
- package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
- package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
- package/lib/commonjs/Icons/AnswerPhone/index.js +30 -0
- package/lib/commonjs/Icons/AnswerPhone/index.js.map +1 -0
- package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
- package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
- package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
- package/lib/commonjs/Icons/Bluetooth/index.js +30 -0
- package/lib/commonjs/Icons/Bluetooth/index.js.map +1 -0
- package/lib/commonjs/Icons/GenericLogo/assets/generic-logo.png +0 -0
- package/lib/commonjs/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
- package/lib/commonjs/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
- package/lib/commonjs/Icons/GenericLogo/index.js +30 -0
- package/lib/commonjs/Icons/GenericLogo/index.js.map +1 -0
- package/lib/commonjs/Icons/Headphones/assets/headphones.png +0 -0
- package/lib/commonjs/Icons/Headphones/assets/headphones@2x.png +0 -0
- package/lib/commonjs/Icons/Headphones/assets/headphones@3x.png +0 -0
- package/lib/commonjs/Icons/Headphones/index.js +30 -0
- package/lib/commonjs/Icons/Headphones/index.js.map +1 -0
- package/lib/commonjs/Icons/Person/assets/person.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person@2x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person@3x.png +0 -0
- package/lib/commonjs/Icons/Person/index.js +30 -0
- package/lib/commonjs/Icons/Person/index.js.map +1 -0
- package/lib/commonjs/Icons/Speaker/assets/speaker-large.png +0 -0
- package/lib/commonjs/Icons/Speaker/assets/speaker-large@2x.png +0 -0
- package/lib/commonjs/Icons/Speaker/assets/speaker-large@3x.png +0 -0
- package/lib/commonjs/Icons/Speaker/index.js +7 -2
- package/lib/commonjs/Icons/Speaker/index.js.map +1 -1
- package/lib/commonjs/Icons/Wave/assets/wave.png +0 -0
- package/lib/commonjs/Icons/Wave/assets/wave@2x.png +0 -0
- package/lib/commonjs/Icons/Wave/assets/wave@3x.png +0 -0
- package/lib/commonjs/Icons/Wave/index.js +30 -0
- package/lib/commonjs/Icons/Wave/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +66 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/BackButton.js +1 -1
- package/lib/commonjs/components/BackButton.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewEditName.js +1 -1
- package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewJoinButton.js +11 -4
- package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewPeersList.js +9 -32
- package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewSubtitle.js +1 -1
- package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTile.js +11 -61
- package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTitle.js +0 -1
- package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/{HMSPreviewDeviceSettings.js → HMSSpeakerSettings.js} +69 -161
- package/lib/commonjs/components/HMSSpeakerSettings.js.map +1 -0
- package/lib/commonjs/components/Preview.js +72 -21
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/hooks-util.js +17 -60
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +2 -0
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +11 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/hmsStates.js +12 -1
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/utils/theme.js +5 -1
- package/lib/commonjs/utils/theme.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +1 -1
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/AnswerPhone/assets/answer-phone.png +0 -0
- package/lib/module/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
- package/lib/module/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
- package/lib/module/Icons/AnswerPhone/index.js +22 -0
- package/lib/module/Icons/AnswerPhone/index.js.map +1 -0
- package/lib/module/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
- package/lib/module/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
- package/lib/module/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
- package/lib/module/Icons/Bluetooth/index.js +22 -0
- package/lib/module/Icons/Bluetooth/index.js.map +1 -0
- package/lib/module/Icons/GenericLogo/assets/generic-logo.png +0 -0
- package/lib/module/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
- package/lib/module/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
- package/lib/module/Icons/GenericLogo/index.js +22 -0
- package/lib/module/Icons/GenericLogo/index.js.map +1 -0
- package/lib/module/Icons/Headphones/assets/headphones.png +0 -0
- package/lib/module/Icons/Headphones/assets/headphones@2x.png +0 -0
- package/lib/module/Icons/Headphones/assets/headphones@3x.png +0 -0
- package/lib/module/Icons/Headphones/index.js +22 -0
- package/lib/module/Icons/Headphones/index.js.map +1 -0
- package/lib/module/Icons/Person/assets/person.png +0 -0
- package/lib/module/Icons/Person/assets/person@2x.png +0 -0
- package/lib/module/Icons/Person/assets/person@3x.png +0 -0
- package/lib/module/Icons/Person/index.js +22 -0
- package/lib/module/Icons/Person/index.js.map +1 -0
- package/lib/module/Icons/Speaker/assets/speaker-large.png +0 -0
- package/lib/module/Icons/Speaker/assets/speaker-large@2x.png +0 -0
- package/lib/module/Icons/Speaker/assets/speaker-large@3x.png +0 -0
- package/lib/module/Icons/Speaker/index.js +7 -2
- package/lib/module/Icons/Speaker/index.js.map +1 -1
- package/lib/module/Icons/Wave/assets/wave.png +0 -0
- package/lib/module/Icons/Wave/assets/wave@2x.png +0 -0
- package/lib/module/Icons/Wave/assets/wave@3x.png +0 -0
- package/lib/module/Icons/Wave/index.js +22 -0
- package/lib/module/Icons/Wave/index.js.map +1 -0
- package/lib/module/Icons/index.js +6 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/BackButton.js +1 -1
- package/lib/module/components/BackButton.js.map +1 -1
- package/lib/module/components/HMSPreviewEditName.js +1 -1
- package/lib/module/components/HMSPreviewEditName.js.map +1 -1
- package/lib/module/components/HMSPreviewJoinButton.js +11 -4
- package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/module/components/HMSPreviewPeersList.js +9 -32
- package/lib/module/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/module/components/HMSPreviewSubtitle.js +1 -1
- package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/module/components/HMSPreviewTile.js +12 -62
- package/lib/module/components/HMSPreviewTile.js.map +1 -1
- package/lib/module/components/HMSPreviewTitle.js +0 -1
- package/lib/module/components/HMSPreviewTitle.js.map +1 -1
- package/lib/module/components/HMSSpeakerSettings.js +204 -0
- package/lib/module/components/HMSSpeakerSettings.js.map +1 -0
- package/lib/module/components/Preview.js +73 -23
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/hooks-util.js +18 -61
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +2 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +8 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +12 -1
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/utils/theme.js +5 -1
- package/lib/module/utils/theme.js.map +1 -1
- package/lib/typescript/Icons/AnswerPhone/index.d.ts +7 -0
- package/lib/typescript/Icons/AnswerPhone/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Bluetooth/index.d.ts +7 -0
- package/lib/typescript/Icons/Bluetooth/index.d.ts.map +1 -0
- package/lib/typescript/Icons/GenericLogo/index.d.ts +7 -0
- package/lib/typescript/Icons/GenericLogo/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Headphones/index.d.ts +7 -0
- package/lib/typescript/Icons/Headphones/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Person/index.d.ts +7 -0
- package/lib/typescript/Icons/Person/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Speaker/index.d.ts +1 -0
- package/lib/typescript/Icons/Speaker/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Wave/index.d.ts +7 -0
- package/lib/typescript/Icons/Wave/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +6 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewPeersList.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewTile.d.ts.map +1 -1
- package/lib/typescript/components/HMSSpeakerSettings.d.ts +3 -0
- package/lib/typescript/components/HMSSpeakerSettings.d.ts.map +1 -0
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +1 -1
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +3 -1
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +8 -0
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +1 -0
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts +11 -2
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +1 -0
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/utils/theme.d.ts +4 -0
- package/lib/typescript/utils/theme.d.ts.map +1 -1
- package/package.json +4 -3
- package/src/HMSRoomSetup.tsx +1 -1
- package/src/Icons/AnswerPhone/assets/answer-phone.png +0 -0
- package/src/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
- package/src/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
- package/src/Icons/AnswerPhone/index.tsx +27 -0
- package/src/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
- package/src/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
- package/src/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
- package/src/Icons/Bluetooth/index.tsx +27 -0
- package/src/Icons/GenericLogo/assets/generic-logo.png +0 -0
- package/src/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
- package/src/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
- package/src/Icons/GenericLogo/index.tsx +27 -0
- package/src/Icons/Headphones/assets/headphones.png +0 -0
- package/src/Icons/Headphones/assets/headphones@2x.png +0 -0
- package/src/Icons/Headphones/assets/headphones@3x.png +0 -0
- package/src/Icons/Headphones/index.tsx +27 -0
- package/src/Icons/Person/assets/person.png +0 -0
- package/src/Icons/Person/assets/person@2x.png +0 -0
- package/src/Icons/Person/assets/person@3x.png +0 -0
- package/src/Icons/Person/index.tsx +27 -0
- package/src/Icons/Speaker/assets/speaker-large.png +0 -0
- package/src/Icons/Speaker/assets/speaker-large@2x.png +0 -0
- package/src/Icons/Speaker/assets/speaker-large@3x.png +0 -0
- package/src/Icons/Speaker/index.tsx +10 -2
- package/src/Icons/Wave/assets/wave.png +0 -0
- package/src/Icons/Wave/assets/wave@2x.png +0 -0
- package/src/Icons/Wave/assets/wave@3x.png +0 -0
- package/src/Icons/Wave/index.tsx +24 -0
- package/src/Icons/index.ts +6 -0
- package/src/components/BackButton.tsx +1 -1
- package/src/components/HMSPreviewEditName.tsx +1 -1
- package/src/components/HMSPreviewJoinButton.tsx +21 -4
- package/src/components/HMSPreviewPeersList.tsx +19 -40
- package/src/components/HMSPreviewSubtitle.tsx +1 -1
- package/src/components/HMSPreviewTile.tsx +11 -67
- package/src/components/HMSPreviewTitle.tsx +0 -1
- package/src/components/HMSSpeakerSettings.tsx +259 -0
- package/src/components/Preview.tsx +92 -37
- package/src/hooks-util.ts +23 -57
- package/src/redux/actionTypes.ts +2 -0
- package/src/redux/actions/index.ts +10 -0
- package/src/redux/reducers/hmsStates.ts +28 -1
- package/src/utils/theme.ts +5 -1
- package/lib/commonjs/components/HMSPreviewDeviceSettings.js.map +0 -1
- package/lib/module/components/HMSPreviewDeviceSettings.js +0 -296
- package/lib/module/components/HMSPreviewDeviceSettings.js.map +0 -1
- package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts +0 -3
- package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts.map +0 -1
- package/src/components/HMSPreviewDeviceSettings.tsx +0 -387
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import Modal from 'react-native-modal';
|
|
3
|
+
import {
|
|
4
|
+
Platform,
|
|
5
|
+
ScrollView,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
Text,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
View,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import Toast from 'react-native-simple-toast';
|
|
12
|
+
import { useSelector } from 'react-redux';
|
|
13
|
+
import {
|
|
14
|
+
HMSUpdateListenerActions,
|
|
15
|
+
HMSAudioDevice,
|
|
16
|
+
} from '@100mslive/react-native-hms';
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
AnswerPhoneIcon,
|
|
20
|
+
BluetoothIcon,
|
|
21
|
+
HeadphonesIcon,
|
|
22
|
+
SpeakerIcon,
|
|
23
|
+
WaveIcon,
|
|
24
|
+
} from '../Icons';
|
|
25
|
+
import { PressableIcon } from './PressableIcon';
|
|
26
|
+
import { COLORS } from '../utils/theme';
|
|
27
|
+
import { CloseIcon } from '../Icons';
|
|
28
|
+
import { useHMSInstance } from '../hooks-util';
|
|
29
|
+
import type { RootState } from '../redux';
|
|
30
|
+
|
|
31
|
+
export const HMSSpeakerSettings: React.FC = () => {
|
|
32
|
+
const hmsInstance = useHMSInstance();
|
|
33
|
+
const [settingsModalVisible, setSettingsModalVisible] = React.useState(false);
|
|
34
|
+
|
|
35
|
+
const [currentAudioOutputDevice, setCurrentAudioOutputDevice] =
|
|
36
|
+
React.useState<HMSAudioDevice | null>(null);
|
|
37
|
+
const [availableAudioOutputDevices, setAvailableAudioOutputDevices] =
|
|
38
|
+
React.useState<HMSAudioDevice[]>([]);
|
|
39
|
+
|
|
40
|
+
const debugMode = useSelector((state: RootState) => state.user.debugMode);
|
|
41
|
+
|
|
42
|
+
// Fetch current selected audio device and audio devices list on Android
|
|
43
|
+
React.useEffect(() => {
|
|
44
|
+
if (Platform.OS === 'android') {
|
|
45
|
+
let ignore = false;
|
|
46
|
+
|
|
47
|
+
const getCurrentAudioOutputDevice = async () => {
|
|
48
|
+
const device = await hmsInstance.getAudioOutputRouteType();
|
|
49
|
+
if (!ignore) {
|
|
50
|
+
setCurrentAudioOutputDevice(device);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const getAvailableAudioOutputDevices = async () => {
|
|
55
|
+
const devices = await hmsInstance.getAudioDevicesList();
|
|
56
|
+
if (!ignore) {
|
|
57
|
+
setAvailableAudioOutputDevices(devices);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
getCurrentAudioOutputDevice();
|
|
62
|
+
getAvailableAudioOutputDevices();
|
|
63
|
+
|
|
64
|
+
return () => {
|
|
65
|
+
ignore = true;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}, [hmsInstance]);
|
|
69
|
+
|
|
70
|
+
// closes modal and no action will be taken after modal has been closed
|
|
71
|
+
const dismissModal = () => {
|
|
72
|
+
setSettingsModalVisible(false);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// Handles showing Modal for changing Audio device
|
|
76
|
+
const handleSpeakerChange = () => {
|
|
77
|
+
if (Platform.OS === 'ios') {
|
|
78
|
+
hmsInstance.switchAudioOutputUsingIOSUI();
|
|
79
|
+
} else {
|
|
80
|
+
if (availableAudioOutputDevices.length === 0) {
|
|
81
|
+
hmsInstance
|
|
82
|
+
.getAudioDevicesList()
|
|
83
|
+
.then((devices) => setAvailableAudioOutputDevices(devices)); // TODO(set-state-after-unmount): setting state irrespective of component unmount check
|
|
84
|
+
}
|
|
85
|
+
setSettingsModalVisible(true);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// Add audio device change listeners
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
if (Platform.OS === 'android') {
|
|
92
|
+
let ignore = false;
|
|
93
|
+
hmsInstance.setAudioDeviceChangeListener((data: any) => {
|
|
94
|
+
if (!ignore && data) {
|
|
95
|
+
setCurrentAudioOutputDevice(data.device);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (debugMode) {
|
|
99
|
+
Toast.showWithGravity(
|
|
100
|
+
`Audio Device Output changed to: ${data?.device}`,
|
|
101
|
+
Toast.LONG,
|
|
102
|
+
Toast.TOP
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
return () => {
|
|
108
|
+
ignore = true;
|
|
109
|
+
|
|
110
|
+
hmsInstance.removeEventListener(
|
|
111
|
+
HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
}, [hmsInstance, debugMode]);
|
|
116
|
+
|
|
117
|
+
// Handle changing selected audio device
|
|
118
|
+
const handleSelectAudioDevice = (device: HMSAudioDevice) => {
|
|
119
|
+
hmsInstance.switchAudioOutput(device);
|
|
120
|
+
setSettingsModalVisible(false);
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<View>
|
|
125
|
+
<PressableIcon onPress={handleSpeakerChange}>
|
|
126
|
+
{Platform.OS === 'ios' ? (
|
|
127
|
+
<SpeakerIcon muted={false} />
|
|
128
|
+
) : (
|
|
129
|
+
getIcon(currentAudioOutputDevice || HMSAudioDevice.AUTOMATIC)
|
|
130
|
+
)}
|
|
131
|
+
</PressableIcon>
|
|
132
|
+
|
|
133
|
+
<Modal
|
|
134
|
+
isVisible={settingsModalVisible}
|
|
135
|
+
animationIn={'slideInUp'}
|
|
136
|
+
animationOut={'slideOutDown'}
|
|
137
|
+
backdropColor={COLORS.BACKGROUND.DIM}
|
|
138
|
+
backdropOpacity={0.3}
|
|
139
|
+
onBackButtonPress={dismissModal}
|
|
140
|
+
onBackdropPress={dismissModal}
|
|
141
|
+
useNativeDriver={true}
|
|
142
|
+
useNativeDriverForBackdrop={true}
|
|
143
|
+
hideModalContentWhileAnimating={true}
|
|
144
|
+
// swipeDirection={['up', 'down']}
|
|
145
|
+
// swipe
|
|
146
|
+
style={styles.modal}
|
|
147
|
+
>
|
|
148
|
+
<View style={styles.container}>
|
|
149
|
+
<View style={styles.header}>
|
|
150
|
+
<Text style={styles.headerText}>Speaker Settings</Text>
|
|
151
|
+
|
|
152
|
+
<TouchableOpacity
|
|
153
|
+
onPress={dismissModal}
|
|
154
|
+
hitSlop={styles.closeIconHitSlop}
|
|
155
|
+
>
|
|
156
|
+
<CloseIcon />
|
|
157
|
+
</TouchableOpacity>
|
|
158
|
+
</View>
|
|
159
|
+
|
|
160
|
+
{availableAudioOutputDevices.length === 0 ? (
|
|
161
|
+
<View style={styles.emptyView}>
|
|
162
|
+
<Text style={styles.itemText}>No other devices available!</Text>
|
|
163
|
+
</View>
|
|
164
|
+
) : (
|
|
165
|
+
<ScrollView showsVerticalScrollIndicator={true}>
|
|
166
|
+
{availableAudioOutputDevices.sort().map((device) => (
|
|
167
|
+
<React.Fragment key={device}>
|
|
168
|
+
{true ? <View style={styles.divider} /> : null}
|
|
169
|
+
|
|
170
|
+
<TouchableOpacity
|
|
171
|
+
style={styles.audioDeviceItem}
|
|
172
|
+
onPress={() => handleSelectAudioDevice(device)}
|
|
173
|
+
>
|
|
174
|
+
{getIcon(device)}
|
|
175
|
+
<Text style={styles.itemText}>{device}</Text>
|
|
176
|
+
</TouchableOpacity>
|
|
177
|
+
</React.Fragment>
|
|
178
|
+
))}
|
|
179
|
+
</ScrollView>
|
|
180
|
+
)}
|
|
181
|
+
</View>
|
|
182
|
+
</Modal>
|
|
183
|
+
</View>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const styles = StyleSheet.create({
|
|
188
|
+
modal: {
|
|
189
|
+
margin: 0,
|
|
190
|
+
justifyContent: 'flex-end',
|
|
191
|
+
},
|
|
192
|
+
container: {
|
|
193
|
+
backgroundColor: COLORS.SURFACE.DIM,
|
|
194
|
+
borderTopLeftRadius: 16,
|
|
195
|
+
borderTopRightRadius: 16,
|
|
196
|
+
paddingTop: 24,
|
|
197
|
+
paddingHorizontal: 16,
|
|
198
|
+
paddingBottom: 32,
|
|
199
|
+
},
|
|
200
|
+
header: {
|
|
201
|
+
flexDirection: 'row',
|
|
202
|
+
alignItems: 'center',
|
|
203
|
+
justifyContent: 'space-between',
|
|
204
|
+
marginBottom: 16,
|
|
205
|
+
},
|
|
206
|
+
headerText: {
|
|
207
|
+
color: COLORS.SURFACE.ON_SURFACE.HIGH,
|
|
208
|
+
fontSize: 16,
|
|
209
|
+
fontFamily: 'Inter',
|
|
210
|
+
fontWeight: '500',
|
|
211
|
+
lineHeight: 24,
|
|
212
|
+
letterSpacing: 0.15,
|
|
213
|
+
},
|
|
214
|
+
closeIconHitSlop: {
|
|
215
|
+
bottom: 16,
|
|
216
|
+
left: 16,
|
|
217
|
+
right: 16,
|
|
218
|
+
top: 16,
|
|
219
|
+
},
|
|
220
|
+
itemText: {
|
|
221
|
+
flex: 1,
|
|
222
|
+
marginHorizontal: 16,
|
|
223
|
+
color: COLORS.SURFACE.ON_SURFACE.HIGH,
|
|
224
|
+
fontSize: 14,
|
|
225
|
+
fontFamily: 'Inter',
|
|
226
|
+
fontWeight: '600',
|
|
227
|
+
lineHeight: 20,
|
|
228
|
+
letterSpacing: 0.1,
|
|
229
|
+
},
|
|
230
|
+
emptyView: {
|
|
231
|
+
height: 160,
|
|
232
|
+
alignItems: 'center',
|
|
233
|
+
justifyContent: 'center',
|
|
234
|
+
},
|
|
235
|
+
audioDeviceItem: {
|
|
236
|
+
flexDirection: 'row',
|
|
237
|
+
alignItems: 'center',
|
|
238
|
+
paddingVertical: 24,
|
|
239
|
+
},
|
|
240
|
+
divider: {
|
|
241
|
+
height: 1,
|
|
242
|
+
backgroundColor: COLORS.BORDER.DEFAULT,
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
const getIcon = (ofDevice: HMSAudioDevice) => {
|
|
247
|
+
switch (ofDevice) {
|
|
248
|
+
case HMSAudioDevice.AUTOMATIC:
|
|
249
|
+
return <WaveIcon />;
|
|
250
|
+
case HMSAudioDevice.BLUETOOTH:
|
|
251
|
+
return <BluetoothIcon />;
|
|
252
|
+
case HMSAudioDevice.EARPIECE:
|
|
253
|
+
return <AnswerPhoneIcon />;
|
|
254
|
+
case HMSAudioDevice.SPEAKER_PHONE:
|
|
255
|
+
return <SpeakerIcon muted={false} />;
|
|
256
|
+
case HMSAudioDevice.WIRED_HEADSET:
|
|
257
|
+
return <HeadphonesIcon />;
|
|
258
|
+
}
|
|
259
|
+
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import React, { useEffect } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { AvoidSoftInput } from 'react-native-avoid-softinput';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
useSafeAreaInsets,
|
|
8
|
-
} from 'react-native-safe-area-context';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
import { SafeAreaView } from 'react-native-safe-area-context';
|
|
6
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
9
7
|
|
|
10
8
|
import { COLORS } from '../utils/theme';
|
|
11
9
|
|
|
@@ -19,7 +17,9 @@ import { HMSPreviewPeersList } from './HMSPreviewPeersList';
|
|
|
19
17
|
import { HMSPreviewSubtitle } from './HMSPreviewSubtitle';
|
|
20
18
|
import { HMSPreviewTile } from './HMSPreviewTile';
|
|
21
19
|
import { HMSPreviewTitle } from './HMSPreviewTitle';
|
|
22
|
-
import {
|
|
20
|
+
import { HMSSpeakerSettings } from './HMSSpeakerSettings';
|
|
21
|
+
import { GenericLogoIcon, NetworkQualityIcon } from '../Icons';
|
|
22
|
+
import type { RootState } from '../redux';
|
|
23
23
|
|
|
24
24
|
export const Preview = ({
|
|
25
25
|
join,
|
|
@@ -28,7 +28,10 @@ export const Preview = ({
|
|
|
28
28
|
join(): void;
|
|
29
29
|
loadingButtonState: boolean;
|
|
30
30
|
}) => {
|
|
31
|
-
const
|
|
31
|
+
const localPeerNetworkQuality = useSelector(
|
|
32
|
+
(state: RootState) =>
|
|
33
|
+
state.hmsStates.localPeer?.networkQuality?.downlinkQuality
|
|
34
|
+
);
|
|
32
35
|
|
|
33
36
|
useEffect(() => {
|
|
34
37
|
AvoidSoftInput.setAdjustNothing();
|
|
@@ -38,58 +41,111 @@ export const Preview = ({
|
|
|
38
41
|
}, []);
|
|
39
42
|
|
|
40
43
|
return (
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
<View style={styles.container}>
|
|
45
|
+
<HMSPreviewTile />
|
|
46
|
+
|
|
47
|
+
<LinearGradient
|
|
48
|
+
colors={[
|
|
49
|
+
'#000000',
|
|
50
|
+
'rgba(0, 0, 0, 0.9)',
|
|
51
|
+
'rgba(0, 0, 0, 0.7)',
|
|
52
|
+
'rgba(0, 0, 0, 0.1)',
|
|
53
|
+
'rgba(0, 0, 0, 0.05)',
|
|
54
|
+
'rgba(0, 0, 0, 0)',
|
|
55
|
+
]}
|
|
56
|
+
locations={[0.45, 0.55, 0.7, 0.9, 0.95, 1]}
|
|
57
|
+
style={{
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
top: 0,
|
|
60
|
+
width: '100%',
|
|
61
|
+
height: 260,
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
|
|
65
|
+
<SafeAreaView
|
|
66
|
+
style={{ position: 'absolute', top: 0, width: '100%', marginTop: 24 }}
|
|
67
|
+
edges={['top', 'left', 'right']}
|
|
68
|
+
mode="margin"
|
|
45
69
|
>
|
|
46
|
-
<
|
|
70
|
+
<GenericLogoIcon style={{ alignSelf: 'center', marginBottom: 16 }} />
|
|
47
71
|
|
|
48
72
|
<HMSPreviewTitle />
|
|
49
73
|
|
|
50
74
|
<HMSPreviewSubtitle />
|
|
51
75
|
|
|
52
76
|
<HMSPreviewPeersList />
|
|
77
|
+
</SafeAreaView>
|
|
78
|
+
|
|
79
|
+
<SafeAreaView
|
|
80
|
+
style={{ position: 'absolute', top: 0 }}
|
|
81
|
+
edges={['top']}
|
|
82
|
+
mode="margin"
|
|
83
|
+
>
|
|
84
|
+
<BackButton />
|
|
85
|
+
</SafeAreaView>
|
|
86
|
+
|
|
87
|
+
<View
|
|
88
|
+
style={{
|
|
89
|
+
position: 'absolute',
|
|
90
|
+
bottom: 0,
|
|
91
|
+
width: '100%',
|
|
92
|
+
}}
|
|
93
|
+
>
|
|
94
|
+
<View
|
|
95
|
+
style={{
|
|
96
|
+
marginLeft: 8,
|
|
97
|
+
marginBottom: 8,
|
|
98
|
+
borderRadius: 8,
|
|
99
|
+
paddingVertical: 4,
|
|
100
|
+
paddingHorizontal: 8,
|
|
101
|
+
backgroundColor: COLORS.BACKGROUND.DIM_80,
|
|
102
|
+
alignSelf: 'flex-start',
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<NetworkQualityIcon quality={localPeerNetworkQuality} />
|
|
106
|
+
</View>
|
|
53
107
|
|
|
54
|
-
<
|
|
108
|
+
<View
|
|
109
|
+
style={{
|
|
110
|
+
flex: 1,
|
|
111
|
+
backgroundColor: COLORS.BACKGROUND.DEFAULT,
|
|
112
|
+
borderTopLeftRadius: 16,
|
|
113
|
+
borderTopRightRadius: 16,
|
|
114
|
+
padding: 16,
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<View style={styles.controlsContainer}>
|
|
118
|
+
<View style={styles.micAndCameraControls}>
|
|
119
|
+
<HMSManageLocalAudio />
|
|
55
120
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
121
|
+
<View style={styles.manageLocalVideoWrapper}>
|
|
122
|
+
<HMSManageLocalVideo />
|
|
123
|
+
</View>
|
|
59
124
|
|
|
60
|
-
|
|
61
|
-
<HMSManageLocalVideo />
|
|
125
|
+
<HMSManageCameraRotation />
|
|
62
126
|
</View>
|
|
63
127
|
|
|
64
|
-
<
|
|
128
|
+
<HMSSpeakerSettings />
|
|
65
129
|
</View>
|
|
66
130
|
|
|
67
|
-
<
|
|
68
|
-
|
|
131
|
+
<View style={styles.joinButtonRow}>
|
|
132
|
+
<HMSPreviewEditName />
|
|
69
133
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
>
|
|
73
|
-
<HMSPreviewEditName />
|
|
74
|
-
|
|
75
|
-
<HMSPreviewJoinButton onJoin={join} loading={loadingButtonState} />
|
|
134
|
+
<HMSPreviewJoinButton onJoin={join} loading={loadingButtonState} />
|
|
135
|
+
</View>
|
|
76
136
|
</View>
|
|
77
|
-
</
|
|
78
|
-
</
|
|
137
|
+
</View>
|
|
138
|
+
</View>
|
|
79
139
|
);
|
|
80
140
|
};
|
|
81
141
|
|
|
82
142
|
const styles = StyleSheet.create({
|
|
83
143
|
container: {
|
|
84
144
|
flex: 1,
|
|
145
|
+
position: 'relative',
|
|
85
146
|
backgroundColor: COLORS.BACKGROUND.DIM,
|
|
86
147
|
},
|
|
87
|
-
scrollContainer: {
|
|
88
|
-
flexGrow: 1,
|
|
89
|
-
},
|
|
90
148
|
controlsContainer: {
|
|
91
|
-
marginHorizontal: 24,
|
|
92
|
-
marginTop: 24,
|
|
93
149
|
flexDirection: 'row',
|
|
94
150
|
alignItems: 'center',
|
|
95
151
|
justifyContent: 'space-between',
|
|
@@ -101,8 +157,7 @@ const styles = StyleSheet.create({
|
|
|
101
157
|
marginHorizontal: 16,
|
|
102
158
|
},
|
|
103
159
|
joinButtonRow: {
|
|
104
|
-
|
|
105
|
-
marginTop: 16,
|
|
160
|
+
marginVertical: 16,
|
|
106
161
|
flexDirection: 'row',
|
|
107
162
|
},
|
|
108
163
|
});
|
package/src/hooks-util.ts
CHANGED
|
@@ -33,8 +33,10 @@ import type { RootState } from './redux';
|
|
|
33
33
|
import {
|
|
34
34
|
addMessage,
|
|
35
35
|
addPinnedMessage,
|
|
36
|
+
addToPreviewPeersList,
|
|
36
37
|
changePipModeStatus,
|
|
37
38
|
clearStore,
|
|
39
|
+
removeFromPreviewPeersList,
|
|
38
40
|
saveUserData,
|
|
39
41
|
setHMSLocalPeerState,
|
|
40
42
|
setHMSRoleState,
|
|
@@ -71,6 +73,7 @@ import {
|
|
|
71
73
|
import { selectIsHLSViewer } from './hooks-util-selectors';
|
|
72
74
|
|
|
73
75
|
export const useHMSListeners = (
|
|
76
|
+
meetingState: MeetingState,
|
|
74
77
|
setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>,
|
|
75
78
|
setMeetingState: React.Dispatch<React.SetStateAction<MeetingState>>
|
|
76
79
|
) => {
|
|
@@ -79,7 +82,12 @@ export const useHMSListeners = (
|
|
|
79
82
|
|
|
80
83
|
useHMSRoomUpdate(hmsInstance, setMeetingState);
|
|
81
84
|
|
|
82
|
-
useHMSPeersUpdate(
|
|
85
|
+
useHMSPeersUpdate(
|
|
86
|
+
meetingState,
|
|
87
|
+
hmsInstance,
|
|
88
|
+
updateLocalPeer,
|
|
89
|
+
setPeerTrackNodes
|
|
90
|
+
);
|
|
83
91
|
|
|
84
92
|
useHMSTrackUpdate(hmsInstance, updateLocalPeer, setPeerTrackNodes);
|
|
85
93
|
};
|
|
@@ -204,68 +212,26 @@ type PeerUpdate = {
|
|
|
204
212
|
};
|
|
205
213
|
|
|
206
214
|
const useHMSPeersUpdate = (
|
|
215
|
+
meetingState: MeetingState,
|
|
207
216
|
hmsInstance: HMSSDK,
|
|
208
217
|
updateLocalPeer: () => void,
|
|
209
218
|
setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>
|
|
210
219
|
) => {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
// if (type === HMSPeerUpdate.PEER_JOINED) {
|
|
214
|
-
// return;
|
|
215
|
-
// }
|
|
216
|
-
// if (type === HMSPeerUpdate.PEER_LEFT) {
|
|
217
|
-
// setPeerTrackNodes((prevPeerTrackNodes) =>
|
|
218
|
-
// removePeerTrackNodes(prevPeerTrackNodes, peer)
|
|
219
|
-
// );
|
|
220
|
-
// return;
|
|
221
|
-
// }
|
|
222
|
-
// if (peer.isLocal) {
|
|
223
|
-
// setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
224
|
-
// if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
225
|
-
// return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
226
|
-
// }
|
|
227
|
-
// return prevPeerTrackNodes;
|
|
228
|
-
// });
|
|
229
|
-
|
|
230
|
-
// // - TODO: update local localPeer state
|
|
231
|
-
// // - Pass this updated data to Meeting component -> DisplayView component
|
|
232
|
-
// updateLocalPeer();
|
|
233
|
-
// return;
|
|
234
|
-
// }
|
|
235
|
-
// if (type === HMSPeerUpdate.ROLE_CHANGED) {
|
|
236
|
-
// if (
|
|
237
|
-
// peer.role?.publishSettings?.allowed === undefined ||
|
|
238
|
-
// (peer.role?.publishSettings?.allowed &&
|
|
239
|
-
// peer.role?.publishSettings?.allowed.length < 1)
|
|
240
|
-
// ) {
|
|
241
|
-
// setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
242
|
-
// if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
243
|
-
// return removePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
244
|
-
// }
|
|
245
|
-
// return prevPeerTrackNodes;
|
|
246
|
-
// });
|
|
247
|
-
// }
|
|
248
|
-
// return;
|
|
249
|
-
// }
|
|
250
|
-
// if (
|
|
251
|
-
// type === HMSPeerUpdate.METADATA_CHANGED ||
|
|
252
|
-
// type === HMSPeerUpdate.NAME_CHANGED ||
|
|
253
|
-
// type === HMSPeerUpdate.NETWORK_QUALITY_UPDATED
|
|
254
|
-
// ) {
|
|
255
|
-
// setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
256
|
-
// if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
257
|
-
// return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
258
|
-
// }
|
|
259
|
-
// return prevPeerTrackNodes;
|
|
260
|
-
// });
|
|
261
|
-
// return;
|
|
262
|
-
// }
|
|
263
|
-
// },
|
|
264
|
-
// [hmsInstance]
|
|
265
|
-
// );
|
|
220
|
+
const dispatch = useDispatch();
|
|
221
|
+
const inMeeting = meetingState === MeetingState.IN_MEETING;
|
|
266
222
|
|
|
267
223
|
useEffect(() => {
|
|
268
224
|
const peerUpdateHandler = ({ peer, type }: PeerUpdate) => {
|
|
225
|
+
// Handle State from Preview screen
|
|
226
|
+
if (!inMeeting) {
|
|
227
|
+
if (type === HMSPeerUpdate.PEER_JOINED) {
|
|
228
|
+
dispatch(addToPreviewPeersList(peer));
|
|
229
|
+
} else if (type === HMSPeerUpdate.PEER_LEFT) {
|
|
230
|
+
dispatch(removeFromPreviewPeersList(peer));
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// Handle State for Meeting screen
|
|
269
235
|
if (type === HMSPeerUpdate.PEER_JOINED) {
|
|
270
236
|
return;
|
|
271
237
|
}
|
|
@@ -326,7 +292,7 @@ const useHMSPeersUpdate = (
|
|
|
326
292
|
return () => {
|
|
327
293
|
hmsInstance.removeEventListener(HMSUpdateListenerActions.ON_PEER_UPDATE);
|
|
328
294
|
};
|
|
329
|
-
}, [hmsInstance]);
|
|
295
|
+
}, [inMeeting, hmsInstance]); // TODO: When `inMeeting` becomes true Peer Update is resubscribed, we might lose some events during that time
|
|
330
296
|
};
|
|
331
297
|
|
|
332
298
|
type TrackUpdate = {
|
package/src/redux/actionTypes.ts
CHANGED
|
@@ -82,4 +82,6 @@ export enum HmsStateActionTypes {
|
|
|
82
82
|
SET_IS_LOCAL_SCREEN_SHARED_STATE = 'SET_IS_LOCAL_SCREEN_SHARED_STATE',
|
|
83
83
|
SET_ROOM_LOCALLY_MUTED = 'SET_ROOM_LOCALLY_MUTED',
|
|
84
84
|
SET_USER_NAME = 'SET_USER_NAME',
|
|
85
|
+
ADD_TO_PREVIEW_PEERS_LIST = 'ADD_TO_PREVIEW_PEERS_LIST',
|
|
86
|
+
REMOVE_FROM_PREVIEW_PEERS_LIST = 'REMOVE_FROM_PREVIEW_PEERS_LIST',
|
|
85
87
|
}
|
|
@@ -194,3 +194,13 @@ export const setPeerToUpdate = (peerToUpdate: HMSPeer) => ({
|
|
|
194
194
|
type: actionTypes.SET_PEER_TO_UPDATE,
|
|
195
195
|
payload: { peerToUpdate },
|
|
196
196
|
});
|
|
197
|
+
|
|
198
|
+
export const addToPreviewPeersList = (peer: HMSPeer) => ({
|
|
199
|
+
type: HmsStateActionTypes.ADD_TO_PREVIEW_PEERS_LIST,
|
|
200
|
+
peer,
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
export const removeFromPreviewPeersList = (peer: HMSPeer) => ({
|
|
204
|
+
type: HmsStateActionTypes.REMOVE_FROM_PREVIEW_PEERS_LIST,
|
|
205
|
+
peerId: peer.peerID,
|
|
206
|
+
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
HMSLocalPeer,
|
|
3
|
+
HMSPeer,
|
|
3
4
|
HMSRole,
|
|
4
5
|
HMSRoom,
|
|
5
6
|
} from '@100mslive/react-native-hms';
|
|
@@ -13,7 +14,9 @@ type ActionType =
|
|
|
13
14
|
| SetIsLocalVideoMutedAction
|
|
14
15
|
| SetIsLocalScreenSharedAction
|
|
15
16
|
| SetRoomLocallyMutedAction
|
|
16
|
-
| ResetAction
|
|
17
|
+
| ResetAction
|
|
18
|
+
| AddToPreviewPeersList
|
|
19
|
+
| RemoveFromPreviewPeersList;
|
|
17
20
|
|
|
18
21
|
type SetRoomAction = {
|
|
19
22
|
type: HmsStateActionTypes.SET_ROOM_STATE;
|
|
@@ -54,6 +57,16 @@ type SetRoomLocallyMutedAction = {
|
|
|
54
57
|
roomLocallyMuted: boolean;
|
|
55
58
|
};
|
|
56
59
|
|
|
60
|
+
type AddToPreviewPeersList = {
|
|
61
|
+
type: HmsStateActionTypes.ADD_TO_PREVIEW_PEERS_LIST;
|
|
62
|
+
peer: HMSPeer;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type RemoveFromPreviewPeersList = {
|
|
66
|
+
type: HmsStateActionTypes.REMOVE_FROM_PREVIEW_PEERS_LIST;
|
|
67
|
+
peerId: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
57
70
|
type IntialStateType = {
|
|
58
71
|
isLocalAudioMuted: boolean | undefined;
|
|
59
72
|
isLocalVideoMuted: boolean | undefined;
|
|
@@ -62,6 +75,7 @@ type IntialStateType = {
|
|
|
62
75
|
room: HMSRoom | null;
|
|
63
76
|
localPeer: HMSLocalPeer | null;
|
|
64
77
|
roles: HMSRole[];
|
|
78
|
+
previewPeersList: HMSPeer[];
|
|
65
79
|
};
|
|
66
80
|
|
|
67
81
|
const INITIAL_STATE: IntialStateType = {
|
|
@@ -72,6 +86,7 @@ const INITIAL_STATE: IntialStateType = {
|
|
|
72
86
|
room: null,
|
|
73
87
|
localPeer: null,
|
|
74
88
|
roles: [],
|
|
89
|
+
previewPeersList: [],
|
|
75
90
|
};
|
|
76
91
|
|
|
77
92
|
const hmsStatesReducer = (
|
|
@@ -116,6 +131,18 @@ const hmsStatesReducer = (
|
|
|
116
131
|
...state,
|
|
117
132
|
roomLocallyMuted: action.roomLocallyMuted,
|
|
118
133
|
};
|
|
134
|
+
case HmsStateActionTypes.ADD_TO_PREVIEW_PEERS_LIST:
|
|
135
|
+
return {
|
|
136
|
+
...state,
|
|
137
|
+
previewPeersList: [...state.previewPeersList, action.peer],
|
|
138
|
+
};
|
|
139
|
+
case HmsStateActionTypes.REMOVE_FROM_PREVIEW_PEERS_LIST:
|
|
140
|
+
return {
|
|
141
|
+
...state,
|
|
142
|
+
previewPeersList: state.previewPeersList.filter(
|
|
143
|
+
(prevPeer) => prevPeer.peerID !== action.peerId
|
|
144
|
+
),
|
|
145
|
+
};
|
|
119
146
|
case HmsStateActionTypes.CLEAR_STATES:
|
|
120
147
|
return INITIAL_STATE;
|
|
121
148
|
default:
|
package/src/utils/theme.ts
CHANGED
|
@@ -54,7 +54,10 @@ export const COLORS = {
|
|
|
54
54
|
LIGHT: '#66A1FF',
|
|
55
55
|
DEFAULT: '#2572ED',
|
|
56
56
|
DARK: '#143466',
|
|
57
|
-
DISABLED: '#
|
|
57
|
+
DISABLED: '#004299',
|
|
58
|
+
ON_PRIMARY: {
|
|
59
|
+
LOW: '#84AAFF',
|
|
60
|
+
},
|
|
58
61
|
},
|
|
59
62
|
SECONDARY: {
|
|
60
63
|
DIM: '#293042',
|
|
@@ -88,6 +91,7 @@ export const COLORS = {
|
|
|
88
91
|
LIGHTER: '#272E38',
|
|
89
92
|
ON_SURFACE: {
|
|
90
93
|
LOW: '#8F9099',
|
|
94
|
+
MEDIUM: '#C5C6D0',
|
|
91
95
|
HIGH: '#EFF0FA',
|
|
92
96
|
},
|
|
93
97
|
},
|