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.
Files changed (249) hide show
  1. package/Readme.md +0 -6
  2. package/package.json +2 -2
  3. package/template/_package-lock.json +4979 -7086
  4. package/template/agora-rn-uikit/src/Contexts/LocalUserContext.tsx +0 -4
  5. package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +0 -18
  6. package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +0 -2
  7. package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +26 -30
  8. package/template/agora-rn-uikit/src/Controls/Icons.ts +83 -30
  9. package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +6 -6
  10. package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +0 -1
  11. package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +0 -1
  12. package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +0 -1
  13. package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +0 -1
  14. package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +0 -1
  15. package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +0 -2
  16. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +0 -1
  17. package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +0 -1
  18. package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +0 -1
  19. package/template/agora-rn-uikit/src/Reducer/index.ts +0 -3
  20. package/template/agora-rn-uikit/src/Rtc/Create.tsx +1 -89
  21. package/template/agora-rn-uikit/src/RtcConfigure.tsx +2 -39
  22. package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +5 -15
  23. package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +9 -15
  24. package/template/agora-rn-uikit/src/index.ts +1 -3
  25. package/template/android/app/build.gradle +0 -1
  26. package/template/android/app/src/main/AndroidManifest.xml +15 -22
  27. package/template/android/app/src/main/java/com/helloworld/MainActivity.java +0 -50
  28. package/template/android/build.gradle +3 -3
  29. package/template/babel.config.js +0 -1
  30. package/template/bridge/rtc/webNg/RtcEngine.ts +17 -110
  31. package/template/customization-api/sub-components.ts +1 -1
  32. package/template/customization-api/typeDefinition.ts +1 -2
  33. package/template/electron/index.html +27 -27
  34. package/template/electron/renderer/index.js +0 -1
  35. package/template/global.d.ts +4 -26
  36. package/template/index.js +0 -4
  37. package/template/index.rsdk.tsx +0 -1
  38. package/template/index.web.js +1 -7
  39. package/template/index.wsdk.tsx +1 -1
  40. package/template/ios/HelloWorld/Info.plist +1 -14
  41. package/template/ios/HelloWorld.xcodeproj/project.pbxproj +0 -17
  42. package/template/metro.config.js +1 -1
  43. package/template/package.json +7 -21
  44. package/template/react-native-toast-message/index.d.ts +43 -43
  45. package/template/react-native-toast-message/src/colors/index.js +2 -3
  46. package/template/react-native-toast-message/src/components/base/index.js +59 -46
  47. package/template/react-native-toast-message/src/components/base/styles.js +32 -16
  48. package/template/react-native-toast-message/src/components/error.js +2 -3
  49. package/template/react-native-toast-message/src/components/info.js +2 -3
  50. package/template/react-native-toast-message/src/components/success.js +2 -3
  51. package/template/react-native-toast-message/src/index.js +31 -122
  52. package/template/react-native-toast-message/src/index.sdk.tsx +35 -125
  53. package/template/react-native-toast-message/src/styles.js +4 -3
  54. package/template/react-native-toast-message/src/styles.sdk.ts +4 -3
  55. package/template/src/App.tsx +0 -6
  56. package/template/src/AppWrapper.tsx +28 -63
  57. package/template/src/assets/icons.ts +102 -0
  58. package/template/src/atoms/HorizontalRule.tsx +1 -3
  59. package/template/src/atoms/PrimaryButton.tsx +26 -51
  60. package/template/src/atoms/SecondaryButton.tsx +5 -8
  61. package/template/src/atoms/TextInput.tsx +14 -12
  62. package/template/src/components/Chat.tsx +214 -86
  63. package/template/src/components/ChatContext.ts +1 -8
  64. package/template/src/components/ColorConfigure.tsx +1 -1
  65. package/template/src/components/ColorContext.ts +1 -1
  66. package/template/src/components/{Controls1.native.tsx → Controls.native.tsx} +4 -6
  67. package/template/src/components/Controls.tsx +42 -342
  68. package/template/src/components/DeviceConfigure.tsx +101 -461
  69. package/template/src/components/DeviceContext.tsx +4 -8
  70. package/template/src/components/EventsConfigure.tsx +7 -144
  71. package/template/src/components/GraphQLProvider.tsx +1 -1
  72. package/template/src/components/GridVideo.tsx +44 -59
  73. package/template/src/components/HostControlView.tsx +35 -114
  74. package/template/src/components/Navbar.tsx +398 -216
  75. package/template/src/components/NetworkQualityContext.tsx +20 -20
  76. package/template/src/components/ParticipantsView.tsx +154 -177
  77. package/template/src/components/PinnedVideo.tsx +120 -207
  78. package/template/src/components/Precall.native.tsx +119 -358
  79. package/template/src/components/Precall.tsx +135 -269
  80. package/template/src/components/RTMConfigure.tsx +4 -27
  81. package/template/src/components/Router.electron.ts +0 -1
  82. package/template/src/components/Router.native.ts +0 -1
  83. package/template/src/components/Router.sdk.ts +0 -1
  84. package/template/src/components/Router.ts +0 -1
  85. package/template/src/components/Settings.tsx +95 -26
  86. package/template/src/components/SettingsView.tsx +56 -251
  87. package/template/src/components/Share.tsx +273 -302
  88. package/template/src/components/StorageContext.tsx +3 -30
  89. package/template/src/components/chat-messages/useChatMessages.tsx +23 -69
  90. package/template/src/components/chat-ui/useChatUIControl.tsx +0 -7
  91. package/template/src/components/common/Error.tsx +6 -20
  92. package/template/src/components/common/Logo.tsx +15 -16
  93. package/template/src/components/contexts/LiveStreamDataContext.tsx +5 -10
  94. package/template/src/components/contexts/VideoMeetingDataContext.tsx +7 -37
  95. package/template/src/components/livestream/LiveStreamContext.tsx +36 -270
  96. package/template/src/components/livestream/Types.ts +14 -39
  97. package/template/src/components/livestream/index.ts +0 -1
  98. package/template/src/components/livestream/views/LiveStreamControls.tsx +4 -12
  99. package/template/src/components/participants/AllAudienceParticipants.tsx +30 -101
  100. package/template/src/components/participants/AllHostParticipants.tsx +34 -103
  101. package/template/src/components/participants/MeParticipant.tsx +38 -0
  102. package/template/src/components/participants/ParticipantName.tsx +7 -13
  103. package/template/src/components/participants/ParticipantSectionTitle.tsx +10 -35
  104. package/template/src/components/participants/RemoteParticipants.tsx +71 -0
  105. package/template/src/components/participants/ScreenshareParticipants.tsx +12 -144
  106. package/template/src/components/precall/{LocalMute1.native.tsx → LocalMute.native.tsx} +5 -21
  107. package/template/src/components/precall/LocalMute.tsx +14 -84
  108. package/template/src/components/precall/VideoPreview.native.tsx +3 -48
  109. package/template/src/components/precall/VideoPreview.tsx +7 -163
  110. package/template/src/components/precall/joinCallBtn.tsx +2 -15
  111. package/template/src/components/precall/meetingTitle.tsx +12 -15
  112. package/template/src/components/precall/selectDevice.tsx +21 -1
  113. package/template/src/components/precall/textInput.tsx +4 -32
  114. package/template/src/components/precall/usePreCall.tsx +0 -16
  115. package/template/src/components/styles.ts +21 -42
  116. package/template/src/components/useShareLink.tsx +14 -12
  117. package/template/src/language/default-labels/precallScreenLabels.ts +3 -3
  118. package/template/src/pages/Authenticate.tsx +15 -5
  119. package/template/src/pages/Create.tsx +165 -293
  120. package/template/src/pages/Join.tsx +67 -93
  121. package/template/src/pages/VideoCall.tsx +64 -89
  122. package/template/src/pages/video-call/DefaultLayouts.ts +4 -4
  123. package/template/src/pages/video-call/NameWithMicIcon.tsx +44 -120
  124. package/template/src/pages/video-call/RenderComponent.tsx +2 -3
  125. package/template/src/pages/video-call/VideoCallScreen.tsx +9 -45
  126. package/template/src/pages/video-call/VideoComponent.tsx +3 -18
  127. package/template/src/pages/video-call/VideoRenderer.tsx +60 -218
  128. package/template/src/rtm-events/constants.ts +0 -2
  129. package/template/src/subComponents/ChatBubble.tsx +83 -123
  130. package/template/src/subComponents/ChatContainer.tsx +84 -257
  131. package/template/src/subComponents/ChatInput.tsx +46 -61
  132. package/template/src/subComponents/Checkbox.native.tsx +5 -16
  133. package/template/src/subComponents/Checkbox.tsx +2 -2
  134. package/template/src/subComponents/CopyJoinInfo.tsx +58 -36
  135. package/template/src/subComponents/FallbackLogo.tsx +40 -122
  136. package/template/src/subComponents/LanguageSelector.tsx +1 -1
  137. package/template/src/subComponents/{LayoutIconDropdown1.native.tsx → LayoutIconDropdown.native.tsx} +18 -4
  138. package/template/src/subComponents/LayoutIconDropdown.tsx +134 -131
  139. package/template/src/subComponents/LocalAudioMute.tsx +27 -119
  140. package/template/src/subComponents/LocalEndCall.tsx +33 -71
  141. package/template/src/subComponents/LocalSwitchCamera.tsx +30 -17
  142. package/template/src/subComponents/LocalVideoMute.tsx +27 -117
  143. package/template/src/subComponents/Logo.tsx +4 -3
  144. package/template/src/subComponents/LogoutButton.tsx +1 -1
  145. package/template/src/subComponents/NetworkQualityPill.tsx +63 -60
  146. package/template/src/subComponents/OpenInNativeButton.tsx +3 -3
  147. package/template/src/subComponents/Recording.tsx +29 -28
  148. package/template/src/subComponents/RemoteAudioMute.tsx +29 -83
  149. package/template/src/subComponents/RemoteEndCall.tsx +5 -8
  150. package/template/src/subComponents/RemoteVideoMute.tsx +21 -74
  151. package/template/src/subComponents/ScreenShareNotice.tsx +8 -83
  152. package/template/src/subComponents/SelectDevice.tsx +61 -404
  153. package/template/src/subComponents/SelectOAuth.tsx +8 -9
  154. package/template/src/subComponents/ToastConfig.tsx +10 -150
  155. package/template/src/subComponents/chat/ChatParticipants.tsx +78 -187
  156. package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +32 -95
  157. package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +33 -29
  158. package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +6 -6
  159. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +11 -24
  160. package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +10 -17
  161. package/template/src/subComponents/recording/useRecording.tsx +27 -79
  162. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +70 -52
  163. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +2 -11
  164. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +4 -26
  165. package/template/src/utils/common.tsx +1 -155
  166. package/template/src/utils/index.tsx +0 -19
  167. package/template/src/utils/isMobileOrTablet.ts +2 -7
  168. package/template/src/utils/useButtonTemplate.tsx +0 -1
  169. package/template/src/utils/useMuteToggleLocal.ts +3 -54
  170. package/template/web/index.html +0 -5
  171. package/template/webpack.commons.js +8 -13
  172. package/template/webpack.web.config.js +0 -1
  173. package/template/agora-rn-uikit/src/Reducer/ActiveSpeakerDetected.ts +0 -11
  174. package/template/agora-rn-uikit/src/Reducer/LocalPermissionState.ts +0 -24
  175. package/template/agora-rn-uikit/src/Reducer/UserPin.ts +0 -11
  176. package/template/android/app/src/main/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  177. package/template/android/app/src/main/assets/fonts/icomoon.ttf +0 -0
  178. package/template/android/app/src/main/res/values/colors.xml +0 -7
  179. package/template/react-native-toast-message/src/components/checkbox.js +0 -178
  180. package/template/react-native.config.js +0 -7
  181. package/template/src/assets/font-styles.css +0 -329
  182. package/template/src/assets/fonts/SourceSansPro-Regular.ttf +0 -0
  183. package/template/src/assets/fonts/icomoon.ttf +0 -0
  184. package/template/src/assets/permission.png +0 -0
  185. package/template/src/assets/selection.json +0 -1
  186. package/template/src/atoms/ActionMenu.tsx +0 -236
  187. package/template/src/atoms/AnimatedActiveSpeaker.native.tsx +0 -71
  188. package/template/src/atoms/AnimatedActiveSpeaker.tsx +0 -84
  189. package/template/src/atoms/AnimatedRings.native.tsx +0 -68
  190. package/template/src/atoms/AnimatedRings.tsx +0 -70
  191. package/template/src/atoms/Card.tsx +0 -61
  192. package/template/src/atoms/CircularProgress.native.tsx +0 -121
  193. package/template/src/atoms/CircularProgress.tsx +0 -102
  194. package/template/src/atoms/CustomIcon.tsx +0 -88
  195. package/template/src/atoms/CustomSwitch.tsx +0 -287
  196. package/template/src/atoms/Dropdown.tsx +0 -306
  197. package/template/src/atoms/IconButton.tsx +0 -162
  198. package/template/src/atoms/ImageIcon.tsx +0 -98
  199. package/template/src/atoms/InfoBubble.tsx +0 -291
  200. package/template/src/atoms/Input.tsx +0 -87
  201. package/template/src/atoms/InviteInfo.tsx +0 -166
  202. package/template/src/atoms/LinkButton.tsx +0 -28
  203. package/template/src/atoms/OutlineButton.tsx +0 -61
  204. package/template/src/atoms/ParticipantsCount.tsx +0 -73
  205. package/template/src/atoms/Popup.tsx +0 -147
  206. package/template/src/atoms/RecordingInfo.tsx +0 -49
  207. package/template/src/atoms/Spacer.tsx +0 -22
  208. package/template/src/atoms/TertiaryButton.tsx +0 -78
  209. package/template/src/atoms/Toggle.tsx +0 -47
  210. package/template/src/atoms/Tooltip.native.tsx +0 -65
  211. package/template/src/atoms/Tooltip.tsx +0 -94
  212. package/template/src/atoms/UserAvatar.tsx +0 -60
  213. package/template/src/components/CommonStyles.ts +0 -44
  214. package/template/src/components/ToastComponent.tsx +0 -8
  215. package/template/src/components/participants/Participant.tsx +0 -302
  216. package/template/src/components/participants/UserActionMenuOptions.tsx +0 -398
  217. package/template/src/components/popups/InvitePopup.tsx +0 -115
  218. package/template/src/components/popups/StopRecordingPopup.tsx +0 -114
  219. package/template/src/components/precall/PermissionHelper.native.tsx +0 -5
  220. package/template/src/components/precall/PermissionHelper.tsx +0 -126
  221. package/template/src/components/precall/PreCallSettings.tsx +0 -52
  222. package/template/src/components/useToast.tsx +0 -41
  223. package/template/src/components/useVideoCall.tsx +0 -65
  224. package/template/src/pages/Endcall.tsx +0 -148
  225. package/template/src/pages/video-call/ActionSheet.native.tsx +0 -215
  226. package/template/src/pages/video-call/ActionSheet.tsx +0 -226
  227. package/template/src/pages/video-call/ActionSheetContent.tsx +0 -479
  228. package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -38
  229. package/template/src/pages/video-call/ActionSheetStyles.css +0 -138
  230. package/template/src/pages/video-call/SidePanelHeader.tsx +0 -190
  231. package/template/src/pages/video-call/VideoCallMobileView.tsx +0 -139
  232. package/template/src/pages/video-call/VideoCallScreen.native.tsx +0 -37
  233. package/template/src/subComponents/ChatInput.ios.tsx +0 -237
  234. package/template/src/subComponents/EndcallPopup.tsx +0 -107
  235. package/template/src/subComponents/LayoutIconButton.tsx +0 -201
  236. package/template/src/subComponents/RemoteMutePopup.tsx +0 -193
  237. package/template/src/subComponents/RemoveMeetingPopup.tsx +0 -109
  238. package/template/src/subComponents/RemoveScreensharePopup.tsx +0 -109
  239. package/template/src/subComponents/SelectDeviceSettings.backup.tsx +0 -207
  240. package/template/src/subComponents/SidePanelHeader.tsx +0 -112
  241. package/template/src/theme/index.ts +0 -46
  242. package/template/src/utils/PlatformWrapper.tsx +0 -21
  243. package/template/src/utils/hexadecimalTransparency.ts +0 -108
  244. package/template/src/utils/pendingStateUpdateHelper.ts +0 -19
  245. package/template/src/utils/useFocus.tsx +0 -46
  246. package/template/src/utils/useIsActiveSpeaker.ts +0 -27
  247. package/template/src/utils/useIsHandRaised.ts +0 -13
  248. package/template/src/utils/useRemoteEndScreenshare.ts +0 -26
  249. 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,7 +5,6 @@ export default function UserMuteRemoteAudio(
5
5
  action: ActionType<'UserMuteRemoteAudio'>,
6
6
  ) {
7
7
  let stateUpdate: RenderStateInterface = {
8
- activeSpeaker: state.activeSpeaker,
9
8
  renderList: {
10
9
  ...state.renderList,
11
10
  [action.value[0]]: {
@@ -5,7 +5,6 @@ export default function UserMuteRemoteVideo(
5
5
  action: ActionType<'UserMuteRemoteVideo'>,
6
6
  ) {
7
7
  let stateUpdate: RenderStateInterface = {
8
- activeSpeaker: state.activeSpeaker,
9
8
  renderList: {
10
9
  ...state.renderList,
11
10
  [action.value[0]]: {
@@ -16,7 +16,6 @@ export default function UserOffline(
16
16
  (uid) => uid !== action.value[0],
17
17
  );
18
18
  const stateUpdate: RenderStateInterface = {
19
- activeSpeaker: state.activeSpeaker,
20
19
  renderList: state.renderList,
21
20
  activeUids: updatedActiveUids,
22
21
  };
@@ -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, rtcProps.uid]);
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, mode} = useContext(PropsContext);
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, ViewStyle} from 'react-native';
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={[{flex: 1, backgroundColor: '#000'}, containerStyle]} />
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={[{flex: 1, backgroundColor: '#000'}, containerStyle]} />
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, ViewStyle} from 'react-native';
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 style={containerStyle} renderMode={VideoRenderMode.Fit} />
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={[{flex: 1, backgroundColor: '#000'}, containerStyle]} />
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={containerStyle}
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, PermissionState} from './Contexts/PropsContext';
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';
@@ -178,7 +178,6 @@ android {
178
178
 
179
179
  }
180
180
  }
181
-
182
181
  }
183
182
 
184
183
  dependencies {
@@ -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
- <uses-permission android:name="android.permission.INTERNET" />
5
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
6
- <uses-permission android:name="android.permission.WAKE_LOCK" />
7
- <application
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
- <activity
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
- android:screenOrientation="portrait"
21
- android:exported="true">
22
- <intent-filter>
23
- <action android:name="android.intent.action.MAIN" />
24
- <category android:name="android.intent.category.LAUNCHER" />
25
- </intent-filter>
26
- </activity>
27
- <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
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 = 34
8
- targetSdkVersion = 34
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:4.1.2")
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
  }
@@ -29,6 +29,5 @@ module.exports = {
29
29
  },
30
30
  },
31
31
  ],
32
- 'react-native-reanimated/plugin'
33
32
  ],
34
33
  };