decord/source/modules/go_live/useStreamError.tsx

49 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 9652
// Function ID: 9653
2026-07-20 16:05:17 +00:00
// Name: useStreamError
// Dependencies: [9628, 9142, 504, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 9652 (useStreamError)
import AVErrorStore from "AVErrorStore" /* 9628 */;
2026-07-23 10:11:24 +00:00
const require = fn;
let closure_3 = { [fn(9142).AVError.STREAM_SOUNDSHARE_FAILED]: 0, [fn(9142).AVError.STREAM_SEND_HIGH_PACKET_LOSS]: 1, [fn(9142).AVError.STREAM_VIEW_HIGH_PACKET_LOSS]: 1, [fn(9142).AVError.STREAM_SEND_LOW_FPS]: 2, [fn(9142).AVError.STREAM_VIEW_LOW_FPS]: 2, [fn(9142).AVError.STREAM_BAD_NETWORK_QUALITY]: 3 };
const size = fn(2);
const result = size.fileFinishedImporting("modules/go_live/useStreamError.tsx");
2026-07-20 16:05:17 +00:00
export default function useStreamError(id) {
id = id.id;
const items = [AVErrorStore];
2026-07-20 16:05:17 +00:00
const items1 = [id];
return id(504).useStateFromStores(items, () => {
const activeErrors = AVErrorStore.getActiveErrors();
2026-07-20 16:05:17 +00:00
const found = Array.from(activeErrors.values()).filter((streamKey) => {
let tmp = "streamKey" in streamKey;
if (tmp) {
tmp = streamKey.streamKey === id;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
tmp = null != closure_2_3[streamKey.type];
2026-07-20 16:05:17 +00:00
}
return tmp;
});
const first = found.sort((arg0, arg1) => {
let num = dependencyMap[arg0.type];
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
let num2 = dependencyMap[arg1.type];
2026-07-29 08:29:29 +00:00
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);
};