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
|
@@ -44,7 +44,6 @@ export default function UserJoined(
|
|
|
44
44
|
}
|
|
45
45
|
//Swap render positions
|
|
46
46
|
stateUpdate = {
|
|
47
|
-
activeSpeaker: state.activeSpeaker,
|
|
48
47
|
renderList: renderList,
|
|
49
48
|
activeUids: activeUids.reverse(),
|
|
50
49
|
lastJoinedUid: newUid,
|
|
@@ -52,7 +51,6 @@ export default function UserJoined(
|
|
|
52
51
|
} else {
|
|
53
52
|
//More than one remote
|
|
54
53
|
stateUpdate = {
|
|
55
|
-
activeSpeaker: state.activeSpeaker,
|
|
56
54
|
renderList: renderList,
|
|
57
55
|
activeUids: activeUids,
|
|
58
56
|
lastJoinedUid: newUid,
|
|
@@ -5,8 +5,5 @@ export {default as UserMuteRemoteAudio} from './UserMuteRemoteAudio';
|
|
|
5
5
|
export {default as UserMuteRemoteVideo} from './UserMuteRemoteVideo';
|
|
6
6
|
export {default as LocalMuteAudio} from './LocalMuteAudio';
|
|
7
7
|
export {default as LocalMuteVideo} from './LocalMuteVideo';
|
|
8
|
-
export {default as LocalPermissionState} from './LocalPermissionState';
|
|
9
8
|
export {default as RemoteAudioStateChanged} from './RemoteAudioStateChanged';
|
|
10
9
|
export {default as RemoteVideoStateChanged} from './RemoteVideoStateChanged';
|
|
11
|
-
export {default as ActiveSpeakerDetected} from './ActiveSpeakerDetected';
|
|
12
|
-
export {default as UserPin} from './UserPin';
|
|
@@ -12,7 +12,6 @@ import PropsContext, {
|
|
|
12
12
|
ToggleState,
|
|
13
13
|
ClientRole,
|
|
14
14
|
ChannelProfile,
|
|
15
|
-
PermissionState,
|
|
16
15
|
} from '../Contexts/PropsContext';
|
|
17
16
|
import quality from '../Utils/quality';
|
|
18
17
|
|
|
@@ -34,52 +33,16 @@ const Create = ({
|
|
|
34
33
|
const isVideoEnabledRef = useRef<boolean>(false);
|
|
35
34
|
const firstUpdate = useRef(true);
|
|
36
35
|
|
|
37
|
-
const dispatchPermissionState = (audioError: any, videoError: any) => {
|
|
38
|
-
if (audioError && videoError) {
|
|
39
|
-
dispatch({
|
|
40
|
-
type: 'LocalPermissionState',
|
|
41
|
-
value: [PermissionState.REJECTED],
|
|
42
|
-
});
|
|
43
|
-
} else if (audioError && !videoError) {
|
|
44
|
-
dispatch({
|
|
45
|
-
type: 'LocalPermissionState',
|
|
46
|
-
value: [PermissionState.GRANTED_FOR_CAM_ONLY],
|
|
47
|
-
});
|
|
48
|
-
} else if (!audioError && videoError) {
|
|
49
|
-
dispatch({
|
|
50
|
-
type: 'LocalPermissionState',
|
|
51
|
-
value: [PermissionState.GRANTED_FOR_MIC_ONLY],
|
|
52
|
-
});
|
|
53
|
-
} else {
|
|
54
|
-
dispatch({
|
|
55
|
-
type: 'LocalPermissionState',
|
|
56
|
-
value: [PermissionState.GRANTED_FOR_CAM_AND_MIC],
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
36
|
const enableVideoAndAudioWithDisabledState = async () => {
|
|
62
37
|
try {
|
|
63
|
-
dispatch({
|
|
64
|
-
type: 'LocalPermissionState',
|
|
65
|
-
value: [PermissionState.REQUESTED],
|
|
66
|
-
});
|
|
67
38
|
if (audioRoom === true) {
|
|
68
39
|
await engine.current.enableAudio();
|
|
69
|
-
dispatch({
|
|
70
|
-
type: 'LocalPermissionState',
|
|
71
|
-
value: [PermissionState.GRANTED_FOR_MIC_ONLY],
|
|
72
|
-
});
|
|
73
40
|
dispatch({
|
|
74
41
|
type: 'LocalMuteAudio',
|
|
75
42
|
value: [ToggleState.disabled],
|
|
76
43
|
});
|
|
77
44
|
} else {
|
|
78
45
|
await engine.current.enableVideo();
|
|
79
|
-
dispatch({
|
|
80
|
-
type: 'LocalPermissionState',
|
|
81
|
-
value: [PermissionState.GRANTED_FOR_CAM_AND_MIC],
|
|
82
|
-
});
|
|
83
46
|
dispatch({
|
|
84
47
|
type: 'LocalMuteAudio',
|
|
85
48
|
value: [ToggleState.disabled],
|
|
@@ -112,33 +75,20 @@ const Create = ({
|
|
|
112
75
|
} else {
|
|
113
76
|
console.error('No video device', videoError);
|
|
114
77
|
}
|
|
115
|
-
dispatchPermissionState(audioError, videoError);
|
|
116
78
|
}
|
|
117
79
|
console.error('No devices', error);
|
|
118
80
|
}
|
|
119
81
|
};
|
|
120
82
|
const enableVideoAndAudioWithEnabledState = async () => {
|
|
121
83
|
try {
|
|
122
|
-
dispatch({
|
|
123
|
-
type: 'LocalPermissionState',
|
|
124
|
-
value: [PermissionState.REQUESTED],
|
|
125
|
-
});
|
|
126
84
|
if (audioRoom === true) {
|
|
127
85
|
await engine.current.enableAudio();
|
|
128
|
-
dispatch({
|
|
129
|
-
type: 'LocalPermissionState',
|
|
130
|
-
value: [PermissionState.GRANTED_FOR_MIC_ONLY],
|
|
131
|
-
});
|
|
132
86
|
dispatch({
|
|
133
87
|
type: 'LocalMuteAudio',
|
|
134
88
|
value: [ToggleState.enabled],
|
|
135
89
|
});
|
|
136
90
|
} else {
|
|
137
91
|
await engine.current.enableVideo();
|
|
138
|
-
dispatch({
|
|
139
|
-
type: 'LocalPermissionState',
|
|
140
|
-
value: [PermissionState.GRANTED_FOR_CAM_AND_MIC],
|
|
141
|
-
});
|
|
142
92
|
dispatch({
|
|
143
93
|
type: 'LocalMuteAudio',
|
|
144
94
|
value: [ToggleState.enabled],
|
|
@@ -172,7 +122,6 @@ const Create = ({
|
|
|
172
122
|
} else {
|
|
173
123
|
console.error('No video device', videoError);
|
|
174
124
|
}
|
|
175
|
-
dispatchPermissionState(audioError, videoError);
|
|
176
125
|
}
|
|
177
126
|
console.error('No devices', e);
|
|
178
127
|
}
|
|
@@ -228,7 +177,6 @@ const Create = ({
|
|
|
228
177
|
} else {
|
|
229
178
|
await engine.current.setChannelProfile(ChannelProfile.Communication);
|
|
230
179
|
}
|
|
231
|
-
await engine.current.enableAudioVolumeIndication(500, 3, true);
|
|
232
180
|
if (!audioRoom) {
|
|
233
181
|
if (rtcProps.profile) {
|
|
234
182
|
if (Platform.OS === 'web') {
|
|
@@ -329,42 +277,6 @@ const Create = ({
|
|
|
329
277
|
value: args,
|
|
330
278
|
});
|
|
331
279
|
});
|
|
332
|
-
|
|
333
|
-
engine.current.addListener('AudioVolumeIndication', (...args) => {
|
|
334
|
-
// console.log('-- AudioVolumeCallback', args);
|
|
335
|
-
const [speakers, totalVolume] = args;
|
|
336
|
-
if (speakers[0]?.uid === 0) {
|
|
337
|
-
//callback for local user
|
|
338
|
-
const isLocalUserSpeaking = speakers[0].vad; //1-speaking , 0-not speaking
|
|
339
|
-
const localUserVolumeLevel = speakers[0].volume;
|
|
340
|
-
// vad value is not consistent while speaking so using volume level
|
|
341
|
-
if (localUserVolumeLevel > 0) {
|
|
342
|
-
dispatch({
|
|
343
|
-
type: 'ActiveSpeakerDetected',
|
|
344
|
-
value: [rtcProps.uid],
|
|
345
|
-
});
|
|
346
|
-
} else {
|
|
347
|
-
dispatch({
|
|
348
|
-
type: 'ActiveSpeakerDetected',
|
|
349
|
-
value: [undefined],
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
} else {
|
|
353
|
-
// remote users callback, this will be handeled in ActiveSpeaker callback(367)
|
|
354
|
-
// const highestvolumeObj = speakers.reduce(function (prev, current) {
|
|
355
|
-
// return prev.volume > current.volume ? prev : current;
|
|
356
|
-
// }, null);
|
|
357
|
-
}
|
|
358
|
-
});
|
|
359
|
-
|
|
360
|
-
engine.current.addListener('ActiveSpeaker', (...args) => {
|
|
361
|
-
// used as a callback from the web bridge as well remote users
|
|
362
|
-
dispatch({
|
|
363
|
-
type: 'ActiveSpeakerDetected',
|
|
364
|
-
value: args,
|
|
365
|
-
});
|
|
366
|
-
});
|
|
367
|
-
|
|
368
280
|
setReady(true);
|
|
369
281
|
} catch (e) {
|
|
370
282
|
console.error(e);
|
|
@@ -381,7 +293,7 @@ const Create = ({
|
|
|
381
293
|
engine.current!.destroy();
|
|
382
294
|
}
|
|
383
295
|
};
|
|
384
|
-
}, [rtcProps.appId
|
|
296
|
+
}, [rtcProps.appId]);
|
|
385
297
|
|
|
386
298
|
useEffect(() => {
|
|
387
299
|
const toggleRole = async () => {
|
|
@@ -11,18 +11,13 @@ import PropsContext, {
|
|
|
11
11
|
RtcPropsInterface,
|
|
12
12
|
CallbacksInterface,
|
|
13
13
|
DualStreamMode,
|
|
14
|
-
PermissionState,
|
|
15
|
-
ChannelProfile,
|
|
16
|
-
ClientRole,
|
|
17
14
|
} from './Contexts/PropsContext';
|
|
18
15
|
import {RenderProvider} from './Contexts/RenderContext';
|
|
19
16
|
import {actionTypeGuard} from './Utils/actionTypeGuard';
|
|
20
17
|
|
|
21
18
|
import {
|
|
22
|
-
ActiveSpeakerDetected,
|
|
23
19
|
LocalMuteAudio,
|
|
24
20
|
LocalMuteVideo,
|
|
25
|
-
LocalPermissionState,
|
|
26
21
|
RemoteAudioStateChanged,
|
|
27
22
|
RemoteVideoStateChanged,
|
|
28
23
|
UpdateDualStreamMode,
|
|
@@ -30,14 +25,13 @@ import {
|
|
|
30
25
|
UserMuteRemoteAudio,
|
|
31
26
|
UserMuteRemoteVideo,
|
|
32
27
|
UserOffline,
|
|
33
|
-
UserPin,
|
|
34
28
|
} from './Reducer';
|
|
35
29
|
import Create from './Rtc/Create';
|
|
36
30
|
import Join from './Rtc/Join';
|
|
37
31
|
import useLocalUid from './Utils/useLocalUid';
|
|
38
32
|
|
|
39
33
|
const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
40
|
-
const {callbacks, rtcProps
|
|
34
|
+
const {callbacks, rtcProps} = useContext(PropsContext);
|
|
41
35
|
let [dualStreamMode, setDualStreamMode] = useState<DualStreamMode>(
|
|
42
36
|
rtcProps?.initialDualStreamMode || DualStreamMode.DYNAMIC,
|
|
43
37
|
);
|
|
@@ -50,12 +44,9 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
50
44
|
video: ToggleState.disabled,
|
|
51
45
|
streamType: 'high',
|
|
52
46
|
type: 'rtc',
|
|
53
|
-
permissionStatus: PermissionState.NOT_REQUESTED,
|
|
54
47
|
},
|
|
55
48
|
},
|
|
56
49
|
activeUids: [localUid],
|
|
57
|
-
activeSpeaker: undefined,
|
|
58
|
-
pinnedUid: undefined,
|
|
59
50
|
lastJoinedUid: 0,
|
|
60
51
|
};
|
|
61
52
|
|
|
@@ -181,11 +172,6 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
181
172
|
stateUpdate = LocalMuteVideo(state, action, localUid);
|
|
182
173
|
}
|
|
183
174
|
break;
|
|
184
|
-
case 'LocalPermissionState':
|
|
185
|
-
if (actionTypeGuard(action, action.type)) {
|
|
186
|
-
stateUpdate = LocalPermissionState(state, action, localUid);
|
|
187
|
-
}
|
|
188
|
-
break;
|
|
189
175
|
case 'RemoteAudioStateChanged':
|
|
190
176
|
if (actionTypeGuard(action, action.type)) {
|
|
191
177
|
stateUpdate = RemoteAudioStateChanged(state, action);
|
|
@@ -196,16 +182,6 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
196
182
|
stateUpdate = RemoteVideoStateChanged(state, action);
|
|
197
183
|
}
|
|
198
184
|
break;
|
|
199
|
-
case 'ActiveSpeakerDetected':
|
|
200
|
-
if (actionTypeGuard(action, action.type)) {
|
|
201
|
-
stateUpdate = ActiveSpeakerDetected(state, action);
|
|
202
|
-
}
|
|
203
|
-
break;
|
|
204
|
-
case 'UserPin':
|
|
205
|
-
if (actionTypeGuard(action, action.type)) {
|
|
206
|
-
stateUpdate = UserPin(state, action);
|
|
207
|
-
}
|
|
208
|
-
break;
|
|
209
185
|
}
|
|
210
186
|
|
|
211
187
|
// TODO: remove Handle event listeners
|
|
@@ -271,7 +247,6 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
271
247
|
return {
|
|
272
248
|
activeUids: activeUids,
|
|
273
249
|
renderList: renderList,
|
|
274
|
-
activeSpeaker: state.activeSpeaker,
|
|
275
250
|
};
|
|
276
251
|
},
|
|
277
252
|
[dualStreamMode],
|
|
@@ -317,7 +292,6 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
317
292
|
activeUids = [newMaxUid, currentMaxUid, ...minIds];
|
|
318
293
|
|
|
319
294
|
return {
|
|
320
|
-
activeSpeaker: state.activeSpeaker,
|
|
321
295
|
activeUids: activeUids,
|
|
322
296
|
renderList: renderList,
|
|
323
297
|
};
|
|
@@ -347,18 +321,7 @@ const RtcConfigure = (props: {children: React.ReactNode}) => {
|
|
|
347
321
|
<RenderProvider
|
|
348
322
|
value={{
|
|
349
323
|
renderList: uidState.renderList,
|
|
350
|
-
activeUids:
|
|
351
|
-
//In livestreaming mode ->audience should not see their local video tile
|
|
352
|
-
mode == ChannelProfile.LiveBroadcasting &&
|
|
353
|
-
rtcProps?.role == ClientRole.Audience
|
|
354
|
-
? uidState.activeUids.filter((i) => i !== localUid)
|
|
355
|
-
: uidState.activeUids,
|
|
356
|
-
activeSpeaker: uidState.activeSpeaker,
|
|
357
|
-
pinnedUid:
|
|
358
|
-
uidState?.pinnedUid &&
|
|
359
|
-
uidState?.activeUids?.indexOf(uidState.pinnedUid) !== -1
|
|
360
|
-
? uidState.pinnedUid
|
|
361
|
-
: undefined,
|
|
324
|
+
activeUids: uidState.activeUids,
|
|
362
325
|
lastJoinedUid: uidState.lastJoinedUid,
|
|
363
326
|
}}>
|
|
364
327
|
{props.children}
|
|
@@ -2,7 +2,7 @@ import React, {useContext} from 'react';
|
|
|
2
2
|
import {RtcLocalView, RtcRemoteView, VideoRenderMode} from 'react-native-agora';
|
|
3
3
|
import styles from '../Style';
|
|
4
4
|
import PropsContext, {RenderInterface} from '../Contexts/PropsContext';
|
|
5
|
-
import {View
|
|
5
|
+
import {View} from 'react-native';
|
|
6
6
|
import useLocalUid from '../Utils/useLocalUid';
|
|
7
7
|
|
|
8
8
|
const LocalView = RtcLocalView.SurfaceView;
|
|
@@ -11,45 +11,35 @@ const RemoteView = RtcRemoteView.SurfaceView;
|
|
|
11
11
|
interface MaxViewInterface {
|
|
12
12
|
user: RenderInterface;
|
|
13
13
|
fallback?: React.ComponentType;
|
|
14
|
-
containerStyle?: ViewStyle;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
const MaxVideoView: React.FC<MaxViewInterface> = (props) => {
|
|
18
17
|
const {styleProps, rtcProps} = useContext(PropsContext);
|
|
19
18
|
const {maxViewStyles} = styleProps || {};
|
|
20
|
-
const {containerStyle = {}} = props;
|
|
21
19
|
const Fallback = props.fallback;
|
|
22
20
|
const localUid = useLocalUid();
|
|
23
21
|
const uid = props.user.uid === rtcProps?.screenShareUid ? 1 : props.user.uid;
|
|
24
22
|
return uid === localUid ? (
|
|
25
23
|
props.user.video ? (
|
|
26
24
|
<LocalView
|
|
27
|
-
style={{
|
|
28
|
-
...styles.fullView,
|
|
29
|
-
...(maxViewStyles as object),
|
|
30
|
-
...containerStyle,
|
|
31
|
-
}}
|
|
25
|
+
style={{...styles.fullView, ...(maxViewStyles as object)}}
|
|
32
26
|
renderMode={VideoRenderMode.Fit}
|
|
33
27
|
/>
|
|
34
28
|
) : Fallback ? (
|
|
35
29
|
<Fallback />
|
|
36
30
|
) : (
|
|
37
|
-
<View style={
|
|
31
|
+
<View style={{flex: 1, backgroundColor: '#000'}} />
|
|
38
32
|
)
|
|
39
33
|
) : props.user.video ? (
|
|
40
34
|
<RemoteView
|
|
41
|
-
style={{
|
|
42
|
-
...styles.fullView,
|
|
43
|
-
...(maxViewStyles as object),
|
|
44
|
-
...containerStyle,
|
|
45
|
-
}}
|
|
35
|
+
style={{...styles.fullView, ...(maxViewStyles as object)}}
|
|
46
36
|
uid={uid as number}
|
|
47
37
|
renderMode={VideoRenderMode.Fit}
|
|
48
38
|
/>
|
|
49
39
|
) : Fallback ? (
|
|
50
40
|
<Fallback />
|
|
51
41
|
) : (
|
|
52
|
-
<View style={
|
|
42
|
+
<View style={{flex: 1, backgroundColor: '#000'}} />
|
|
53
43
|
);
|
|
54
44
|
};
|
|
55
45
|
|
|
@@ -2,7 +2,7 @@ import React, {useContext} from 'react';
|
|
|
2
2
|
import {RtcLocalView, RtcRemoteView, VideoRenderMode} from 'react-native-agora';
|
|
3
3
|
import styles from '../Style';
|
|
4
4
|
import PropsContext, {RenderInterface} from '../Contexts/PropsContext';
|
|
5
|
-
import {View
|
|
5
|
+
import {View} from 'react-native';
|
|
6
6
|
import useLocalUid from '../Utils/useLocalUid';
|
|
7
7
|
|
|
8
8
|
const LocalView = RtcLocalView.SurfaceView;
|
|
@@ -11,34 +11,30 @@ const RemoteView = RtcRemoteView.SurfaceView;
|
|
|
11
11
|
interface MaxViewInterface {
|
|
12
12
|
user: RenderInterface;
|
|
13
13
|
fallback?: React.ComponentType;
|
|
14
|
-
containerStyle?: ViewStyle;
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
const MaxVideoView: React.FC<MaxViewInterface> = (props) => {
|
|
18
17
|
const {styleProps, rtcProps} = useContext(PropsContext);
|
|
19
18
|
const {maxViewStyles} = styleProps || {};
|
|
20
19
|
const Fallback = props.fallback;
|
|
21
|
-
const {containerStyle = {}} = props;
|
|
22
20
|
const localUid = useLocalUid();
|
|
23
21
|
const uid = props.user.uid === rtcProps?.screenShareUid ? 1 : props.user.uid;
|
|
24
22
|
return uid === localUid ? (
|
|
25
23
|
props.user.video ? (
|
|
26
|
-
<LocalView
|
|
24
|
+
<LocalView
|
|
25
|
+
style={{...styles.fullView, ...(maxViewStyles as object)}}
|
|
26
|
+
renderMode={VideoRenderMode.Fit}
|
|
27
|
+
/>
|
|
27
28
|
) : Fallback ? (
|
|
28
29
|
<Fallback />
|
|
29
30
|
) : (
|
|
30
|
-
<View style={
|
|
31
|
+
<View style={{flex: 1, backgroundColor: '#000'}} />
|
|
31
32
|
)
|
|
32
33
|
) : (
|
|
33
34
|
<>
|
|
34
|
-
<div
|
|
35
|
-
style={{
|
|
36
|
-
flex: 1,
|
|
37
|
-
overflow: 'hidden',
|
|
38
|
-
display: props.user.video ? 'flex' : 'none',
|
|
39
|
-
}}>
|
|
35
|
+
<div style={{flex: 1, display: props.user.video ? 'flex' : 'none'}}>
|
|
40
36
|
<RemoteView
|
|
41
|
-
style={
|
|
37
|
+
style={{...styles.fullView, ...(maxViewStyles as object)}}
|
|
42
38
|
uid={uid as number}
|
|
43
39
|
renderMode={VideoRenderMode.Fit}
|
|
44
40
|
/>
|
|
@@ -50,9 +46,7 @@ const MaxVideoView: React.FC<MaxViewInterface> = (props) => {
|
|
|
50
46
|
{Fallback ? (
|
|
51
47
|
<Fallback />
|
|
52
48
|
) : (
|
|
53
|
-
<View
|
|
54
|
-
style={[{flex: 1, backgroundColor: '#000'}, containerStyle]}
|
|
55
|
-
/>
|
|
49
|
+
<View style={{flex: 1, backgroundColor: '#000'}} />
|
|
56
50
|
)}
|
|
57
51
|
</>
|
|
58
52
|
)}
|
|
@@ -25,7 +25,7 @@ export {
|
|
|
25
25
|
|
|
26
26
|
export {DualStreamMode} from './Contexts/PropsContext';
|
|
27
27
|
|
|
28
|
-
export {ToggleState
|
|
28
|
+
export {ToggleState} from './Contexts/PropsContext';
|
|
29
29
|
|
|
30
30
|
export type {
|
|
31
31
|
DefaultRenderInterface,
|
|
@@ -67,6 +67,4 @@ export {default as RemoteVideoMute} from './Controls/Remote/RemoteVideoMute';
|
|
|
67
67
|
export {default as RemoteControls} from './Controls/RemoteControls';
|
|
68
68
|
|
|
69
69
|
export {default as ImageIcon} from './Controls/ImageIcon';
|
|
70
|
-
export {default as Icons} from './Controls/Icons';
|
|
71
|
-
export type {IconsInterface} from './Controls/Icons';
|
|
72
70
|
export {default as useLocalUid} from './Utils/useLocalUid';
|
|
@@ -1,34 +1,27 @@
|
|
|
1
|
-
<manifest
|
|
2
|
-
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
2
|
package="com.helloworld">
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
|
|
6
|
+
<application
|
|
8
7
|
android:name=".MainApplication"
|
|
9
8
|
android:label="@string/app_name"
|
|
10
9
|
android:icon="@mipmap/ic_launcher"
|
|
11
10
|
android:roundIcon="@mipmap/ic_launcher_round"
|
|
12
11
|
android:allowBackup="false"
|
|
13
12
|
android:theme="@style/AppTheme">
|
|
14
|
-
|
|
13
|
+
<activity
|
|
15
14
|
android:name=".MainActivity"
|
|
16
15
|
android:label="@string/app_name"
|
|
17
16
|
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
|
|
18
17
|
android:launchMode="singleTask"
|
|
19
|
-
android:windowSoftInputMode="adjustResize"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<meta-data android:name="com.supersami.foregroundservice.notification_channel_name" android:value="AppBuilder"/>
|
|
29
|
-
<meta-data android:name="com.supersami.foregroundservice.notification_channel_description" android:value="AppBuilder is running"/>
|
|
30
|
-
<meta-data android:name="com.supersami.foregroundservice.notification_color" android:resource="@color/blue"/>
|
|
31
|
-
<service android:name="com.supersami.foregroundservice.ForegroundService" />
|
|
32
|
-
<service android:name="com.supersami.foregroundservice.ForegroundServiceTask" />
|
|
33
|
-
</application>
|
|
18
|
+
android:windowSoftInputMode="adjustResize">
|
|
19
|
+
<intent-filter>
|
|
20
|
+
<action android:name="android.intent.action.MAIN" />
|
|
21
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
22
|
+
</intent-filter>
|
|
23
|
+
</activity>
|
|
24
|
+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
25
|
+
</application>
|
|
26
|
+
|
|
34
27
|
</manifest>
|
|
@@ -2,58 +2,8 @@ package com.helloworld;
|
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.ReactActivity;
|
|
4
4
|
|
|
5
|
-
// for bg audio
|
|
6
|
-
import android.content.Intent;
|
|
7
|
-
import android.util.Log;
|
|
8
|
-
import com.facebook.react.bridge.WritableMap;
|
|
9
|
-
import com.facebook.react.bridge.Arguments;
|
|
10
|
-
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
11
|
-
|
|
12
5
|
public class MainActivity extends ReactActivity {
|
|
13
6
|
|
|
14
|
-
// Added for bg audio till end of main activity
|
|
15
|
-
public boolean isOnNewIntent = false;
|
|
16
|
-
|
|
17
|
-
@Override
|
|
18
|
-
public void onNewIntent(Intent intent) {
|
|
19
|
-
super.onNewIntent(intent);
|
|
20
|
-
isOnNewIntent = true;
|
|
21
|
-
ForegroundEmitter();
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
@Override
|
|
25
|
-
protected void onStart() {
|
|
26
|
-
super.onStart();
|
|
27
|
-
if(isOnNewIntent == true){}else {
|
|
28
|
-
ForegroundEmitter();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
public void ForegroundEmitter(){
|
|
33
|
-
// this method is to send back data from java to javascript so one can easily
|
|
34
|
-
// know which button from notification or the notification button is clicked
|
|
35
|
-
String main = getIntent().getStringExtra("mainOnPress");
|
|
36
|
-
String btn = getIntent().getStringExtra("buttonOnPress");
|
|
37
|
-
String btn2 = getIntent().getStringExtra("button2OnPress");
|
|
38
|
-
WritableMap map = Arguments.createMap();
|
|
39
|
-
if (main != null) {
|
|
40
|
-
map.putString("main", main);
|
|
41
|
-
}
|
|
42
|
-
if (btn != null) {
|
|
43
|
-
map.putString("button", btn);
|
|
44
|
-
}
|
|
45
|
-
if (btn2 != null) {
|
|
46
|
-
map.putString("button", btn);
|
|
47
|
-
}
|
|
48
|
-
try {
|
|
49
|
-
getReactInstanceManager().getCurrentReactContext()
|
|
50
|
-
.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
|
|
51
|
-
.emit("notificationClickHandle", map);
|
|
52
|
-
} catch (Exception e) {
|
|
53
|
-
Log.e("SuperLog", "Caught Exception: " + e.getMessage());
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
7
|
/**
|
|
58
8
|
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
59
9
|
* rendering of the component.
|
|
@@ -4,15 +4,15 @@ buildscript {
|
|
|
4
4
|
ext {
|
|
5
5
|
buildToolsVersion = "29.0.2"
|
|
6
6
|
minSdkVersion = 21
|
|
7
|
-
compileSdkVersion =
|
|
8
|
-
targetSdkVersion =
|
|
7
|
+
compileSdkVersion = 29
|
|
8
|
+
targetSdkVersion = 29
|
|
9
9
|
}
|
|
10
10
|
repositories {
|
|
11
11
|
google()
|
|
12
12
|
jcenter()
|
|
13
13
|
}
|
|
14
14
|
dependencies {
|
|
15
|
-
classpath("com.android.tools.build:gradle:
|
|
15
|
+
classpath("com.android.tools.build:gradle:3.5.3")
|
|
16
16
|
// NOTE: Do not place your application dependencies here; they belong
|
|
17
17
|
// in the individual module build.gradle files
|
|
18
18
|
}
|