decord/source/modules/go_live/utils/StreamKeyUtils.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

54 lines
1.9 KiB
TypeScript

// Module ID: 4612
// Function ID: 4613
// Name: isStreamKey
// Dependencies: [32, 4602, 2]
// Exports: decodeStreamKey, encodeStreamKey, isStreamKey
// Module 4612 (isStreamKey)
import closure_0 from "_slicedToArray" /* 32 */;
import { StreamTypes } from "StreamIssueReportReasons" /* 4602 */;
const result = require("set").fileFinishedImporting("modules/go_live/utils/StreamKeyUtils.tsx");
export const isStreamKey = function isStreamKey(id) {
let tmp = null != id;
if (tmp) {
tmp = id.startsWith(StreamTypes.GUILD) || id.startsWith(StreamTypes.CALL);
const tmp2 = StreamTypes;
const tmp3 = id.startsWith(StreamTypes.GUILD) || id.startsWith(StreamTypes.CALL);
}
return tmp;
};
export const decodeStreamKey = function decodeStreamKey(streamKey) {
const parts = streamKey.split(":");
const first = parts[0];
if (StreamTypes.GUILD === first) {
let obj = { streamType: null, guildId: null, channelId: null, ownerId: null };
[obj2[0], obj2[1], obj2[2], obj2[3]] = callback(parts, 4);
return obj;
} else if (tmp3.CALL === first) {
obj = { streamType: null, channelId: null, ownerId: null };
[obj[0], obj[1], obj[2]] = callback(parts, 3);
return obj;
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
error = new Error("Unknown stream type " + first);
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(":");
} else if (tmp2.CALL === streamType) {
const items1 = [streamType, channelId, ownerId];
return items1.join(":");
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
error = new Error("Unknown stream type " + streamType);
throw error;
}
};