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.web.js 1.9KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. // @flow
  2. import {
  3. getParticipantCount,
  4. getPinnedParticipant
  5. } from '../base/participants';
  6. import { toState } from '../base/redux';
  7. declare var interfaceConfig: Object;
  8. /**
  9. * Returns true if the filmstrip on mobile is visible, false otherwise.
  10. *
  11. * NOTE: Filmstrip on web behaves differently to mobile, much simpler, but so
  12. * function lies here only for the sake of consistency and to avoid flow errors
  13. * on import.
  14. *
  15. * @param {Object | Function} stateful - The Object or Function that can be
  16. * resolved to a Redux state object with the toState function.
  17. * @returns {boolean}
  18. */
  19. export function isFilmstripVisible(stateful: Object | Function) {
  20. return toState(stateful)['features/filmstrip'].visible;
  21. }
  22. /**
  23. * Determines whether the remote video thumbnails should be displayed/visible in
  24. * the filmstrip.
  25. *
  26. * @param {Object} state - The full redux state.
  27. * @returns {boolean} - If remote video thumbnails should be displayed/visible
  28. * in the filmstrip, then {@code true}; otherwise, {@code false}.
  29. */
  30. export function shouldRemoteVideosBeVisible(state: Object) {
  31. if (state['features/invite'].calleeInfoVisible) {
  32. return false;
  33. }
  34. const participantCount = getParticipantCount(state);
  35. let pinnedParticipant;
  36. return Boolean(
  37. participantCount > 2
  38. // Always show the filmstrip when there is another participant to
  39. // show and the filmstrip is hovered, or local video is pinned, or
  40. // the toolbar is displayed.
  41. || (participantCount > 1
  42. && (state['features/filmstrip'].hovered
  43. || state['features/toolbox'].visible
  44. || ((pinnedParticipant = getPinnedParticipant(state))
  45. && pinnedParticipant.local)))
  46. || (typeof interfaceConfig === 'object'
  47. && interfaceConfig.filmStripOnly)
  48. || state['features/base/config'].disable1On1Mode);
  49. }