decord/beta/source/modules/checkpoint/native/useCheckpointMusic.tsx
github-actions 84d017ff78 chore: update source for beta 348.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
2026-09-28 16:18:32 +00:00

53 lines
1.4 KiB
TypeScript

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