Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

subscriber.js 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // @flow
  2. import {
  3. getParticipantById,
  4. getVirtualScreenshareParticipantByOwnerId,
  5. getVirtualScreenshareParticipantOwnerId
  6. } from '../base/participants';
  7. import { StateListenerRegistry } from '../base/redux';
  8. import { pause, resume } from './actions';
  9. /**
  10. * Listens for large video participant ID changes.
  11. */
  12. StateListenerRegistry.register(
  13. /* selector */ state => {
  14. const { participantId } = state['features/large-video'];
  15. const { controller } = state['features/remote-control'];
  16. const { controlled } = controller;
  17. if (!controlled) {
  18. return undefined;
  19. }
  20. const participant = getParticipantById(state, participantId);
  21. if (participant?.isVirtualScreenshareParticipant) {
  22. // multistream support is enabled and the user has selected the desktop sharing thumbnail.
  23. const id = getVirtualScreenshareParticipantOwnerId(participantId);
  24. return id === controlled;
  25. }
  26. const virtualParticipant = getVirtualScreenshareParticipantByOwnerId(state, participantId);
  27. if (virtualParticipant) { // multistream is enabled and the user has selected the camera thumbnail.
  28. return false;
  29. }
  30. return controlled === participantId;
  31. },
  32. /* listener */ (isControlledParticipantOnStage, { dispatch }) => {
  33. if (isControlledParticipantOnStage === true) {
  34. dispatch(resume());
  35. } else if (isControlledParticipantOnStage === false) {
  36. dispatch(pause());
  37. }
  38. // else {
  39. // isControlledParticipantOnStage === undefined. Ignore!
  40. // }
  41. }
  42. );