decord/source/lib/VideoSpinnerTimer.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

95 lines
3.7 KiB
TypeScript

// Module ID: 9607
// Function ID: 9608
// Name: map
// Dependencies: [502, 1957, 4609, 4583, 4579, 1074, 3, 4589, 1242, 2]
// Module 9607 (map)
import timestampDefault from "timestamp" /* 3 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 1242 */;
import sleep from "sleep" /* 4589 */;
import closure_3 from "fetchFingerprint" /* 502 */;
import closure_4 from "ensureGuildLoaded" /* 1957 */;
import closure_5 from "handleConnectionInfoChange" /* 4609 */;
import closure_6 from "createRTCConnection" /* 4583 */;
import closure_7 from "updateVoiceState" /* 4579 */;
import { AnalyticEvents } from "ME" /* 1074 */;
require = arg1;
const map = new Map();
let result = require("set").fileFinishedImporting("lib/VideoSpinnerTimer.tsx");
class VideoSpinnerTimer {
constructor(arg0) {
obj = Object.create(new.target.prototype);
tmp2 = new require("timestamp")(global);
obj.logger = tmp2;
return obj;
}
}
const prototype = VideoSpinnerTimer.prototype;
prototype["onSpinnerStarted"] = function onSpinnerStarted() {
if (null == this.spinnerVisibleStart) {
tmp.spinnerVisibleStart = sleep.now();
const obj = sleep;
}
};
prototype["trackSpinnerDuration"] = function trackSpinnerDuration(videoSpinnerContext, userId, arg2) {
const self = this;
if (null != this.spinnerVisibleStart) {
let num = map.get(arg2);
if (num == null) {
num = 0;
}
const sum = num + 1;
const result = map.set(arg2, sum);
let obj = sleep;
const diff = obj.now() - self.spinnerVisibleStart;
self.spinnerVisibleStart = null;
if (diff < 0) {
const logger = self.logger;
const _HermesInternal = HermesInternal;
logger.warn("spinner duration is negative: " + diff + " ms\n [" + videoSpinnerContext + ", count for stream: " + sum + "]");
} else {
const logger2 = self.logger;
const _HermesInternal2 = HermesInternal;
logger2.info("spinner visible for " + diff + " ms\n [" + videoSpinnerContext + ", count for stream: " + sum + "]");
guildId = guildId.getGuildId();
userVoiceChannelId = userVoiceChannelId.getUserVoiceChannelId(guildId, id.getId());
channel = channel.getChannel(userVoiceChannelId);
let str = null;
if (null != channel) {
str = "guild_voice";
if (!channel.isGuildVoice()) {
str = "is_stage_channel";
if (!channel.isGuildStageVoice()) {
str = "dm";
if (!channel.isDM()) {
str = null;
if (channel.isGroupDM()) {
str = "group_dm";
}
}
}
}
}
obj = { video_spinner_context: null, duration_video_spinner_visible_ms: null, rtc_connection_id: null, media_session_id: null, event_count_for_stream: null, guild_id: null, channel_id: null, channel_type: null, spinning_user_id: null, connection_type: null, effective_connection_speed: null, service_provider: null };
obj[0] = videoSpinnerContext;
obj[1] = diff;
obj[2] = guildId.getRTCConnectionId();
obj[3] = guildId.getMediaSessionId();
obj[4] = sum;
obj[5] = guildId;
obj[6] = userVoiceChannelId;
obj[7] = str;
obj[8] = userId;
obj[9] = store.getType();
obj[10] = store.getEffectiveConnectionSpeed();
obj[11] = store.getServiceProvider();
expandEventPropertiesDefault.track(AnalyticEvents.VIDEO_SPINNER_SHOWN_V2, obj);
const obj2 = expandEventPropertiesDefault;
}
const obj4 = map;
}
};
export const VideoSpinnerContext = { SELF_VIDEO: "self_video", SELF_STREAM: "self_stream", REMOTE_VIDEO: "remote_video", REMOTE_STREAM: "remote_stream", CHANGE_VIDEO_BACKGROUND: "change_video_background", REPLAY_VIDEO_STREAM: "replay_video_stream" };
export { VideoSpinnerTimer };