mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
* added option to use rtctstats from lib-jitsi-meet * Addressed review feedback: - moved rtcstats function into JitsiMeetJS.rtcstats - changed from callbacks to events * moved rtcstatsUseLibJitsi from analytics to testing * fixed linting errors * use ljm rtcstats * remove debug logs, additional dependencies * fix ts and dependency * address code review --------- Co-authored-by: Nils Ohlmeier <github@ohlmeier.org>
30 lines
906 B
TypeScript
30 lines
906 B
TypeScript
|
|
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));
|
|
}
|