decord/source/modules/media_engine/trackVideoToggle.tsx

59 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 13297
// Function ID: 13298
2026-07-20 16:05:17 +00:00
// Name: trackVideoToggle
2026-08-25 06:04:03 +00:00
// Dependencies: [676, 13291, 698, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, setVideoToggleAnalyticsParams
2026-08-25 06:04:03 +00:00
// Module 13297 (trackVideoToggle)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
import ME from "ME" /* 676 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
2026-08-25 06:04:03 +00:00
import calculateFps from "calculateFps" /* 13291 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const AnalyticEvents = ME.AnalyticEvents;
const result = set.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-08-24 06:08:38 +00:00
const defaultConfig = calculateFps.VideoHealthManager.defaultConfig;
2026-07-20 16:05:17 +00:00
const featureEnabled = defaultConfig.featureEnabled;
({ windowLength, allowedPoorFpsRatio, fpsThreshold, backoffTimeSec } = defaultConfig);
2026-08-24 06:08:38 +00:00
let obj = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
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-08-24 06:08:38 +00:00
closure_3 = getRTCConnectionId;
closure_4 = getMediaSessionId;
2026-07-20 16:05:17 +00:00
}