您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { VIDEO_MUTISM_AUTHORITY } from './constants';
  2. /**
  3. * Determines whether a specific videoTrack should be rendered.
  4. *
  5. * @param {Track} videoTrack - The video track which is to be rendered.
  6. * @param {boolean} waitForVideoStarted - True if the specified videoTrack
  7. * should be rendered only after its associated video has started;
  8. * otherwise, false.
  9. * @returns {boolean} True if the specified videoTrack should be renderd;
  10. * otherwise, false.
  11. */
  12. export function shouldRenderVideoTrack(videoTrack, waitForVideoStarted) {
  13. return (
  14. videoTrack
  15. && !videoTrack.muted
  16. && (!waitForVideoStarted || videoTrack.videoStarted));
  17. }
  18. /**
  19. * Checks if video is currently muted by the audio-only authority.
  20. *
  21. * @param {Object} store - The redux store instance.
  22. * @returns {boolean}
  23. */
  24. export function isVideoMutedByAudioOnly({ getState }) {
  25. return Boolean(
  26. getState()['features/base/media'] // eslint-disable-line no-bitwise
  27. .video.muted & VIDEO_MUTISM_AUTHORITY.AUDIO_ONLY);
  28. }
  29. /**
  30. * Checks if video is currently muted by the user authority.
  31. *
  32. * @param {Object} store - The redux store instance.
  33. * @returns {boolean}
  34. */
  35. export function isVideoMutedByUser({ getState }) {
  36. return Boolean(
  37. getState()['features/base/media'] // eslint-disable-line no-bitwise
  38. .video.muted & VIDEO_MUTISM_AUTHORITY.USER);
  39. }