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

55 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 4511
// Function ID: 4512
2026-07-20 16:05:17 +00:00
// Name: isStreamKey
2026-08-27 16:17:25 +00:00
// Dependencies: [32, 4512, 2]
2026-07-20 16:05:17 +00:00
// Exports: decodeStreamKey, encodeStreamKey, isStreamKey
2026-08-27 16:17:25 +00:00
// Module 4511 (isStreamKey)
2026-08-24 06:08:38 +00:00
import closure_0 from "_slicedToArray" /* 32 */;
2026-08-27 16:17:25 +00:00
import { StreamTypes } from "StreamIssueReportReasons" /* 4512 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const result = require("set").fileFinishedImporting("modules/go_live/utils/StreamKeyUtils.tsx");
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 tmp2 = StreamTypes;
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) {
2026-07-29 08:29:29 +00:00
let obj = { streamType: null, guildId: null, channelId: null, ownerId: null };
[obj2[0], obj2[1], obj2[2], obj2[3]] = callback(parts, 4);
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
} else if (tmp3.CALL === first) {
obj = { streamType: null, channelId: null, ownerId: null };
[obj[0], obj[1], obj[2]] = callback(parts, 3);
2026-07-20 16:05:17 +00:00
return obj;
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
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;
2026-08-24 06:08:38 +00:00
error = new Error("Unknown stream type " + streamType);
2026-07-20 16:05:17 +00:00
throw error;
}
};