浏览代码

proximity: enable the proximity sensor when the device is set to earpiece

master
Saúl Ibarra Corretgé 6 年前
父节点
当前提交
6616f728f6
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4
    3
      react/features/mobile/proximity/middleware.js

+ 4
- 3
react/features/mobile/proximity/middleware.js 查看文件

7
  * State listener which enables / disables the proximity sensor based on the
7
  * State listener which enables / disables the proximity sensor based on the
8
  * current conference state. If the proximity sensor is enabled, it will dim
8
  * current conference state. If the proximity sensor is enabled, it will dim
9
  * the screen and disable touch controls when an object is nearby. The
9
  * the screen and disable touch controls when an object is nearby. The
10
- * functionality is  enabled when a conference is in audio-only mode.
10
+ * functionality is  enabled when the current audio device is the earpiece.
11
  */
11
  */
12
 StateListenerRegistry.register(
12
 StateListenerRegistry.register(
13
     /* selector */ state => {
13
     /* selector */ state => {
14
-        const { enabled: audioOnly } = state['features/base/audio-only'];
14
+        const { devices } = state['features/mobile/audio-mode'];
15
+        const selectedDevice = devices.filter(d => d.selected)[0];
15
         const conference = getCurrentConference(state);
16
         const conference = getCurrentConference(state);
16
 
17
 
17
-        return Boolean(conference && audioOnly);
18
+        return Boolean(conference && selectedDevice?.type === 'EARPIECE');
18
     },
19
     },
19
     /* listener */ proximityEnabled => _setProximityEnabled(proximityEnabled)
20
     /* listener */ proximityEnabled => _setProximityEnabled(proximityEnabled)
20
 );
21
 );

正在加载...
取消
保存