mirror of https://github.com/jitsi/jitsi-meet
Merge pull request #1481 from virtuacoplenny/device-picker-settings
fix: open device selection if it is the only available settingpull/1502/head jitsi-meet_1997
commit
4ef84054dc
@ -0,0 +1,40 @@ |
||||
/* globals APP */ |
||||
|
||||
import { openDialog } from '../base/dialog'; |
||||
import JitsiMeetJS from '../base/lib-jitsi-meet'; |
||||
|
||||
import { DeviceSelectionDialog } from './components'; |
||||
|
||||
/** |
||||
* Open DeviceSelectionDialog with a configuration based on the environment's |
||||
* supported abilities. |
||||
* |
||||
* @returns {Function} |
||||
*/ |
||||
export function openDeviceSelectionDialog() { |
||||
return (dispatch, getState) => { |
||||
JitsiMeetJS.mediaDevices.isDeviceListAvailable() |
||||
.then(isDeviceListAvailable => { |
||||
const state = getState(); |
||||
const conference = state['features/base/conference'].conference; |
||||
|
||||
dispatch(openDialog(DeviceSelectionDialog, { |
||||
currentAudioOutputId: APP.settings.getAudioOutputDeviceId(), |
||||
currentAudioTrack: conference.getLocalAudioTrack(), |
||||
currentVideoTrack: conference.getLocalVideoTrack(), |
||||
disableAudioInputChange: |
||||
!JitsiMeetJS.isMultipleAudioInputSupported(), |
||||
disableDeviceChange: !isDeviceListAvailable |
||||
|| !JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(), |
||||
hasAudioPermission: JitsiMeetJS.mediaDevices |
||||
.isDevicePermissionGranted('audio'), |
||||
hasVideoPermission: JitsiMeetJS.mediaDevices |
||||
.isDevicePermissionGranted('video'), |
||||
hideAudioInputPreview: |
||||
!JitsiMeetJS.isCollectingLocalStats(), |
||||
hideAudioOutputSelect: !JitsiMeetJS.mediaDevices |
||||
.isDeviceChangeAvailable('output') |
||||
})); |
||||
}); |
||||
}; |
||||
} |
@ -1 +1,2 @@ |
||||
export * from './actions'; |
||||
export * from './components'; |
||||
|
Loading…
Reference in new issue