snapshot of https://github.com/jitsi/jitsi-meet.git @ fd1749dd28f4138aa80234fc7f311b19aaffa0e7 (2026-09-15)
This commit is contained in:
29
react/features/rtcstats/functions.ts
Normal file
29
react/features/rtcstats/functions.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
import { IStateful } from '../base/app/types';
|
||||
import { toState } from '../base/redux/functions';
|
||||
|
||||
/**
|
||||
* Checks whether rtcstats is enabled or not.
|
||||
*
|
||||
* @param {IStateful} stateful - The redux store or {@code getState} function.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isRTCStatsEnabled(stateful: IStateful) {
|
||||
const state = toState(stateful);
|
||||
const { analytics } = state['features/base/config'];
|
||||
|
||||
return analytics?.rtcstatsEnabled ?? false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the faceLandmarks data can be sent to the rtcstats server.
|
||||
*
|
||||
* @param {IStateful} stateful - The redux store or {@code getState} function.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function canSendFaceLandmarksRTCStatsData(stateful: IStateful): boolean {
|
||||
const state = toState(stateful);
|
||||
const { faceLandmarks } = state['features/base/config'];
|
||||
|
||||
return Boolean(faceLandmarks?.enableRTCStats && isRTCStatsEnabled(state));
|
||||
}
|
||||
Reference in New Issue
Block a user