Browse Source

makes disableAudioFocus flag generic, so it can be used also from iOS

j8
tmoldovan8x8 4 years ago
parent
commit
751644db16
No account linked to committer's email address

+ 1
- 1
react/features/base/flags/constants.js View File

@@ -11,7 +11,7 @@ export const ADD_PEOPLE_ENABLED = 'add-people.enabled';
11 11
  * Used by apps that do not use Jitsi audio.
12 12
  * Default: disabled (false)
13 13
  */
14
-export const ANDROID_AUDIO_FOCUS_DISABLED = 'android.audio-focus.disabled';
14
+export const AUDIO_FOCUS_DISABLED = 'audio-focus.disabled';
15 15
 
16 16
 /**
17 17
  * Flag indicating if the audio mute button should be displayed.

+ 4
- 4
react/features/mobile/audio-mode/middleware.js View File

@@ -1,5 +1,5 @@
1 1
 // @flow
2
-import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
2
+import { NativeEventEmitter, NativeModules } from 'react-native';
3 3
 
4 4
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
5 5
 import { SET_AUDIO_ONLY } from '../../base/audio-only';
@@ -9,7 +9,7 @@ import {
9 9
     CONFERENCE_JOINED,
10 10
     getCurrentConference
11 11
 } from '../../base/conference';
12
-import { getFeatureFlag, ANDROID_AUDIO_FOCUS_DISABLED } from '../../base/flags';
12
+import { getFeatureFlag, AUDIO_FOCUS_DISABLED } from '../../base/flags';
13 13
 import { MiddlewareRegistry } from '../../base/redux';
14 14
 
15 15
 import { _SET_AUDIOMODE_DEVICES, _SET_AUDIOMODE_SUBSCRIPTIONS } from './actionTypes';
@@ -140,8 +140,8 @@ function _updateAudioMode({ getState }, next, action) {
140 140
     const { enabled: audioOnly } = state['features/base/audio-only'];
141 141
     let mode;
142 142
 
143
-    if (Platform.OS === 'android' && getFeatureFlag(state, ANDROID_AUDIO_FOCUS_DISABLED, false)) {
144
-        mode = AudioMode.DEFAULT;
143
+    if (getFeatureFlag(state, AUDIO_FOCUS_DISABLED, false)) {
144
+        return result;
145 145
     } else if (conference) {
146 146
         mode = audioOnly ? AudioMode.AUDIO_CALL : AudioMode.VIDEO_CALL;
147 147
     } else {

Loading…
Cancel
Save