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.

AbstractUserMediaPermissionsOverlay.ts 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import { Component } from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { IReduxState } from '../../../app/types';
  4. /**
  5. * The type of the React {@code Component} props of
  6. * {@link AbstractUserMediaPermissionsOverlay}.
  7. */
  8. interface IProps extends WithTranslation {
  9. _premeetingBackground?: any;
  10. /**
  11. * The browser which is used currently. The text is different for every
  12. * browser.
  13. */
  14. browser?: string;
  15. }
  16. /**
  17. * Implements a React {@link Component} for overlay with guidance how to proceed
  18. * with gUM prompt.
  19. */
  20. export default class AbstractUserMediaPermissionsOverlay
  21. extends Component<IProps> {
  22. /**
  23. * Determines whether this overlay needs to be rendered (according to a
  24. * specific redux state). Called by {@link OverlayContainer}.
  25. *
  26. * @param {Object} state - The redux state.
  27. * @returns {boolean} - If this overlay needs to be rendered, {@code true};
  28. * {@code false}, otherwise.
  29. */
  30. static needsRender(state: IReduxState) {
  31. return state['features/overlay'].isMediaPermissionPromptVisible;
  32. }
  33. }
  34. /**
  35. * Maps (parts of) the redux state to the associated component's props.
  36. *
  37. * @param {Object} state - The redux state.
  38. * @protected
  39. * @returns {{
  40. * browser: string
  41. * }}
  42. */
  43. export function abstractMapStateToProps(state: IReduxState) {
  44. const { browser } = state['features/overlay'];
  45. return {
  46. browser
  47. };
  48. }