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.

1234567891011121314151617181920212223242526272829
  1. import { IStateful } from '../base/app/types';
  2. import { toState } from '../base/redux/functions';
  3. /**
  4. * Checks whether rtcstats is enabled or not.
  5. *
  6. * @param {IStateful} stateful - The redux store or {@code getState} function.
  7. * @returns {boolean}
  8. */
  9. export function isRTCStatsEnabled(stateful: IStateful) {
  10. const state = toState(stateful);
  11. const { analytics } = state['features/base/config'];
  12. return analytics?.rtcstatsEnabled ?? false;
  13. }
  14. /**
  15. * Checks if the faceLandmarks data can be sent to the rtcstats server.
  16. *
  17. * @param {IStateful} stateful - The redux store or {@code getState} function.
  18. * @returns {boolean}
  19. */
  20. export function canSendFaceLandmarksRTCStatsData(stateful: IStateful): boolean {
  21. const state = toState(stateful);
  22. const { faceLandmarks } = state['features/base/config'];
  23. return Boolean(faceLandmarks?.enableRTCStats && isRTCStatsEnabled(state));
  24. }