decord/stable/source/stores/VideoStreamStore.tsx

209 lines
5.7 KiB
TypeScript
Raw Permalink Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 8801
// Function ID: 8802
// Name: VideoStreamStore
2026-10-06 22:12:49 +00:00
// Dependencies: [1086, 4862, 504, 585, 2]
2026-10-06 22:12:49 +00:00
// Module 8801 (VideoStreamStore)
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 585 */;
import Constants from "Constants" /* 1086 */;
import Constants2 from "Constants" /* 4862 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
let closure_4, closure_5;
function makeTimeoutKey(arg0, arg1) {
return "" + arg0 + ":" + arg1;
}
function clearUser(arg0, arg1) {
2026-10-06 22:12:49 +00:00
let tmp = arg2;
if (arg2 === undefined) {
2026-10-06 22:12:49 +00:00
tmp = null;
}
2026-10-06 22:12:49 +00:00
if (null != closure_4[arg0]) {
let tmp15 = arg1;
let tmp3 = arg1;
if (arg1 == null) {
2026-10-06 22:12:49 +00:00
tmp3 = NULL_STRING_GUILD_ID;
}
2026-10-06 22:12:49 +00:00
if (null != closure_4[arg0][tmp3]) {
const _Object = Object;
const values = Object.values(MediaEngineContextTypes);
const iter = values[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
2026-10-06 22:12:49 +00:00
let tmp9 = tmp !== nextResult && null != tmp;
if (!tmp9) {
delete tmp4[tmp6];
let tmp12 = tmp;
let tmp10 = closure_5;
let tmp11 = makeTimeoutKey;
if (tmp == null) {
tmp12 = nextResult;
}
2026-10-06 22:12:49 +00:00
delete tmp10[tmp11(0, tmp12, arg0)];
}
continue;
}
2026-10-06 22:12:49 +00:00
const tmp14 = closure_4[arg0];
if (tmp15 == null) {
tmp15 = NULL_STRING_GUILD_ID;
}
2026-10-06 22:12:49 +00:00
tmp14[tmp15] = closure_4[arg0][tmp3];
}
}
}
const NULL_STRING_GUILD_ID = Constants.NULL_STRING_GUILD_ID;
const MediaEngineContextTypes = Constants2.MediaEngineContextTypes;
let id = null;
let sessionId = null;
2026-10-06 22:12:49 +00:00
const React3 = {};
const hasOwnProperty = {};
const Store = get_initializedDefault.Store;
class VideoStreamStore extends Store {
2026-10-06 22:12:49 +00:00
getStreamId(arg0, arg1) {
let DEFAULT = arg2;
if (arg2 === undefined) {
DEFAULT = MediaEngineContextTypes.DEFAULT;
}
2026-10-06 22:12:49 +00:00
let streamId;
if (closure_4[arg0] != null) {
let tmp4 = arg1;
if (arg1 == null) {
tmp4 = NULL_STRING_GUILD_ID;
}
if (closure_4[arg0][tmp4] != null) {
if (closure_4[arg0][tmp4][DEFAULT] != null) {
streamId = tmp6.streamId;
}
}
}
2026-10-06 22:12:49 +00:00
return streamId;
}
2026-10-06 22:12:49 +00:00
getUserStreamData(userId, guildId, STREAM) {
let DEFAULT = STREAM;
if (STREAM === undefined) {
DEFAULT = MediaEngineContextTypes.DEFAULT;
}
2026-10-06 22:12:49 +00:00
let tmp3;
if (closure_4[userId] != null) {
let tmp4 = guildId;
if (guildId == null) {
tmp4 = NULL_STRING_GUILD_ID;
}
if (closure_4[userId][tmp4] != null) {
tmp3 = tmp5[DEFAULT];
}
}
2026-10-06 22:12:49 +00:00
return tmp3;
}
2026-10-06 22:12:49 +00:00
getTimedoutVideos() {
return closure_5;
}
getTimedoutVideo(arg0, arg1) {
return closure_5["" + arg0 + ":" + arg1];
}
}
const prototype = VideoStreamStore.prototype;
VideoStreamStore.displayName = "VideoStreamStore";
2026-10-06 22:12:49 +00:00
let obj = {
CONNECTION_OPEN: function handleConnectionOpen(user) {
id = user.user.id;
sessionId = user.sessionId;
},
OVERLAY_INITIALIZE: function handleOverlayInitialize(user) {
id = user.user.id;
sessionId = user.sessionId;
},
RTC_CONNECTION_VIDEO: function handleVideo(arg0) {
2026-10-06 22:12:49 +00:00
let context;
let guildId;
let streamId;
let userId;
({ userId, guildId, streamId, context } = arg0);
if (null != streamId) {
2026-10-06 22:12:49 +00:00
if (!(userId in closure_4)) {
closure_4[userId] = {};
}
2026-10-06 22:12:49 +00:00
let tmp7 = guildId;
const tmp6 = closure_4[userId];
if (guildId == null) {
2026-10-06 22:12:49 +00:00
tmp7 = NULL_STRING_GUILD_ID;
}
2026-10-06 22:12:49 +00:00
let obj = tmp6[tmp7];
if (obj == null) {
obj = {};
}
let tmp10 = guildId;
2026-10-06 22:12:49 +00:00
const tmp9 = closure_4[userId];
if (guildId == null) {
tmp10 = NULL_STRING_GUILD_ID;
}
const obj2 = {};
const merged = Object.assign(obj);
const obj3 = { streamId };
obj2[context] = obj3;
2026-10-06 22:12:49 +00:00
tmp9[tmp10] = obj2;
const _HermesInternal = HermesInternal;
2026-10-06 22:12:49 +00:00
delete closure_5["" + context + ":" + userId];
} else {
clearUser(userId, guildId, context);
}
},
VOICE_STATE_UPDATES: function handleVoiceStateUpdates(voiceStates) {
voiceStates = voiceStates.voiceStates;
return voiceStates.reduce((acc, item) => {
2026-10-06 22:12:49 +00:00
let channelId;
let guildId;
let userId;
({ userId, channelId, guildId } = item);
if (null == channelId) {
if (userId === id) {
if (tmp !== sessionId) {
return acc;
} else {
closure_4 = {};
closure_5 = {};
}
}
return true;
}
if (null == channelId) {
let tmp5;
if (closure_4[userId] != null) {
let tmp6 = guildId;
if (guildId == null) {
tmp6 = NULL_STRING_GUILD_ID;
}
tmp5 = tmp4[tmp6];
}
if (null != tmp5) {
clearUser(userId, guildId);
}
}
return acc;
}, false);
},
VIDEO_STREAM_READY_TIMEOUT: function handleVideoStreamReadyTimeout(arg0) {
2026-10-06 22:12:49 +00:00
let mediaContext;
let streamKey;
let userId;
let videoStreamId;
({ userId, mediaContext } = arg0);
({ videoStreamId, streamKey } = arg0);
closure_5["" + mediaContext + ":" + userId] = { videoStreamId, userId, streamKey, mediaContext };
},
2026-10-06 22:12:49 +00:00
CLEAR_VIDEO_STREAM_READY_TIMEOUT: function handleClearVideoStreamTimeout(mediaContext) {
const combined = "" + mediaContext.mediaContext + ":" + mediaContext.userId;
if (null == closure_5[combined]) {
return false;
} else {
2026-10-06 22:12:49 +00:00
delete closure_5[tmp];
}
}
2026-10-06 22:12:49 +00:00
};
const videoStreamStore = new VideoStreamStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("stores/VideoStreamStore.tsx");
export default videoStreamStore;