Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

subscriber.web.js 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // @flow
  2. import VideoLayout from '../../../modules/UI/videolayout/VideoLayout';
  3. import { StateListenerRegistry } from '../base/redux';
  4. import { getVideoTrackByParticipant } from '../base/tracks';
  5. import { getLargeVideoParticipant } from './functions';
  6. /**
  7. * Updates the on stage participant video.
  8. */
  9. StateListenerRegistry.register(
  10. /* selector */ state => state['features/large-video'].participantId,
  11. /* listener */ participantId => {
  12. VideoLayout.updateLargeVideo(participantId, true);
  13. }
  14. );
  15. /**
  16. * Schedules a large video update when the streaming status of the track associated with the large video changes.
  17. */
  18. StateListenerRegistry.register(
  19. /* selector */ state => {
  20. const largeVideoParticipant = getLargeVideoParticipant(state);
  21. const videoTrack = getVideoTrackByParticipant(state, largeVideoParticipant);
  22. return {
  23. participantId: largeVideoParticipant?.id,
  24. streamingStatus: videoTrack?.streamingStatus
  25. };
  26. },
  27. /* listener */ ({ participantId, streamingStatus }, previousState = {}) => {
  28. if (streamingStatus !== previousState.streamingStatus) {
  29. VideoLayout.updateLargeVideo(participantId, true);
  30. }
  31. }, {
  32. deepEquals: true
  33. }
  34. );