decord/alpha/source/modules/checkpoint/native/useCheckpointMusic.tsx
github-actions c6aa9eb120 chore: update source for alpha 349.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5030.js (118.4 MB)
2026-10-01 06:55:13 +00:00

53 lines
1.4 KiB
TypeScript

// Module ID: 15466
// Function ID: 15467
// Name: useCheckpointMusic
// Dependencies: [19, 17, 15459, 504, 9552, 15467, 2]
// Exports: default
// Module 15466 (useCheckpointMusic)
import _mod17 from "module_17" /* 17 */;
import noop from "module_19" /* 19 */;
import CheckpointStore from "CheckpointStore" /* 15459 */;
import size from "module_2" /* 2 */;
({ useEffect: c3, useRef: closure_4 } = noop);
const AppState = _mod17.AppState;
const result = size.fileFinishedImporting("modules/checkpoint/native/useCheckpointMusic.tsx");
export default function useCheckpointMusic() {
const items = [CheckpointStore];
stateFromStores = stateFromStores(504).useStateFromStores(items, () => CheckpointStore.isMuted);
closure_4(null);
closure_3(() => {
let num = 1;
const obj = stateFromStores(9552);
if (CheckpointStore.isMuted) {
num = 0;
}
const sound = obj.createSound(ref(15467), "vibing_wumpus", num);
ref.current = sound;
sound.loop();
ref = AppState.addEventListener("change", (event) => {
if ("active" === event) {
sound.play();
} else {
sound.pause();
}
});
return () => {
closure_1.remove();
sound.stop();
closure_1.current = null;
};
}, []);
const items1 = [stateFromStores];
closure_3(() => {
if (null != ref.current) {
let num = 1;
if (stateFromStores) {
num = 0;
}
ref.current.volume = num;
}
}, items1);
};