decord/source/modules/media_engine/trackVideoToggle.tsx

59 lines
1.8 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 13102
// Function ID: 13103
2026-07-20 16:05:17 +00:00
// Name: trackVideoToggle
2026-08-15 05:55:55 +00:00
// Dependencies: [676, 13096, 698, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, setVideoToggleAnalyticsParams
2026-08-15 05:55:55 +00:00
// Module 13102 (trackVideoToggle)
2026-07-23 10:11:24 +00:00
import { AnalyticEvents } from "ME";
2026-07-29 08:29:29 +00:00
const result = require("expandEventProperties").fileFinishedImporting("modules/media_engine/trackVideoToggle.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default function trackVideoToggle(toggled_user_id, video_toggle_reason) {
2026-07-20 16:05:17 +00:00
let allowedPoorFpsRatio;
let backoffTimeSec;
let fpsThreshold;
let windowLength;
2026-08-15 05:55:55 +00:00
const defaultConfig = require(13096) /* calculateFps */.VideoHealthManager.defaultConfig;
2026-07-20 16:05:17 +00:00
const featureEnabled = defaultConfig.featureEnabled;
({ windowLength, allowedPoorFpsRatio, fpsThreshold, backoffTimeSec } = defaultConfig);
2026-07-29 08:29:29 +00:00
let obj = importDefault(698);
obj = { video_toggle_reason, toggled_user_id, rtc_connection_id: null, media_session_id: null, video_health_manager_window_length: null, video_health_manager_poor_fps_ratio: null, video_health_manager_fps_threshold: null, is_video_shown: null, video_health_manager_backoff_time_seconds: null };
2026-07-20 16:05:17 +00:00
let tmp;
2026-07-29 08:29:29 +00:00
if (callback != null) {
2026-07-20 16:05:17 +00:00
tmp = callback();
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp;
let tmp2;
if (callback2 != null) {
tmp2 = callback2();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp2;
let tmp3 = null;
2026-07-20 16:05:17 +00:00
if (featureEnabled) {
2026-07-29 08:29:29 +00:00
tmp3 = windowLength;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = tmp3;
let tmp4 = null;
2026-07-20 16:05:17 +00:00
if (featureEnabled) {
2026-07-29 08:29:29 +00:00
tmp4 = allowedPoorFpsRatio;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[5] = tmp4;
let tmp5 = null;
2026-07-20 16:05:17 +00:00
if (featureEnabled) {
2026-07-29 08:29:29 +00:00
tmp5 = fpsThreshold;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[6] = tmp5;
obj[7] = arg2;
let tmp6 = null;
2026-07-20 16:05:17 +00:00
if (featureEnabled) {
2026-07-29 08:29:29 +00:00
tmp6 = backoffTimeSec;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[8] = tmp6;
2026-07-20 16:05:17 +00:00
obj.track(AnalyticEvents.VIDEO_TOGGLED, obj);
};
export function setVideoToggleAnalyticsParams(getRTCConnectionId, getMediaSessionId) {
2026-07-23 10:11:24 +00:00
let closure_3 = getRTCConnectionId;
let closure_4 = getMediaSessionId;
2026-07-20 16:05:17 +00:00
}