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.ts 1.0KB

12345678910111213141516171819202122
  1. import { IReduxState } from '../../app/types';
  2. import { getCurrentConference } from '../../base/conference/functions';
  3. import { isAnyDialogOpen } from '../../base/dialog/functions';
  4. import { FULLSCREEN_ENABLED } from '../../base/flags/constants';
  5. import { getFeatureFlag } from '../../base/flags/functions';
  6. import { isLocalVideoTrackDesktop } from '../../base/tracks/functions.any';
  7. /**
  8. * Checks whether full-screen state should be used or not.
  9. *
  10. * @param {IReduxState} state - The redux state.
  11. * @returns {boolean} - Whether full-screen state should be used or not.
  12. */
  13. export function shouldUseFullScreen(state: IReduxState) {
  14. const { enabled: audioOnly } = state['features/base/audio-only'];
  15. const conference = getCurrentConference(state);
  16. const dialogOpen = isAnyDialogOpen(state);
  17. const fullscreenEnabled = getFeatureFlag(state, FULLSCREEN_ENABLED, true);
  18. const isDesktopSharing = isLocalVideoTrackDesktop(state);
  19. return conference ? !audioOnly && !dialogOpen && !isDesktopSharing && fullscreenEnabled : false;
  20. }