decord/alpha/source/modules/media_engine/trackVideoToggle.tsx
github-actions 52331fb8ae chore: update source for alpha 349.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5051.js (118.4 MB)
2026-09-30 07:29:52 +00:00

57 lines
2.1 KiB
TypeScript

// Module ID: 13568
// Function ID: 13569
// Name: trackVideoToggle
// Dependencies: [1074, 13562, 1241, 2]
// Exports: default, setVideoToggleAnalyticsParams
// Module 13568 (trackVideoToggle)
import Constants from "Constants" /* 1074 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
import VideoHealthManager from "VideoHealthManager" /* 13562 */;
import size from "module_2" /* 2 */;
const AnalyticEvents = Constants.AnalyticEvents;
const result = size.fileFinishedImporting("modules/media_engine/trackVideoToggle.tsx");
export default function trackVideoToggle(toggled_user_id, video_toggle_reason, is_video_shown) {
const defaultConfig = VideoHealthManager.VideoHealthManager.defaultConfig;
const featureEnabled = defaultConfig.featureEnabled;
({ windowLength, allowedPoorFpsRatio, fpsThreshold, backoffTimeSec } = defaultConfig);
const obj2 = { 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 };
let tmp;
if (global != null) {
tmp = global();
}
obj2.rtc_connection_id = tmp;
let tmp2;
if (require != null) {
tmp2 = require();
}
obj2.media_session_id = tmp2;
let tmp3 = null;
if (featureEnabled) {
tmp3 = windowLength;
}
obj2.video_health_manager_window_length = tmp3;
let tmp4 = null;
if (featureEnabled) {
tmp4 = allowedPoorFpsRatio;
}
obj2.video_health_manager_poor_fps_ratio = tmp4;
let tmp5 = null;
if (featureEnabled) {
tmp5 = fpsThreshold;
}
obj2.video_health_manager_fps_threshold = tmp5;
obj2.is_video_shown = is_video_shown;
let tmp6 = null;
if (featureEnabled) {
tmp6 = backoffTimeSec;
}
obj2.video_health_manager_backoff_time_seconds = tmp6;
AnalyticsUtilsDefault.track(AnalyticEvents.VIDEO_TOGGLED, obj2);
};
export function setVideoToggleAnalyticsParams(getRTCConnectionId, getMediaSessionId) {
global = getRTCConnectionId;
require = getMediaSessionId;
}