decord/source/modules/go_live/useStreamError.tsx

48 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 9549
// Function ID: 9550
2026-07-20 16:05:17 +00:00
// Name: useStreamError
// Dependencies: [9525, 9039, 586, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 9549 (useStreamError)
import closure_2 from "isAVErrorContextOfType" /* 9525 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
let closure_3 = { [arg1(9039).AVError.STREAM_SOUNDSHARE_FAILED]: 0, [arg1(9039).AVError.STREAM_SEND_HIGH_PACKET_LOSS]: 1, [arg1(9039).AVError.STREAM_VIEW_HIGH_PACKET_LOSS]: 1, [arg1(9039).AVError.STREAM_SEND_LOW_FPS]: 2, [arg1(9039).AVError.STREAM_VIEW_LOW_FPS]: 2, [arg1(9039).AVError.STREAM_BAD_NETWORK_QUALITY]: 3 };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/go_live/useStreamError.tsx");
2026-07-20 16:05:17 +00:00
export default function useStreamError(id) {
id = id.id;
2026-08-24 06:08:38 +00:00
const items = [closure_2];
2026-07-20 16:05:17 +00:00
const items1 = [id];
2026-09-02 09:53:35 +00:00
return id(586).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const activeErrors = closure_1_2.getActiveErrors();
2026-07-20 16:05:17 +00:00
const found = Array.from(activeErrors.values()).filter((streamKey) => {
let tmp = "streamKey" in streamKey;
if (tmp) {
2026-07-29 08:29:29 +00:00
tmp = streamKey.streamKey === closure_0;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-08-24 06:08:38 +00:00
tmp = null != closure_1_3[streamKey.type];
2026-07-20 16:05:17 +00:00
}
return tmp;
});
const first = found.sort((arg0, arg1) => {
2026-07-29 08:29:29 +00:00
let num = table[arg0.type];
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num2 = table[arg1.type];
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
return num - num2;
})[0];
let type;
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-20 16:05:17 +00:00
type = first.type;
}
return type;
}, items1);
};