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.ts 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import _ from 'lodash';
  2. import { MEDIA_TYPE } from '../media/constants';
  3. import { getScreenshareParticipantIds } from '../participants/functions';
  4. import StateListenerRegistry from '../redux/StateListenerRegistry';
  5. import { isLocalTrackMuted } from './functions';
  6. /**
  7. * Notifies when the list of currently sharing participants changes.
  8. */
  9. StateListenerRegistry.register(
  10. /* selector */ state => getScreenshareParticipantIds(state),
  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. );
  20. /**
  21. * Notifies when the local video mute state changes.
  22. */
  23. StateListenerRegistry.register(
  24. /* selector */ state => isLocalTrackMuted(state['features/base/tracks'], MEDIA_TYPE.VIDEO),
  25. /* listener */ (muted, store, previousMuted) => {
  26. if (typeof APP !== 'object') {
  27. return;
  28. }
  29. if (muted !== previousMuted) {
  30. APP.API.notifyVideoMutedStatusChanged(muted);
  31. }
  32. }
  33. );