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.

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // @flow
  2. import { getCurrentConference } from '../base/conference';
  3. import { toState } from '../base/redux';
  4. import ScreenshotCaptureSummary from './ScreenshotCaptureSummary';
  5. /**
  6. * Creates a new instance of ScreenshotCapture.
  7. *
  8. * @param {Object | Function} stateful - The redux store, state, or
  9. * {@code getState} function.
  10. * @returns {Promise<ScreenshotCapture>}
  11. */
  12. export function createScreenshotCaptureSummary(stateful: Object | Function) {
  13. if (!MediaStreamTrack.prototype.getSettings && !MediaStreamTrack.prototype.getConstraints) {
  14. return Promise.reject(new Error('ScreenshotCaptureSummary not supported!'));
  15. }
  16. return new ScreenshotCaptureSummary(toState(stateful));
  17. }
  18. /**
  19. * Get a participant's connection JID given its ID.
  20. *
  21. * @param {Object} state - The redux store state.
  22. * @param {string} participantId - ID of the given participant.
  23. * @returns {string|undefined} - The participant connection JID if found.
  24. */
  25. export function getParticipantJid(state: Object, participantId: string) {
  26. const conference = getCurrentConference(state);
  27. if (!conference) {
  28. return;
  29. }
  30. const participant = conference.getParticipantById(participantId);
  31. if (!participant) {
  32. return;
  33. }
  34. return participant.getJid();
  35. }