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.

subscriber.js 680B

123456789101112131415161718192021222324
  1. // @flow
  2. import _ from 'lodash';
  3. import { StateListenerRegistry } from '../../base/redux';
  4. declare var APP: Object;
  5. /**
  6. * Notifies when the list of currently sharing participants changes.
  7. */
  8. StateListenerRegistry.register(
  9. /* selector */ state =>
  10. state['features/base/tracks'].filter(tr => tr.videoType === 'desktop').map(t => t.participantId),
  11. /* listener */ (participantIDs, store, previousParticipantIDs) => {
  12. if (typeof APP !== 'object') {
  13. return;
  14. }
  15. if (!_.isEqual(_.sortBy(participantIDs), _.sortBy(previousParticipantIDs))) {
  16. APP.API.notifySharingParticipantsChanged(participantIDs);
  17. }
  18. }
  19. );