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.

actions.ts 753B

12345678910111213141516171819202122232425
  1. import { openDialog } from '../base/dialog/actions';
  2. import { DesktopSharingSourceType } from '../base/tracks/types';
  3. import DesktopPicker from './components/DesktopPicker';
  4. type Options = {
  5. desktopSharingSources?: Array<DesktopSharingSourceType>;
  6. };
  7. /**
  8. * Signals to open a dialog with the DesktopPicker component.
  9. *
  10. * @param {Object} options - Desktop sharing settings.
  11. * @param {Function} onSourceChoose - The callback to invoke when
  12. * a DesktopCapturerSource has been chosen.
  13. * @returns {Object}
  14. */
  15. export function showDesktopPicker(options: Options = {}, onSourceChoose: Function) {
  16. const { desktopSharingSources } = options;
  17. return openDialog(DesktopPicker, {
  18. desktopSharingSources,
  19. onSourceChoose
  20. });
  21. }