agora-appbuilder-core 4.0.0-spl.11 → 4.0.0-spl.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "4.0.0-spl.11",
3
+ "version": "4.0.0-spl.13",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -34,9 +34,6 @@ import ToastComponent from './components/ToastComponent';
34
34
  import {ToastContext, ToastProvider} from './components/useToast';
35
35
  import {SdkApiContext} from './components/SdkApiContext';
36
36
  import isSDK from './utils/isSDK';
37
- import {setupLogger} from './utils/axiomLogger';
38
-
39
- setupLogger();
40
37
 
41
38
  interface AppWrapperProps {
42
39
  children: React.ReactNode;
@@ -136,10 +136,10 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
136
136
  const {RtcEngine} = rtc as unknown as {RtcEngine: WebRtcEngineInstance};
137
137
  const {localStream} = RtcEngine;
138
138
 
139
- const refreshDeviceList = useCallback(async () => {
139
+ const refreshDeviceList = useCallback(async (noEmitLog?: boolean) => {
140
140
  let updatedDeviceList: MediaDeviceInfo[];
141
141
  await RtcEngine.getDevices(function (devices: deviceInfo[]) {
142
- log('Fetching all devices: ', devices);
142
+ !noEmitLog && log('Fetching all devices: ', devices);
143
143
  /**
144
144
  * Some browsers list the same microphone twice with different Id's,
145
145
  * their group Id's match as they are the same physical device.
@@ -161,7 +161,7 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
161
161
  device.kind == 'audiooutput'),
162
162
  );
163
163
 
164
- log('Setting unique devices', updatedDeviceList);
164
+ !noEmitLog && log('Setting unique devices', updatedDeviceList);
165
165
  if (updatedDeviceList.length > 0) {
166
166
  setDeviceList(updatedDeviceList);
167
167
  }
@@ -327,8 +327,11 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
327
327
  };
328
328
 
329
329
  useEffect(() => {
330
+ // Notify updated state every 20s
331
+ let count = 0;
330
332
  const interval = setInterval(() => {
331
- navigator.mediaDevices.enumerateDevices();
333
+ count = count + 1;
334
+ refreshDeviceList(count % 10 !== 0);
332
335
  }, 2000);
333
336
  return () => {
334
337
  clearInterval(interval);
@@ -550,7 +553,6 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
550
553
  // Port this to useEffectEvent(https://beta.reactjs.org/reference/react/useEffectEvent) when
551
554
  // released
552
555
  useEffect(() => {
553
- log('previous devicelist updated', deviceList);
554
556
  AgoraRTC.onMicrophoneChanged = commonOnChangedEvent;
555
557
  return () => {
556
558
  AgoraRTC.onMicrophoneChanged = null;