decord/alpha/source/modules/checkpoint/native/useCheckpointMusic.tsx
github-actions 6eea20b8e1 chore: update source for alpha 348.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-24 10:59:02 +00:00

53 lines
1.4 KiB
TypeScript

// Module ID: 16053
// Function ID: 16054
// Name: useCheckpointMusic
// Dependencies: [19, 17, 16046, 504, 10249, 16054, 2]
// Exports: default
// Module 16053 (useCheckpointMusic)
import _mod17 from "module_17" /* 17 */;
import noop from "module_19" /* 19 */;
import CheckpointStore from "CheckpointStore" /* 16046 */;
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(10249);
if (CheckpointStore.isMuted) {
num = 0;
}
const sound = obj.createSound(ref(16054), "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);
};