You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions.js 1.2KB

12345678910111213141516171819202122232425262728293031
  1. // @flow
  2. import { getAudioOutputDeviceId } from '../base/devices';
  3. import JitsiMeetJS from '../base/lib-jitsi-meet';
  4. import { toState } from '../base/redux';
  5. /**
  6. * Returns the properties for the device selection dialog from Redux state.
  7. *
  8. * @param {(Function|Object)} stateful -The (whole) redux state, or redux's
  9. * {@code getState} function to be used to retrieve the state.
  10. * @returns {Object} - The properties for the device selection dialog.
  11. */
  12. export function getDeviceSelectionDialogProps(stateful: Object | Function) {
  13. const state = toState(stateful);
  14. const settings = state['features/base/settings'];
  15. return {
  16. availableDevices: state['features/base/devices'],
  17. disableAudioInputChange:
  18. !JitsiMeetJS.isMultipleAudioInputSupported(),
  19. disableDeviceChange:
  20. !JitsiMeetJS.mediaDevices.isDeviceChangeAvailable(),
  21. hideAudioInputPreview:
  22. !JitsiMeetJS.isCollectingLocalStats(),
  23. hideAudioOutputSelect: !JitsiMeetJS.mediaDevices
  24. .isDeviceChangeAvailable('output'),
  25. selectedAudioInputId: settings.micDeviceId,
  26. selectedAudioOutputId: getAudioOutputDeviceId(),
  27. selectedVideoInputId: settings.cameraDeviceId
  28. };
  29. }