decord/source/modules/go_live/utils/StreamKeyUtils.tsx
github-actions 03cf168fbc chore: update source for alpha 347.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
2026-09-17 08:17:09 +00:00

53 lines
1.9 KiB
TypeScript

// Module ID: 4692
// Function ID: 4693
// Name: StreamKeyUtils
// Dependencies: [32, 4682, 2]
// Exports: decodeStreamKey, encodeStreamKey, isStreamKey
// Module 4692 (StreamKeyUtils)
import _slicedToArray from "module_32" /* 32 */;
const StreamTypes = fn(4682).StreamTypes;
const size = fn(2);
const result = size.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 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) {
[obj2.streamType, obj2.guildId, obj2.channelId, obj2.ownerId] = parts;
return { streamType: null, guildId: null, channelId: null, ownerId: null };
} else if (tmp3.CALL === first) {
const obj = { streamType: null, channelId: null, ownerId: null };
[obj.streamType, obj.channelId, obj.ownerId] = parts;
return obj;
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
const 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;
const error = new Error("Unknown stream type " + streamType);
throw error;
}
};