makes disableAudioFocus flag generic, so it can be used also from iOS
This commit is contained in:
parent
c508572cc5
commit
751644db16
|
@ -11,7 +11,7 @@ export const ADD_PEOPLE_ENABLED = 'add-people.enabled';
|
|||
* Used by apps that do not use Jitsi audio.
|
||||
* Default: disabled (false)
|
||||
*/
|
||||
export const ANDROID_AUDIO_FOCUS_DISABLED = 'android.audio-focus.disabled';
|
||||
export const AUDIO_FOCUS_DISABLED = 'audio-focus.disabled';
|
||||
|
||||
/**
|
||||
* Flag indicating if the audio mute button should be displayed.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// @flow
|
||||
import { NativeEventEmitter, NativeModules, Platform } from 'react-native';
|
||||
import { NativeEventEmitter, NativeModules } from 'react-native';
|
||||
|
||||
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
|
||||
import { SET_AUDIO_ONLY } from '../../base/audio-only';
|
||||
|
@ -9,7 +9,7 @@ import {
|
|||
CONFERENCE_JOINED,
|
||||
getCurrentConference
|
||||
} from '../../base/conference';
|
||||
import { getFeatureFlag, ANDROID_AUDIO_FOCUS_DISABLED } from '../../base/flags';
|
||||
import { getFeatureFlag, AUDIO_FOCUS_DISABLED } from '../../base/flags';
|
||||
import { MiddlewareRegistry } from '../../base/redux';
|
||||
|
||||
import { _SET_AUDIOMODE_DEVICES, _SET_AUDIOMODE_SUBSCRIPTIONS } from './actionTypes';
|
||||
|
@ -140,8 +140,8 @@ function _updateAudioMode({ getState }, next, action) {
|
|||
const { enabled: audioOnly } = state['features/base/audio-only'];
|
||||
let mode;
|
||||
|
||||
if (Platform.OS === 'android' && getFeatureFlag(state, ANDROID_AUDIO_FOCUS_DISABLED, false)) {
|
||||
mode = AudioMode.DEFAULT;
|
||||
if (getFeatureFlag(state, AUDIO_FOCUS_DISABLED, false)) {
|
||||
return result;
|
||||
} else if (conference) {
|
||||
mode = audioOnly ? AudioMode.AUDIO_CALL : AudioMode.VIDEO_CALL;
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue