mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-12 07:42:30 +00:00
This commit refactors device selection (more heavily on iOS) to make it consistent across platforms. Due to its complexity I couldn't break out each step into separate commits, apologies to the reviewer. Changes made to device handling: - speaker is always the default, regardless of the mode - "Phone" shows as a selectable option, even in video call mode - "Phone" is not displayed when wired headphones are present - Shared device picker between iOS and Android - Runtime device updates while the picker is open
29 lines
691 B
JavaScript
29 lines
691 B
JavaScript
// @flow
|
|
|
|
import { equals, set, ReducerRegistry } from '../../base/redux';
|
|
|
|
import { _SET_AUDIOMODE_DEVICES, _SET_AUDIOMODE_SUBSCRIPTIONS } from './actionTypes';
|
|
|
|
const DEFAULT_STATE = {
|
|
devices: [],
|
|
subscriptions: []
|
|
};
|
|
|
|
ReducerRegistry.register('features/mobile/audio-mode', (state = DEFAULT_STATE, action) => {
|
|
switch (action.type) {
|
|
case _SET_AUDIOMODE_DEVICES: {
|
|
const { devices } = action;
|
|
|
|
if (equals(state.devices, devices)) {
|
|
return state;
|
|
}
|
|
|
|
return set(state, 'devices', devices);
|
|
}
|
|
case _SET_AUDIOMODE_SUBSCRIPTIONS:
|
|
return set(state, 'subscriptions', action.subscriptions);
|
|
}
|
|
|
|
return state;
|
|
});
|