mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-17 11:37:48 +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
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
// @flow
|
|
|
|
import { openDialog } from '../../../base/dialog';
|
|
import { translate } from '../../../base/i18n';
|
|
import { connect } from '../../../base/redux';
|
|
import { AbstractButton } from '../../../base/toolbox';
|
|
import type { AbstractButtonProps } from '../../../base/toolbox';
|
|
|
|
import AudioRoutePickerDialog from './AudioRoutePickerDialog';
|
|
|
|
|
|
type Props = AbstractButtonProps & {
|
|
|
|
/**
|
|
* The redux {@code dispatch} function used to open/show the
|
|
* {@code AudioRoutePickerDialog}.
|
|
*/
|
|
dispatch: Function
|
|
};
|
|
|
|
/**
|
|
* A toolbar button which triggers an audio route picker when pressed.
|
|
*/
|
|
class AudioRouteButton extends AbstractButton<Props, *> {
|
|
accessibilityLabel = 'toolbar.accessibilityLabel.audioRoute';
|
|
iconName = 'icon-volume';
|
|
label = 'toolbar.audioRoute';
|
|
|
|
/**
|
|
* Handles clicking / pressing the button, and opens the appropriate dialog.
|
|
*
|
|
* @private
|
|
* @returns {void}
|
|
*/
|
|
_handleClick() {
|
|
this.props.dispatch(openDialog(AudioRoutePickerDialog));
|
|
}
|
|
}
|
|
|
|
export default translate(connect()(AudioRouteButton));
|