agora-appbuilder-core 3.0.10 → 3.0.12
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/Readme.md +0 -6
- package/package.json +2 -2
- package/template/_package-lock.json +4979 -7086
- package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +0 -4
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +0 -18
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +0 -2
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +26 -30
- package/template/agora-rn-uikit/src/Controls/Icons.ts +83 -30
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +0 -2
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +0 -1
- package/template/agora-rn-uikit/src/Reducer/index.ts +0 -3
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +1 -89
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +2 -39
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +5 -15
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +9 -15
- package/template/agora-rn-uikit/src/index.ts +1 -3
- package/template/android/app/build.gradle +0 -1
- package/template/android/app/src/main/AndroidManifest.xml +15 -22
- package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -50
- package/template/android/build.gradle +3 -3
- package/template/babel.config.js +0 -1
- package/template/bridge/rtc/webNg/RtcEngine.ts +17 -110
- package/template/customization-api/sub-components.ts +1 -1
- package/template/customization-api/typeDefinition.ts +1 -2
- package/template/electron/index.html +27 -27
- package/template/electron/renderer/index.js +0 -1
- package/template/global.d.ts +4 -26
- package/template/index.js +0 -4
- package/template/index.rsdk.tsx +0 -1
- package/template/index.web.js +1 -7
- package/template/index.wsdk.tsx +1 -1
- package/template/ios/HelloWorld/Info.plist +1 -14
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -17
- package/template/metro.config.js +1 -1
- package/template/package.json +7 -21
- package/template/react-native-toast-message/index.d.ts +43 -43
- package/template/react-native-toast-message/src/colors/index.js +2 -3
- package/template/react-native-toast-message/src/components/base/index.js +59 -46
- package/template/react-native-toast-message/src/components/base/styles.js +32 -16
- package/template/react-native-toast-message/src/components/error.js +2 -3
- package/template/react-native-toast-message/src/components/info.js +2 -3
- package/template/react-native-toast-message/src/components/success.js +2 -3
- package/template/react-native-toast-message/src/index.js +31 -122
- package/template/react-native-toast-message/src/index.sdk.tsx +35 -125
- package/template/react-native-toast-message/src/styles.js +4 -3
- package/template/react-native-toast-message/src/styles.sdk.ts +4 -3
- package/template/src/App.tsx +0 -6
- package/template/src/AppWrapper.tsx +28 -63
- package/template/src/assets/icons.ts +102 -0
- package/template/src/atoms/HorizontalRule.tsx +1 -3
- package/template/src/atoms/PrimaryButton.tsx +26 -51
- package/template/src/atoms/SecondaryButton.tsx +5 -8
- package/template/src/atoms/TextInput.tsx +14 -12
- package/template/src/components/Chat.tsx +214 -86
- package/template/src/components/ChatContext.ts +1 -8
- package/template/src/components/ColorConfigure.tsx +1 -1
- package/template/src/components/ColorContext.ts +1 -1
- package/template/src/components/{Controls1.native.tsx → Controls.native.tsx} +4 -6
- package/template/src/components/Controls.tsx +42 -342
- package/template/src/components/DeviceConfigure.tsx +101 -461
- package/template/src/components/DeviceContext.tsx +4 -8
- package/template/src/components/EventsConfigure.tsx +7 -144
- package/template/src/components/GraphQLProvider.tsx +1 -1
- package/template/src/components/GridVideo.tsx +44 -59
- package/template/src/components/HostControlView.tsx +35 -114
- package/template/src/components/Navbar.tsx +398 -216
- package/template/src/components/NetworkQualityContext.tsx +20 -20
- package/template/src/components/ParticipantsView.tsx +154 -177
- package/template/src/components/PinnedVideo.tsx +120 -207
- package/template/src/components/Precall.native.tsx +119 -358
- package/template/src/components/Precall.tsx +135 -269
- package/template/src/components/RTMConfigure.tsx +4 -27
- package/template/src/components/Router.electron.ts +0 -1
- package/template/src/components/Router.native.ts +0 -1
- package/template/src/components/Router.sdk.ts +0 -1
- package/template/src/components/Router.ts +0 -1
- package/template/src/components/Settings.tsx +95 -26
- package/template/src/components/SettingsView.tsx +56 -251
- package/template/src/components/Share.tsx +273 -302
- package/template/src/components/StorageContext.tsx +3 -30
- package/template/src/components/chat-messages/useChatMessages.tsx +23 -69
- package/template/src/components/chat-ui/useChatUIControl.tsx +0 -7
- package/template/src/components/common/Error.tsx +6 -20
- package/template/src/components/common/Logo.tsx +15 -16
- package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -10
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +7 -37
- package/template/src/components/livestream/LiveStreamContext.tsx +36 -270
- package/template/src/components/livestream/Types.ts +14 -39
- package/template/src/components/livestream/index.ts +0 -1
- package/template/src/components/livestream/views/LiveStreamControls.tsx +4 -12
- package/template/src/components/participants/AllAudienceParticipants.tsx +30 -101
- package/template/src/components/participants/AllHostParticipants.tsx +34 -103
- package/template/src/components/participants/MeParticipant.tsx +38 -0
- package/template/src/components/participants/ParticipantName.tsx +7 -13
- package/template/src/components/participants/ParticipantSectionTitle.tsx +10 -35
- package/template/src/components/participants/RemoteParticipants.tsx +71 -0
- package/template/src/components/participants/ScreenshareParticipants.tsx +12 -144
- package/template/src/components/precall/{LocalMute1.native.tsx → LocalMute.native.tsx} +5 -21
- package/template/src/components/precall/LocalMute.tsx +14 -84
- package/template/src/components/precall/VideoPreview.native.tsx +3 -48
- package/template/src/components/precall/VideoPreview.tsx +7 -163
- package/template/src/components/precall/joinCallBtn.tsx +2 -15
- package/template/src/components/precall/meetingTitle.tsx +12 -15
- package/template/src/components/precall/selectDevice.tsx +21 -1
- package/template/src/components/precall/textInput.tsx +4 -32
- package/template/src/components/precall/usePreCall.tsx +0 -16
- package/template/src/components/styles.ts +21 -42
- package/template/src/components/useShareLink.tsx +14 -12
- package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
- package/template/src/pages/Authenticate.tsx +15 -5
- package/template/src/pages/Create.tsx +165 -293
- package/template/src/pages/Join.tsx +67 -93
- package/template/src/pages/VideoCall.tsx +64 -89
- package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
- package/template/src/pages/video-call/NameWithMicIcon.tsx +44 -120
- package/template/src/pages/video-call/RenderComponent.tsx +2 -3
- package/template/src/pages/video-call/VideoCallScreen.tsx +9 -45
- package/template/src/pages/video-call/VideoComponent.tsx +3 -18
- package/template/src/pages/video-call/VideoRenderer.tsx +60 -218
- package/template/src/rtm-events/constants.ts +0 -2
- package/template/src/subComponents/ChatBubble.tsx +83 -123
- package/template/src/subComponents/ChatContainer.tsx +84 -257
- package/template/src/subComponents/ChatInput.tsx +46 -61
- package/template/src/subComponents/Checkbox.native.tsx +5 -16
- package/template/src/subComponents/Checkbox.tsx +2 -2
- package/template/src/subComponents/CopyJoinInfo.tsx +58 -36
- package/template/src/subComponents/FallbackLogo.tsx +40 -122
- package/template/src/subComponents/LanguageSelector.tsx +1 -1
- package/template/src/subComponents/{LayoutIconDropdown1.native.tsx → LayoutIconDropdown.native.tsx} +18 -4
- package/template/src/subComponents/LayoutIconDropdown.tsx +134 -131
- package/template/src/subComponents/LocalAudioMute.tsx +27 -119
- package/template/src/subComponents/LocalEndCall.tsx +33 -71
- package/template/src/subComponents/LocalSwitchCamera.tsx +30 -17
- package/template/src/subComponents/LocalVideoMute.tsx +27 -117
- package/template/src/subComponents/Logo.tsx +4 -3
- package/template/src/subComponents/LogoutButton.tsx +1 -1
- package/template/src/subComponents/NetworkQualityPill.tsx +63 -60
- package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
- package/template/src/subComponents/Recording.tsx +29 -28
- package/template/src/subComponents/RemoteAudioMute.tsx +29 -83
- package/template/src/subComponents/RemoteEndCall.tsx +5 -8
- package/template/src/subComponents/RemoteVideoMute.tsx +21 -74
- package/template/src/subComponents/ScreenShareNotice.tsx +8 -83
- package/template/src/subComponents/SelectDevice.tsx +61 -404
- package/template/src/subComponents/SelectOAuth.tsx +8 -9
- package/template/src/subComponents/ToastConfig.tsx +10 -150
- package/template/src/subComponents/chat/ChatParticipants.tsx +78 -187
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -95
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -29
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +11 -24
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +10 -17
- package/template/src/subComponents/recording/useRecording.tsx +27 -79
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +70 -52
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +2 -11
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +4 -26
- package/template/src/utils/common.tsx +1 -155
- package/template/src/utils/index.tsx +0 -19
- package/template/src/utils/isMobileOrTablet.ts +2 -7
- package/template/src/utils/useButtonTemplate.tsx +0 -1
- package/template/src/utils/useMuteToggleLocal.ts +3 -54
- package/template/web/index.html +0 -5
- package/template/webpack.commons.js +8 -13
- package/template/webpack.web.config.js +0 -1
- package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +0 -11
- package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +0 -24
- package/template/agora-rn-uikit/src/Reducer/UserPin.ts +0 -11
- package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
- package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
- package/template/android/app/src/main/res/values/colors.xml +0 -7
- package/template/react-native-toast-message/src/components/checkbox.js +0 -178
- package/template/react-native.config.js +0 -7
- package/template/src/assets/font-styles.css +0 -329
- package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
- package/template/src/assets/fonts/icomoon.ttf +0 -0
- package/template/src/assets/permission.png +0 -0
- package/template/src/assets/selection.json +0 -1
- package/template/src/atoms/ActionMenu.tsx +0 -236
- package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +0 -71
- package/template/src/atoms/AnimatedActiveSpeaker.tsx +0 -84
- package/template/src/atoms/AnimatedRings.native.tsx +0 -68
- package/template/src/atoms/AnimatedRings.tsx +0 -70
- package/template/src/atoms/Card.tsx +0 -61
- package/template/src/atoms/CircularProgress.native.tsx +0 -121
- package/template/src/atoms/CircularProgress.tsx +0 -102
- package/template/src/atoms/CustomIcon.tsx +0 -88
- package/template/src/atoms/CustomSwitch.tsx +0 -287
- package/template/src/atoms/Dropdown.tsx +0 -306
- package/template/src/atoms/IconButton.tsx +0 -162
- package/template/src/atoms/ImageIcon.tsx +0 -98
- package/template/src/atoms/InfoBubble.tsx +0 -291
- package/template/src/atoms/Input.tsx +0 -87
- package/template/src/atoms/InviteInfo.tsx +0 -166
- package/template/src/atoms/LinkButton.tsx +0 -28
- package/template/src/atoms/OutlineButton.tsx +0 -61
- package/template/src/atoms/ParticipantsCount.tsx +0 -73
- package/template/src/atoms/Popup.tsx +0 -147
- package/template/src/atoms/RecordingInfo.tsx +0 -49
- package/template/src/atoms/Spacer.tsx +0 -22
- package/template/src/atoms/TertiaryButton.tsx +0 -78
- package/template/src/atoms/Toggle.tsx +0 -47
- package/template/src/atoms/Tooltip.native.tsx +0 -65
- package/template/src/atoms/Tooltip.tsx +0 -94
- package/template/src/atoms/UserAvatar.tsx +0 -60
- package/template/src/components/CommonStyles.ts +0 -44
- package/template/src/components/ToastComponent.tsx +0 -8
- package/template/src/components/participants/Participant.tsx +0 -302
- package/template/src/components/participants/UserActionMenuOptions.tsx +0 -398
- package/template/src/components/popups/InvitePopup.tsx +0 -115
- package/template/src/components/popups/StopRecordingPopup.tsx +0 -114
- package/template/src/components/precall/PermissionHelper.native.tsx +0 -5
- package/template/src/components/precall/PermissionHelper.tsx +0 -126
- package/template/src/components/precall/PreCallSettings.tsx +0 -52
- package/template/src/components/useToast.tsx +0 -41
- package/template/src/components/useVideoCall.tsx +0 -65
- package/template/src/pages/Endcall.tsx +0 -148
- package/template/src/pages/video-call/ActionSheet.native.tsx +0 -215
- package/template/src/pages/video-call/ActionSheet.tsx +0 -226
- package/template/src/pages/video-call/ActionSheetContent.tsx +0 -479
- package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -38
- package/template/src/pages/video-call/ActionSheetStyles.css +0 -138
- package/template/src/pages/video-call/SidePanelHeader.tsx +0 -190
- package/template/src/pages/video-call/VideoCallMobileView.tsx +0 -139
- package/template/src/pages/video-call/VideoCallScreen.native.tsx +0 -37
- package/template/src/subComponents/ChatInput.ios.tsx +0 -237
- package/template/src/subComponents/EndcallPopup.tsx +0 -107
- package/template/src/subComponents/LayoutIconButton.tsx +0 -201
- package/template/src/subComponents/RemoteMutePopup.tsx +0 -193
- package/template/src/subComponents/RemoveMeetingPopup.tsx +0 -109
- package/template/src/subComponents/RemoveScreensharePopup.tsx +0 -109
- package/template/src/subComponents/SelectDeviceSettings.backup.tsx +0 -207
- package/template/src/subComponents/SidePanelHeader.tsx +0 -112
- package/template/src/theme/index.ts +0 -46
- package/template/src/utils/PlatformWrapper.tsx +0 -21
- package/template/src/utils/hexadecimalTransparency.ts +0 -108
- package/template/src/utils/pendingStateUpdateHelper.ts +0 -19
- package/template/src/utils/useFocus.tsx +0 -46
- package/template/src/utils/useIsActiveSpeaker.ts +0 -27
- package/template/src/utils/useIsHandRaised.ts +0 -13
- package/template/src/utils/useRemoteEndScreenshare.ts +0 -26
- package/template/src/utils/useRemoteRequest.ts +0 -84
|
@@ -10,51 +10,46 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React, {useContext} from 'react';
|
|
13
|
+
import {StyleSheet} from 'react-native';
|
|
13
14
|
import LiveStreamContext, {
|
|
14
15
|
RaiseHandValue,
|
|
15
16
|
} from '../../../components/livestream';
|
|
17
|
+
import {PropsContext} from '../../../../agora-rn-uikit';
|
|
18
|
+
import {BtnTemplate} from '../../../../agora-rn-uikit';
|
|
19
|
+
import icons from '../../../assets/icons';
|
|
16
20
|
import {useString} from '../../../utils/useString';
|
|
17
|
-
import Styles from '../../../components/styles';
|
|
18
21
|
import ChatContext from '../../../components/ChatContext';
|
|
19
|
-
import IconButton from '../../../atoms/IconButton';
|
|
20
|
-
import ThemeConfig from '../../../theme';
|
|
21
|
-
import {ClientRole, PropsContext} from '../../../../agora-rn-uikit';
|
|
22
|
-
import {useRender} from 'customization-api';
|
|
23
|
-
import {isMobileUA} from '../../../utils/common';
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
const LocalRaiseHand = (props: LocalRaiseHandProps) => {
|
|
23
|
+
const LocalRaiseHand = () => {
|
|
24
|
+
const {styleProps} = useContext(PropsContext);
|
|
29
25
|
const {audienceSendsRequest, audienceRecallsRequest, raiseHandList} =
|
|
30
26
|
useContext(LiveStreamContext);
|
|
31
|
-
const {rtcProps} = useContext(PropsContext);
|
|
32
27
|
const {localUid} = useContext(ChatContext);
|
|
33
|
-
const {
|
|
34
|
-
const {
|
|
28
|
+
const {localBtnStyles} = styleProps || {};
|
|
29
|
+
const {theme} = styleProps || {};
|
|
30
|
+
const {muteLocalAudio} = localBtnStyles || {};
|
|
35
31
|
//commented for v1 release
|
|
36
32
|
//const handStatusText = useString<boolean>('raiseHandButton');
|
|
37
33
|
const handStatusText = (toggle: boolean) =>
|
|
38
34
|
toggle ? 'Lower hand' : 'Raise Hand';
|
|
39
|
-
const isHandRasied = raiseHandList[localUid]?.raised === RaiseHandValue.TRUE;
|
|
40
35
|
return (
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
?
|
|
49
|
-
:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
36
|
+
<BtnTemplate
|
|
37
|
+
icon={icons['raiseHandIcon']}
|
|
38
|
+
btnText={handStatusText(
|
|
39
|
+
raiseHandList[localUid]?.raised === RaiseHandValue.TRUE,
|
|
40
|
+
)}
|
|
41
|
+
color={
|
|
42
|
+
raiseHandList[localUid]?.raised === RaiseHandValue.TRUE
|
|
43
|
+
? '#FD0845'
|
|
44
|
+
: theme
|
|
45
|
+
}
|
|
46
|
+
style={{
|
|
47
|
+
...style.localBtn,
|
|
48
|
+
...(localBtnStyles as object),
|
|
49
|
+
...(muteLocalAudio as object),
|
|
55
50
|
}}
|
|
56
51
|
onPress={() => {
|
|
57
|
-
if (
|
|
52
|
+
if (raiseHandList[localUid]?.raised === RaiseHandValue.TRUE) {
|
|
58
53
|
audienceRecallsRequest();
|
|
59
54
|
} else {
|
|
60
55
|
audienceSendsRequest();
|
|
@@ -64,4 +59,13 @@ const LocalRaiseHand = (props: LocalRaiseHandProps) => {
|
|
|
64
59
|
);
|
|
65
60
|
};
|
|
66
61
|
|
|
62
|
+
const style = StyleSheet.create({
|
|
63
|
+
localBtn: {
|
|
64
|
+
borderRadius: 23,
|
|
65
|
+
borderWidth: 4 * StyleSheet.hairlineWidth,
|
|
66
|
+
borderColor: '#007aff',
|
|
67
|
+
backgroundColor: '#007aff',
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
|
|
67
71
|
export default LocalRaiseHand;
|
package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import {UidType} from '../../../../agora-rn-uikit';
|
|
2
|
+
import {BtnTemplate, UidType} from '../../../../agora-rn-uikit';
|
|
4
3
|
import {LiveStreamControlMessageEnum} from '../../../components/livestream';
|
|
4
|
+
import icons from '../../../assets/icons';
|
|
5
5
|
import events, {EventPersistLevel} from '../../../rtm-events-api';
|
|
6
6
|
|
|
7
7
|
export interface RemoteLiveStreamApprovedRequestRecallProps {
|
|
@@ -11,7 +11,8 @@ const RemoteLiveStreamApprovedRequestRecall = (
|
|
|
11
11
|
props: RemoteLiveStreamApprovedRequestRecallProps,
|
|
12
12
|
) => {
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
14
|
+
<BtnTemplate
|
|
15
|
+
style={{width: 24, height: 22}}
|
|
15
16
|
onPress={() => {
|
|
16
17
|
events.send(
|
|
17
18
|
LiveStreamControlMessageEnum.raiseHandRequestRejected,
|
|
@@ -20,9 +21,8 @@ const RemoteLiveStreamApprovedRequestRecall = (
|
|
|
20
21
|
props.uid,
|
|
21
22
|
);
|
|
22
23
|
}}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
//icon={Icons['demoteIcon']}
|
|
24
|
+
color="#FD0845"
|
|
25
|
+
icon={icons['demoteIcon']}
|
|
26
26
|
/>
|
|
27
27
|
);
|
|
28
28
|
};
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
import React, {useContext} from 'react';
|
|
2
2
|
import {View} from 'react-native';
|
|
3
|
-
import {PropsContext, UidType} from '../../../../agora-rn-uikit';
|
|
3
|
+
import {BtnTemplate, PropsContext, UidType} from '../../../../agora-rn-uikit';
|
|
4
4
|
import LiveStreamContext from '../../../components/livestream';
|
|
5
|
-
import
|
|
6
|
-
import ThemeConfig from '../../../theme';
|
|
7
|
-
import Toast from '../../../../react-native-toast-message';
|
|
5
|
+
import icons from '../../../assets/icons';
|
|
8
6
|
|
|
9
7
|
export interface RemoteLiveStreamControlProps {
|
|
10
8
|
uid: UidType;
|
|
11
|
-
toastId: number;
|
|
12
9
|
}
|
|
13
10
|
|
|
14
11
|
const RemoteLiveStreamRequestApprove = (
|
|
15
12
|
props: RemoteLiveStreamControlProps,
|
|
16
13
|
) => {
|
|
17
|
-
const {uid
|
|
14
|
+
const {uid} = props;
|
|
18
15
|
const {hostApprovesRequestOfUID} = useContext(LiveStreamContext);
|
|
16
|
+
const {styleProps} = useContext(PropsContext);
|
|
17
|
+
const {remoteBtnStyles} = styleProps || {};
|
|
18
|
+
|
|
19
|
+
const {liveStreamHostControlBtns} = remoteBtnStyles || {};
|
|
19
20
|
|
|
20
21
|
return (
|
|
21
|
-
<View style={{
|
|
22
|
-
<
|
|
23
|
-
containerStyle={{
|
|
24
|
-
minWidth: 'auto',
|
|
25
|
-
borderRadius: ThemeConfig.BorderRadius.small,
|
|
26
|
-
height: 38,
|
|
27
|
-
paddingHorizontal: 8,
|
|
28
|
-
paddingVertical: 8,
|
|
29
|
-
}}
|
|
30
|
-
textStyle={{
|
|
31
|
-
fontWeight: '600',
|
|
32
|
-
fontSize: 12,
|
|
33
|
-
}}
|
|
22
|
+
<View style={{...(liveStreamHostControlBtns as object), marginRight: 15}}>
|
|
23
|
+
<BtnTemplate
|
|
34
24
|
disabled={!uid}
|
|
35
|
-
|
|
25
|
+
icon={icons['checkCircleIcon']}
|
|
26
|
+
style={{...(liveStreamHostControlBtns as object)}}
|
|
36
27
|
onPress={() => {
|
|
37
|
-
//Hiding the toast if its get approved in the participant panel
|
|
38
|
-
if (Toast.getToastId() === toastId) {
|
|
39
|
-
Toast.hide();
|
|
40
|
-
}
|
|
41
28
|
hostApprovesRequestOfUID(uid);
|
|
42
29
|
}}
|
|
43
30
|
/>
|
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
import React, {useContext} from 'react';
|
|
2
2
|
import {View} from 'react-native';
|
|
3
|
-
import {PropsContext, UidType} from '../../../../agora-rn-uikit';
|
|
3
|
+
import {BtnTemplate, PropsContext, UidType} from '../../../../agora-rn-uikit';
|
|
4
4
|
import LiveStreamContext from '../../../components/livestream';
|
|
5
|
-
import
|
|
6
|
-
import Toast from '../../../../react-native-toast-message';
|
|
5
|
+
import icons from '../../../assets/icons';
|
|
7
6
|
|
|
8
7
|
interface RemoteLiveStreamControlProps {
|
|
9
8
|
uid: UidType;
|
|
10
|
-
toastId: number;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
const RemoteLiveStreamRequestReject = (props: RemoteLiveStreamControlProps) => {
|
|
14
|
-
const {uid
|
|
12
|
+
const {uid} = props;
|
|
15
13
|
const {hostRejectsRequestOfUID} = useContext(LiveStreamContext);
|
|
14
|
+
const {styleProps} = useContext(PropsContext);
|
|
15
|
+
const {remoteBtnStyles} = styleProps || {};
|
|
16
|
+
const {liveStreamHostControlBtns} = remoteBtnStyles || {};
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
|
-
<View style={{
|
|
19
|
-
<
|
|
20
|
-
containerStyle={{
|
|
21
|
-
paddingHorizontal: 8,
|
|
22
|
-
paddingVertical: 8,
|
|
23
|
-
height: 38,
|
|
24
|
-
}}
|
|
19
|
+
<View style={{...(liveStreamHostControlBtns as object)}}>
|
|
20
|
+
<BtnTemplate
|
|
25
21
|
disabled={!uid}
|
|
22
|
+
icon={icons['crossCircleIcon']}
|
|
23
|
+
style={{...(liveStreamHostControlBtns as object)}}
|
|
26
24
|
onPress={() => {
|
|
27
|
-
//Hiding the toast if its get rejected in the participant panel
|
|
28
|
-
if (Toast.getToastId() === toastId) {
|
|
29
|
-
Toast.hide();
|
|
30
|
-
}
|
|
31
25
|
hostRejectsRequestOfUID(uid);
|
|
32
26
|
}}
|
|
33
|
-
text={'DENY'}
|
|
34
27
|
/>
|
|
35
28
|
</View>
|
|
36
29
|
);
|
|
@@ -15,7 +15,6 @@ import React, {
|
|
|
15
15
|
useContext,
|
|
16
16
|
useEffect,
|
|
17
17
|
useRef,
|
|
18
|
-
useState,
|
|
19
18
|
} from 'react';
|
|
20
19
|
import {gql, useMutation} from '@apollo/client';
|
|
21
20
|
import {useParams} from '../../components/Router';
|
|
@@ -28,21 +27,17 @@ import events, {EventPersistLevel} from '../../rtm-events-api';
|
|
|
28
27
|
import {EventActions, EventNames} from '../../rtm-events';
|
|
29
28
|
import useRecordingLayoutQuery from './useRecordingLayoutQuery';
|
|
30
29
|
import {useScreenContext} from '../../components/contexts/ScreenShareContext';
|
|
31
|
-
import {useRender} from 'customization-api';
|
|
32
|
-
import {trimText} from '../../utils/common';
|
|
33
30
|
|
|
34
31
|
export interface RecordingContextInterface {
|
|
35
32
|
startRecording: () => void;
|
|
36
33
|
stopRecording: () => void;
|
|
37
34
|
isRecordingActive: boolean;
|
|
38
|
-
inProgress: boolean;
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
const RecordingContext = createContext<RecordingContextInterface>({
|
|
42
38
|
startRecording: () => {},
|
|
43
39
|
stopRecording: () => {},
|
|
44
40
|
isRecordingActive: false,
|
|
45
|
-
inProgress: false,
|
|
46
41
|
});
|
|
47
42
|
|
|
48
43
|
const START_RECORDING = gql`
|
|
@@ -87,9 +82,6 @@ interface RecordingProviderProps {
|
|
|
87
82
|
const RecordingProvider = (props: RecordingProviderProps) => {
|
|
88
83
|
const {rtcProps} = useContext(PropsContext);
|
|
89
84
|
const {setRecordingActive, isRecordingActive} = props?.value;
|
|
90
|
-
const [inProgress, setInProgress] = useState(false);
|
|
91
|
-
const [uidWhoStarted, setUidWhoStarted] = useState(0);
|
|
92
|
-
const {renderList, activeUids} = useRender();
|
|
93
85
|
const {phrase} = useParams<{phrase: string}>();
|
|
94
86
|
const [startRecordingQuery] = useMutation(START_RECORDING);
|
|
95
87
|
const [stopRecordingQuery] = useMutation(STOP_RECORDING);
|
|
@@ -109,17 +101,14 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
109
101
|
const payload = JSON.parse(data.payload);
|
|
110
102
|
const action = payload.action;
|
|
111
103
|
const value = payload.value;
|
|
104
|
+
|
|
112
105
|
switch (action) {
|
|
113
106
|
case EventActions.RECORDING_STARTED:
|
|
114
|
-
setUidWhoStarted(parseInt(value));
|
|
115
107
|
setRecordingActive(true);
|
|
116
108
|
break;
|
|
117
109
|
case EventActions.RECORDING_STOPPED:
|
|
118
110
|
setRecordingActive(false);
|
|
119
111
|
break;
|
|
120
|
-
case EventActions.RECORDING_STOP_REQUEST:
|
|
121
|
-
stopRecording();
|
|
122
|
-
break;
|
|
123
112
|
default:
|
|
124
113
|
break;
|
|
125
114
|
}
|
|
@@ -139,22 +128,14 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
139
128
|
if (prevRecordingState) {
|
|
140
129
|
if (prevRecordingState?.isRecordingActive === isRecordingActive) return;
|
|
141
130
|
Toast.show({
|
|
142
|
-
type: '
|
|
131
|
+
type: 'success',
|
|
143
132
|
text1: recordingStartedText(isRecordingActive),
|
|
144
|
-
|
|
145
|
-
? `This meeting is being recorded by ${
|
|
146
|
-
trimText(renderList[uidWhoStarted]?.name) || 'user'
|
|
147
|
-
}`
|
|
148
|
-
: '',
|
|
149
|
-
visibilityTime: 3000,
|
|
150
|
-
primaryBtn: null,
|
|
151
|
-
secondaryBtn: null,
|
|
133
|
+
visibilityTime: 1000,
|
|
152
134
|
});
|
|
153
135
|
}
|
|
154
136
|
}, [isRecordingActive]);
|
|
155
137
|
|
|
156
138
|
const startRecording = () => {
|
|
157
|
-
setInProgress(true);
|
|
158
139
|
// If recording is not going on, start the recording by executing the graphql query
|
|
159
140
|
startRecordingQuery({
|
|
160
141
|
variables: {
|
|
@@ -167,7 +148,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
167
148
|
})
|
|
168
149
|
.then((res) => {
|
|
169
150
|
console.log(res.data);
|
|
170
|
-
setInProgress(false);
|
|
171
151
|
if (res.data.startRecordingSession === 'success') {
|
|
172
152
|
/**
|
|
173
153
|
* 1. Once the backend sucessfuly starts recording, send message
|
|
@@ -182,7 +162,6 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
182
162
|
EventPersistLevel.LEVEL3,
|
|
183
163
|
);
|
|
184
164
|
// 2. set the local recording state to true to update the UI
|
|
185
|
-
setUidWhoStarted(localUid);
|
|
186
165
|
setRecordingActive(true);
|
|
187
166
|
// 3. set the presenter mode if screen share is active
|
|
188
167
|
// 3.a Get the most recent screenshare uid
|
|
@@ -203,71 +182,40 @@ const RecordingProvider = (props: RecordingProviderProps) => {
|
|
|
203
182
|
}
|
|
204
183
|
})
|
|
205
184
|
.catch((err) => {
|
|
206
|
-
setInProgress(false);
|
|
207
185
|
console.log(err);
|
|
208
186
|
});
|
|
209
187
|
};
|
|
210
188
|
|
|
211
189
|
const stopRecording = () => {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
* 1. Once the backend sucessfuly starts recording, send message
|
|
237
|
-
* in the channel indicating that cloud recording is now inactive.
|
|
238
|
-
*/
|
|
239
|
-
events.send(
|
|
240
|
-
EventNames.RECORDING_ATTRIBUTE,
|
|
241
|
-
JSON.stringify({
|
|
242
|
-
action: EventActions.RECORDING_STOPPED,
|
|
243
|
-
value: '',
|
|
244
|
-
}),
|
|
245
|
-
EventPersistLevel.LEVEL3,
|
|
246
|
-
);
|
|
247
|
-
// 2. set the local recording state to false to update the UI
|
|
248
|
-
setRecordingActive(false);
|
|
249
|
-
}
|
|
250
|
-
})
|
|
251
|
-
.catch((err) => {
|
|
252
|
-
setInProgress(false);
|
|
253
|
-
console.log(err);
|
|
254
|
-
});
|
|
255
|
-
} else {
|
|
256
|
-
events.send(
|
|
257
|
-
EventNames.RECORDING_ATTRIBUTE,
|
|
258
|
-
JSON.stringify({
|
|
259
|
-
action: EventActions.RECORDING_STOP_REQUEST,
|
|
260
|
-
value: '',
|
|
261
|
-
}),
|
|
262
|
-
EventPersistLevel.LEVEL1,
|
|
263
|
-
);
|
|
264
|
-
}
|
|
190
|
+
// If recording is already going on, stop the recording by executing the graphql query.
|
|
191
|
+
stopRecordingQuery({variables: {passphrase: phrase}})
|
|
192
|
+
.then((res) => {
|
|
193
|
+
console.log(res.data);
|
|
194
|
+
if (res.data.stopRecordingSession === 'success') {
|
|
195
|
+
/**
|
|
196
|
+
* 1. Once the backend sucessfuly starts recording, send message
|
|
197
|
+
* in the channel indicating that cloud recording is now inactive.
|
|
198
|
+
*/
|
|
199
|
+
events.send(
|
|
200
|
+
EventNames.RECORDING_ATTRIBUTE,
|
|
201
|
+
JSON.stringify({
|
|
202
|
+
action: EventActions.RECORDING_STOPPED,
|
|
203
|
+
value: '',
|
|
204
|
+
}),
|
|
205
|
+
EventPersistLevel.LEVEL3,
|
|
206
|
+
);
|
|
207
|
+
// 2. set the local recording state to false to update the UI
|
|
208
|
+
setRecordingActive(false);
|
|
209
|
+
}
|
|
210
|
+
})
|
|
211
|
+
.catch((err) => {
|
|
212
|
+
console.log(err);
|
|
213
|
+
});
|
|
265
214
|
};
|
|
266
215
|
|
|
267
216
|
return (
|
|
268
217
|
<RecordingContext.Provider
|
|
269
218
|
value={{
|
|
270
|
-
inProgress,
|
|
271
219
|
startRecording,
|
|
272
220
|
stopRecording,
|
|
273
221
|
isRecordingActive,
|
|
@@ -9,16 +9,15 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import Styles from '../../components/styles';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import {StyleSheet} from 'react-native';
|
|
14
|
+
import {BtnTemplate, BtnTemplateInterface} from '../../../agora-rn-uikit';
|
|
16
15
|
import {useString} from '../../utils/useString';
|
|
17
16
|
import {useScreenshare} from './useScreenshare';
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
import {
|
|
18
|
+
ButtonTemplateName,
|
|
19
|
+
useButtonTemplate,
|
|
20
|
+
} from '../../utils/useButtonTemplate';
|
|
22
21
|
/**
|
|
23
22
|
* A component to start and stop screen sharing on web clients.
|
|
24
23
|
* Screen sharing is not yet implemented on mobile platforms.
|
|
@@ -26,67 +25,86 @@ import useIsHandRaised from '../../utils/useIsHandRaised';
|
|
|
26
25
|
*/
|
|
27
26
|
|
|
28
27
|
export interface ScreenshareButtonProps {
|
|
29
|
-
|
|
28
|
+
buttonTemplateName?: ButtonTemplateName;
|
|
29
|
+
render?: (
|
|
30
|
+
onPress: () => void,
|
|
31
|
+
isScreenshareActive: boolean,
|
|
32
|
+
buttonTemplateName?: ButtonTemplateName,
|
|
33
|
+
) => JSX.Element;
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
const ScreenshareButton = (props: ScreenshareButtonProps) => {
|
|
33
|
-
const {rtcProps} = useContext(PropsContext);
|
|
34
|
-
const {
|
|
35
|
-
data: {isHost},
|
|
36
|
-
} = useMeetingInfo();
|
|
37
|
-
const local = useLocalUserInfo();
|
|
38
|
-
const isHandRaised = useIsHandRaised();
|
|
39
37
|
const {isScreenshareActive, startUserScreenshare, stopUserScreenShare} =
|
|
40
38
|
useScreenshare();
|
|
41
39
|
//commented for v1 release
|
|
42
40
|
//const screenShareButton = useString('screenShareButton')();
|
|
43
|
-
|
|
41
|
+
const screenShareButton = 'Share';
|
|
42
|
+
const defaultTemplateValue = useButtonTemplate().buttonTemplateName;
|
|
43
|
+
const {buttonTemplateName = defaultTemplateValue} = props;
|
|
44
44
|
const onPress = () =>
|
|
45
45
|
isScreenshareActive ? stopUserScreenShare() : startUserScreenshare();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
iconProps: {
|
|
49
|
-
name: isScreenshareActive ? 'stop-screen-share' : 'screen-share',
|
|
50
|
-
tintColor: isScreenshareActive
|
|
51
|
-
? $config.SEMANTIC_ERROR
|
|
52
|
-
: $config.SECONDARY_ACTION_COLOR,
|
|
53
|
-
},
|
|
46
|
+
let btnTemplateProps: BtnTemplateInterface = {
|
|
47
|
+
name: isScreenshareActive ? 'screenshareOffIcon' : 'screenshareIcon',
|
|
54
48
|
onPress,
|
|
55
|
-
btnTextProps: {
|
|
56
|
-
text: $config.ICON_TEXT ? screenShareButton : '',
|
|
57
|
-
textColor: $config.FONT_COLOR,
|
|
58
|
-
},
|
|
59
49
|
};
|
|
60
50
|
|
|
61
|
-
if (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
rtcProps.role == ClientRole.Audience &&
|
|
71
|
-
$config.EVENT_MODE &&
|
|
72
|
-
$config.RAISE_HAND &&
|
|
73
|
-
!isHost
|
|
74
|
-
) {
|
|
75
|
-
iconButtonProps.iconProps = {
|
|
76
|
-
...iconButtonProps.iconProps,
|
|
77
|
-
tintColor: $config.SEMANTIC_NEUTRAL,
|
|
78
|
-
};
|
|
79
|
-
iconButtonProps.toolTipMessage = isHandRaised(local.uid)
|
|
80
|
-
? 'Waiting for host to appove the request'
|
|
81
|
-
: 'Raise Hand in order to present';
|
|
82
|
-
iconButtonProps.disabled = true;
|
|
51
|
+
if (buttonTemplateName === ButtonTemplateName.topBar) {
|
|
52
|
+
btnTemplateProps.style = isScreenshareActive
|
|
53
|
+
? (style.activeBtn as Object)
|
|
54
|
+
: (style.nonActiveBtn as Object);
|
|
55
|
+
} else {
|
|
56
|
+
btnTemplateProps.btnText = screenShareButton;
|
|
57
|
+
btnTemplateProps.style = isScreenshareActive
|
|
58
|
+
? style.greenLocalButton
|
|
59
|
+
: style.localButton;
|
|
83
60
|
}
|
|
84
61
|
|
|
85
62
|
return props?.render ? (
|
|
86
|
-
props.render(onPress, isScreenshareActive)
|
|
63
|
+
props.render(onPress, isScreenshareActive, buttonTemplateName)
|
|
87
64
|
) : (
|
|
88
|
-
<
|
|
65
|
+
<BtnTemplate {...btnTemplateProps} />
|
|
89
66
|
);
|
|
90
67
|
};
|
|
91
68
|
|
|
69
|
+
const style = StyleSheet.create({
|
|
70
|
+
localButton: {
|
|
71
|
+
backgroundColor: $config.SECONDARY_FONT_COLOR,
|
|
72
|
+
borderRadius: 20,
|
|
73
|
+
borderColor: $config.PRIMARY_COLOR,
|
|
74
|
+
width: 40,
|
|
75
|
+
height: 40,
|
|
76
|
+
display: 'flex',
|
|
77
|
+
alignSelf: 'center',
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
justifyContent: 'center',
|
|
80
|
+
},
|
|
81
|
+
activeBtn: {
|
|
82
|
+
backgroundColor: '#4BEB5B',
|
|
83
|
+
borderRadius: 20,
|
|
84
|
+
borderColor: '#F86051',
|
|
85
|
+
width: '100%',
|
|
86
|
+
height: '100%',
|
|
87
|
+
resizeMode: 'contain',
|
|
88
|
+
},
|
|
89
|
+
nonActiveBtn: {
|
|
90
|
+
width: '100%',
|
|
91
|
+
height: '100%',
|
|
92
|
+
resizeMode: 'contain',
|
|
93
|
+
},
|
|
94
|
+
greenLocalButton: {
|
|
95
|
+
backgroundColor: '#4BEB5B',
|
|
96
|
+
borderRadius: 20,
|
|
97
|
+
borderColor: '#F86051',
|
|
98
|
+
width: 40,
|
|
99
|
+
height: 40,
|
|
100
|
+
alignSelf: 'center',
|
|
101
|
+
alignItems: 'center',
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
},
|
|
104
|
+
buttonIcon: {
|
|
105
|
+
width: '90%',
|
|
106
|
+
height: '90%',
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
92
110
|
export default ScreenshareButton;
|
|
@@ -27,7 +27,7 @@ import {filterObject} from '../../utils';
|
|
|
27
27
|
|
|
28
28
|
export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
29
29
|
const {dispatch} = useRtc();
|
|
30
|
-
const {renderList, activeUids, lastJoinedUid
|
|
30
|
+
const {renderList, activeUids, lastJoinedUid} = useRender();
|
|
31
31
|
const isPinned = useRef(0);
|
|
32
32
|
const {setScreenShareData, screenShareData} = useScreenContext();
|
|
33
33
|
// commented for v1 release
|
|
@@ -41,12 +41,6 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
41
41
|
const renderListRef = useRef({renderList: renderList});
|
|
42
42
|
const currentLayoutRef = useRef({currentLayout: currentLayout});
|
|
43
43
|
|
|
44
|
-
const pinnedUidRef = useRef({pinnedUid: pinnedUid});
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
pinnedUidRef.current.pinnedUid = pinnedUid;
|
|
48
|
-
}, [pinnedUid]);
|
|
49
|
-
|
|
50
44
|
useEffect(() => {
|
|
51
45
|
renderListRef.current.renderList = renderList;
|
|
52
46
|
}, [renderList]);
|
|
@@ -125,10 +119,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
125
119
|
};
|
|
126
120
|
});
|
|
127
121
|
//if remote user started/stopped the screenshare then change the layout to pinned/grid
|
|
128
|
-
|
|
129
|
-
if (!pinnedUidRef.current.pinnedUid) {
|
|
130
|
-
triggerChangeLayout(false);
|
|
131
|
-
}
|
|
122
|
+
triggerChangeLayout(false);
|
|
132
123
|
break;
|
|
133
124
|
default:
|
|
134
125
|
break;
|
|
@@ -26,12 +26,7 @@ import {IAgoraRTC} from 'agora-rtc-sdk-ng';
|
|
|
26
26
|
import useRecordingLayoutQuery from '../recording/useRecordingLayoutQuery';
|
|
27
27
|
import {useString} from '../../utils/useString';
|
|
28
28
|
import {timeNow} from '../../rtm/utils';
|
|
29
|
-
import {
|
|
30
|
-
controlMessageEnum,
|
|
31
|
-
useLayout,
|
|
32
|
-
useRender,
|
|
33
|
-
useRtc,
|
|
34
|
-
} from 'customization-api';
|
|
29
|
+
import {useLayout, useRender, useRtc} from 'customization-api';
|
|
35
30
|
import {filterObject} from '../../utils';
|
|
36
31
|
|
|
37
32
|
export const ScreenshareContextConsumer = ScreenshareContext.Consumer;
|
|
@@ -40,7 +35,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
40
35
|
const [isScreenshareActive, setScreenshareActive] = useState(false);
|
|
41
36
|
const rtc = useRtc();
|
|
42
37
|
const {dispatch} = rtc;
|
|
43
|
-
const {renderList, activeUids, lastJoinedUid
|
|
38
|
+
const {renderList, activeUids, lastJoinedUid} = useRender();
|
|
44
39
|
const isPinned = useRef(0);
|
|
45
40
|
const {isRecordingActive} = useRecording();
|
|
46
41
|
const {executeNormalQuery, executePresenterQuery} = useRecordingLayoutQuery();
|
|
@@ -59,11 +54,6 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
59
54
|
useContext(PropsContext).rtcProps;
|
|
60
55
|
|
|
61
56
|
const renderListRef = useRef({renderList: renderList});
|
|
62
|
-
const pinnedUidRef = useRef({pinnedUid: pinnedUid});
|
|
63
|
-
|
|
64
|
-
useEffect(() => {
|
|
65
|
-
pinnedUidRef.current.pinnedUid = pinnedUid;
|
|
66
|
-
}, [pinnedUid]);
|
|
67
57
|
|
|
68
58
|
useEffect(() => {
|
|
69
59
|
renderListRef.current.renderList = renderList;
|
|
@@ -119,12 +109,6 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
119
109
|
};
|
|
120
110
|
|
|
121
111
|
useEffect(() => {
|
|
122
|
-
events.on(controlMessageEnum.kickScreenshare, () => {
|
|
123
|
-
//if screenscreen already active. then below method will stop the screen share
|
|
124
|
-
// @ts-ignore
|
|
125
|
-
rtc.RtcEngine.startScreenshare();
|
|
126
|
-
});
|
|
127
|
-
|
|
128
112
|
events.on(EventNames.SCREENSHARE_ATTRIBUTE, (data) => {
|
|
129
113
|
const payload = JSON.parse(data.payload);
|
|
130
114
|
const action = payload.action;
|
|
@@ -157,10 +141,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
157
141
|
};
|
|
158
142
|
});
|
|
159
143
|
//if remote user started/stopped the screenshare then change the layout to pinned/grid
|
|
160
|
-
|
|
161
|
-
if (!pinnedUidRef.current.pinnedUid) {
|
|
162
|
-
triggerChangeLayout(false);
|
|
163
|
-
}
|
|
144
|
+
triggerChangeLayout(false);
|
|
164
145
|
break;
|
|
165
146
|
default:
|
|
166
147
|
break;
|
|
@@ -193,10 +174,7 @@ export const ScreenshareConfigure = (props: {children: React.ReactNode}) => {
|
|
|
193
174
|
};
|
|
194
175
|
});
|
|
195
176
|
//if local user stopped the screenshare then change layout to grid
|
|
196
|
-
|
|
197
|
-
if (!pinnedUidRef.current.pinnedUid) {
|
|
198
|
-
triggerChangeLayout(false);
|
|
199
|
-
}
|
|
177
|
+
triggerChangeLayout(false);
|
|
200
178
|
});
|
|
201
179
|
}, []);
|
|
202
180
|
|