decord/source/modules/errors/hooks/useVideoReadyTimeout.tsx

61 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-31 15:47:37 +00:00
// Module ID: 9538
// Function ID: 9539
2026-07-20 16:05:17 +00:00
// Name: useVideoReadyTimeout
2026-08-31 15:47:37 +00:00
// Dependencies: [19, 687, 4332, 9537, 4547, 9539, 9542, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-31 15:47:37 +00:00
// Module 9538 (useVideoReadyTimeout)
2026-08-24 06:08:38 +00:00
import setDefault from "set" /* 687 */;
import closure_2 from "noop" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
let closure_3 = 20 * setDefault.Millis.SECOND;
let result = require("set").fileFinishedImporting("modules/errors/hooks/useVideoReadyTimeout.tsx");
2026-07-20 16:05:17 +00:00
export default function useVideoReadyTimeout(streamId) {
streamId = streamId.streamId;
const userId = streamId.userId;
({ videoSpinnerContext, streamKey } = streamId);
const loading = streamId.loading;
let flag = streamId.paused;
if (flag === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
closure_5 = undefined;
2026-07-20 16:05:17 +00:00
let STREAM;
2026-07-29 08:29:29 +00:00
let obj = streamKey;
2026-07-23 10:11:24 +00:00
const timeout = new streamId(userId[2]).Timeout();
closure_5 = streamKey.useRef(timeout);
if (videoSpinnerContext !== streamId(userId[3]).VideoSpinnerContext.SELF_STREAM) {
2026-07-29 08:29:29 +00:00
if (videoSpinnerContext !== tmp(tmp2[3]).VideoSpinnerContext.REMOTE_STREAM) {
STREAM = tmp(tmp2[4]).MediaEngineContextTypes.DEFAULT;
2026-07-20 16:05:17 +00:00
}
const items = [flag, streamId, loading, STREAM, streamKey, userId];
2026-07-29 08:29:29 +00:00
const effect = obj.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (loading) {
if (!flag) {
const WindowVisibilityVideoManager = streamId(userId[5]).WindowVisibilityVideoManager;
if (WindowVisibilityVideoManager.isIncomingVideoEnabled()) {
const current = ref.current;
current.start(loading, () => {
2026-08-24 06:08:38 +00:00
current(closure_1_1[6]).videoStreamTimedOut(current, closure_1, closure_6, closure_2);
2026-07-20 16:05:17 +00:00
});
return () => {
current.stop();
};
}
}
}
}, items);
2026-07-29 08:29:29 +00:00
obj = { onReady: null };
2026-07-20 16:05:17 +00:00
const items1 = [userId, STREAM];
2026-07-29 08:29:29 +00:00
obj[0] = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
const current = ref.current;
current.stop();
const result = streamId(userId[6]).clearVideoStreamTimeout(STREAM, userId);
}, items1);
return obj;
}
2026-07-29 08:29:29 +00:00
STREAM = tmp(tmp2[4]).MediaEngineContextTypes.STREAM;
2026-07-20 16:05:17 +00:00
};