Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

functions.web.js 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. const participantCount = getParticipantCount(state);
  32. let pinnedParticipant;
  33. return Boolean(
  34. participantCount > 2
  35. // Always show the filmstrip when there is another participant to
  36. // show and the filmstrip is hovered, or local video is pinned, or
  37. // the toolbar is displayed.
  38. || (participantCount > 1
  39. && (state['features/filmstrip'].hovered
  40. || state['features/toolbox'].visible
  41. || ((pinnedParticipant = getPinnedParticipant(state))
  42. && pinnedParticipant.local)))
  43. || (typeof interfaceConfig === 'object'
  44. && interfaceConfig.filmStripOnly)
  45. || state['features/base/config'].disable1On1Mode);
  46. }