decord/source/modules/image/native/APNGPlayer.android.tsx

102 lines
2.6 KiB
TypeScript
Raw Normal View History

// Module ID: 8935
// Function ID: 8936
// Name: APNGPlayer
// Dependencies: [19, 21, 8936, 2]
2026-07-20 16:05:17 +00:00
// Exports: useAPNGPlayerControls
// Module 8935 (APNGPlayer)
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const jsx = fn(21).jsx;
const size = fn(2);
const result = size.fileFinishedImporting("modules/image/native/APNGPlayer.android.tsx");
2026-07-20 16:05:17 +00:00
export const useAPNGPlayerControls = function useAPNGPlayerControls(ref) {
2026-08-24 06:08:38 +00:00
closure_0 = ref;
closure_1 = noop.useRef(false);
2026-07-20 16:05:17 +00:00
const items = [ref];
return noop.useMemo(() => ({
2026-07-20 16:05:17 +00:00
play() {
let current = null == closure_1_0.current;
2026-07-20 16:05:17 +00:00
if (!current) {
2026-07-29 08:29:29 +00:00
current = ref.current;
2026-07-20 16:05:17 +00:00
}
if (!current) {
const current2 = closure_1_0.current;
2026-07-20 16:05:17 +00:00
current2.play();
2026-07-29 08:29:29 +00:00
ref.current = true;
2026-07-20 16:05:17 +00:00
}
},
pause() {
let current = null != closure_1_0.current;
2026-07-20 16:05:17 +00:00
if (current) {
2026-07-29 08:29:29 +00:00
current = ref.current;
2026-07-20 16:05:17 +00:00
}
if (current) {
const current2 = closure_1_0.current;
2026-07-20 16:05:17 +00:00
current2.pause();
2026-07-29 08:29:29 +00:00
ref.current = false;
2026-07-20 16:05:17 +00:00
}
},
stop() {
let current = null != closure_1_0.current;
2026-07-20 16:05:17 +00:00
if (current) {
2026-07-29 08:29:29 +00:00
current = ref.current;
2026-07-20 16:05:17 +00:00
}
if (current) {
const current2 = closure_1_0.current;
2026-07-20 16:05:17 +00:00
current2.stop();
2026-07-29 08:29:29 +00:00
ref.current = false;
2026-07-20 16:05:17 +00:00
}
},
seek(arg0) {
if (null != ref.current) {
2026-07-29 08:29:29 +00:00
const current = tmp.current;
2026-07-20 16:05:17 +00:00
current.seek(arg0);
}
}
}), items);
};
export const APNGPlayer = noop.forwardRef((onLoad, ref) => {
onLoad = onLoad.onLoad;
const merged = Object.assign(onLoad, Object.assign({ onLoad: 0 }));
ref = noop.useRef(null);
const items = [onLoad];
const callback = noop.useCallback((nativeEvent) => {
if (onLoad != null) {
tmp(nativeEvent.nativeEvent.url);
}
}, items);
const imperativeHandle = noop.useImperativeHandle(ref, () => ({
play() {
if (null != ref.current) {
const Commands = onLoad(8936).Commands;
Commands.play(tmp.current);
}
},
pause() {
if (null != ref.current) {
const Commands = onLoad(8936).Commands;
Commands.pause(tmp.current);
}
},
stop() {
if (null != ref.current) {
const Commands = onLoad(8936).Commands;
Commands.seek(tmp.current, 0);
const Commands2 = onLoad(8936).Commands;
Commands2.pause(tmp.current);
}
},
seek(arg0) {
if (null != ref.current) {
const Commands = onLoad(8936).Commands;
Commands.seek(tmp.current, arg0);
}
}
}));
const merged1 = Object.assign(merged);
return jsx(ref(8936), { ref, onLoad: callback });
});