decord/source/modules/go_live/utils/StreamKeyUtils.tsx

54 lines
1.9 KiB
TypeScript
Raw Normal View History

// Module ID: 4626
// Function ID: 4627
// Name: StreamKeyUtils
// Dependencies: [32, 4616, 2]
2026-07-20 16:05:17 +00:00
// Exports: decodeStreamKey, encodeStreamKey, isStreamKey
// Module 4626 (StreamKeyUtils)
import _slicedToArray from "module_32" /* 32 */;
2026-07-20 16:05:17 +00:00
const StreamTypes = fn(4616).StreamTypes;
const size = fn(2);
const result = size.fileFinishedImporting("modules/go_live/utils/StreamKeyUtils.tsx");
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
export const isStreamKey = function isStreamKey(id) {
let tmp = null != id;
2026-07-20 16:05:17 +00:00
if (tmp) {
2026-07-29 08:29:29 +00:00
tmp = id.startsWith(StreamTypes.GUILD) || id.startsWith(StreamTypes.CALL);
const tmp3 = id.startsWith(StreamTypes.GUILD) || id.startsWith(StreamTypes.CALL);
2026-07-20 16:05:17 +00:00
}
return tmp;
};
export const decodeStreamKey = function decodeStreamKey(streamKey) {
const parts = streamKey.split(":");
const first = parts[0];
if (StreamTypes.GUILD === first) {
[obj2.streamType, obj2.guildId, obj2.channelId, obj2.ownerId] = parts;
return { streamType: null, guildId: null, channelId: null, ownerId: null };
2026-07-29 08:29:29 +00:00
} else if (tmp3.CALL === first) {
const obj = { streamType: null, channelId: null, ownerId: null };
[obj.streamType, obj.channelId, obj.ownerId] = parts;
2026-07-20 16:05:17 +00:00
return obj;
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error = new Error("Unknown stream type " + first);
2026-07-20 16:05:17 +00:00
throw error;
}
};
export const encodeStreamKey = function encodeStreamKey(currentUserActiveStream) {
({ streamType, channelId, ownerId } = currentUserActiveStream);
if (StreamTypes.GUILD === streamType) {
const items = [streamType, tmp, channelId, ownerId];
return items.join(":");
2026-07-29 08:29:29 +00:00
} else if (tmp2.CALL === streamType) {
2026-07-20 16:05:17 +00:00
const items1 = [streamType, channelId, ownerId];
return items1.join(":");
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error = new Error("Unknown stream type " + streamType);
2026-07-20 16:05:17 +00:00
throw error;
}
};