decord/source/modules/clips/clipPayloadUtils.tsx

114 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-08-08 06:10:11 +00:00
// Module ID: 4853
// Function ID: 4854
2026-07-29 08:29:29 +00:00
// Name: getClipCreatedAt
2026-08-08 06:10:11 +00:00
// Dependencies: [32, 4358, 676, 4364, 4854, 698, 4855, 2]
2026-07-20 16:05:17 +00:00
// Exports: getClipCreatedAt, getClipEventsTimeline, getClipParticipantIds
2026-08-08 06:10:11 +00:00
// Module 4853 (getClipCreatedAt)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import result from "result";
import { AnalyticEvents } from "ME";
import { SpeakingFlags } from "DesktopSources";
2026-07-29 08:29:29 +00:00
let c4;
let c5;
2026-08-04 08:36:32 +00:00
let closure_6;
let error;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-04 08:36:32 +00:00
({ CLIPS_MAX_PARTICIPANTS: c4, CLIPS_MAX_TIMELINE_EVENTS: c5, ClipSignalTypes: closure_6, GameEventType: error } = result);
2026-07-23 10:11:24 +00:00
let obj = { UNKNOWN: 0, [0]: "UNKNOWN", KILL: 1, [1]: "KILL", MULTIKILL: 2, [2]: "MULTIKILL", DEATH: 3, [3]: "DEATH" };
result = require("ME").fileFinishedImporting("modules/clips/clipPayloadUtils.tsx");
2026-07-20 16:05:17 +00:00
export const getClipCreatedAt = function getClipCreatedAt(createdAt) {
return new Date(createdAt).toISOString();
};
export const getClipParticipantIds = function getClipParticipantIds(users) {
return users.slice(0, closure_4);
};
export const ServerClipGameEventType = obj;
export const getClipEventsTimeline = function getClipEventsTimeline(clip) {
2026-07-23 10:11:24 +00:00
const _require = clip;
2026-07-20 16:05:17 +00:00
const timeline = clip.timeline;
2026-07-29 08:29:29 +00:00
let num;
if (timeline != null) {
num = timeline.length;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
if (0 !== num) {
const decision = clip.decision;
let timestamp;
2026-07-29 08:29:29 +00:00
if (decision != null) {
2026-07-20 16:05:17 +00:00
timestamp = decision.timestamp;
}
if (null != timestamp) {
let editMetadata = clip.editMetadata;
2026-07-29 08:29:29 +00:00
if (editMetadata == null) {
const obj = { start: 0, end: null };
obj[1] = clip.length / 1000;
2026-07-20 16:05:17 +00:00
editMetadata = obj;
}
const diff = clip.decision.timestamp - clip.length;
2026-07-29 08:29:29 +00:00
const sum = diff + 1000 * editMetadata.end;
const sum1 = diff + 1000 * editMetadata.start;
2026-08-08 06:10:11 +00:00
let closure_1 = _require(4854).isGameEventsOnPlayerEnabled("getClipEventsTimeline");
2026-07-20 16:05:17 +00:00
const timeline1 = clip.timeline;
const found = timeline1.filter((signal) => {
2026-08-04 08:36:32 +00:00
editMetadata = editMetadata.editMetadata;
2026-07-20 16:05:17 +00:00
let voiceAudio;
2026-07-29 08:29:29 +00:00
if (editMetadata != null) {
2026-07-20 16:05:17 +00:00
voiceAudio = editMetadata.voiceAudio;
}
let tmp2 = false !== voiceAudio;
if (tmp2) {
2026-08-04 08:36:32 +00:00
tmp2 = signal.signal.type === outer1_6.SPEAKING;
2026-07-20 16:05:17 +00:00
}
if (!tmp2) {
2026-08-04 08:36:32 +00:00
let tmp4 = closure_1;
2026-07-20 16:05:17 +00:00
if (closure_1) {
2026-08-04 08:36:32 +00:00
tmp4 = signal.signal.type === outer1_6.GAME_EVENT;
2026-07-20 16:05:17 +00:00
}
2026-08-04 08:36:32 +00:00
tmp2 = tmp4;
2026-07-20 16:05:17 +00:00
}
return tmp2;
});
const sorted = found.sort((timestamp, timestamp2) => timestamp.timestamp - timestamp2.timestamp);
if (0 !== sorted.length) {
const _Map = Map;
const map = new Map();
const items = [];
const _Map2 = Map;
2026-07-29 08:29:29 +00:00
new Map();
2026-08-04 08:36:32 +00:00
for (const item10061 of sorted) {
let tmp16 = item10061;
let tmp17 = constants;
let tmp18 = constants;
if (item10061.signal.type !== constants.SPEAKING) {
2026-07-29 08:29:29 +00:00
continue;
} else {
2026-08-04 08:36:32 +00:00
let tmp19 = item10061;
if (tmp16.timestamp >= sum1) {
let tmp23 = obj5;
2026-07-29 08:29:29 +00:00
obj5.return();
2026-07-20 16:05:17 +00:00
break;
} else {
2026-08-04 08:36:32 +00:00
let tmp20 = item10061;
let tmp21 = SpeakingFlags;
let result = map.set(tmp16.signal.userId, (tmp16.signal.speakingFlags & SpeakingFlags.VOICE) === SpeakingFlags.VOICE);
2026-07-20 16:05:17 +00:00
}
break;
}
2026-08-04 08:36:32 +00:00
let tmp25 = map;
2026-07-29 08:29:29 +00:00
let num4 = 2;
2026-08-04 08:36:32 +00:00
let tmp24 = __exception;
tmp10[Symbol.iterator]().return();
throw tmp24;
2026-07-20 16:05:17 +00:00
}
2026-08-04 08:36:32 +00:00
const tmp10 = map;
2026-07-20 16:05:17 +00:00
}
2026-08-08 06:10:11 +00:00
const obj2 = _require(4854);
2026-07-20 16:05:17 +00:00
}
}
};