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.

12345678910111213141516171819202122232425262728293031323334353637
  1. /* @flow */
  2. declare var interfaceConfig: Object;
  3. import {
  4. getPinnedParticipant
  5. } from '../base/participants';
  6. /**
  7. * A selector for determining whether or not remote video thumbnails should be
  8. * displayed in the filmstrip.
  9. *
  10. * @param {Object} state - The full redux state.
  11. * @returns {boolean} - True if remote video thumbnails should be displayed.
  12. */
  13. export function shouldRemoteVideosBeVisible(state: Object) {
  14. const participants = state['features/base/participants'];
  15. const participantsCount = participants.length;
  16. const pinnedParticipant = getPinnedParticipant(state);
  17. const shouldShowVideos
  18. = participantsCount > 2
  19. // Always show the filmstrip when there is another participant to show
  20. // and the filmstrip is hovered, or local video is pinned, or the
  21. // toolbar is displayed.
  22. || (participantsCount > 1
  23. && (state['features/filmstrip'].hovered
  24. || state['features/toolbox'].visible
  25. || (pinnedParticipant && pinnedParticipant.local)))
  26. || interfaceConfig.filmStripOnly
  27. || state['features/base/config'].disable1On1Mode;
  28. return Boolean(shouldShowVideos);
  29. }