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

112 lines
3 KiB
TypeScript
Raw Normal View History

// Module ID: 8271
// Function ID: 8272
// Name: APNGPlayer
// Dependencies: [19, 21, 8272, 2]
// Exports: useAPNGPlayerControls
// Module 8271 (APNGPlayer)
2026-10-01 14:13:23 +00:00
import Fragment from "Fragment" /* 21 */;
import react from "react" /* 19 */;
import size from "module_2" /* 2 */;
2026-10-01 14:13:23 +00:00
let onLoad;
2026-10-01 14:13:23 +00:00
const jsx = Fragment.jsx;
const forwardRefResult = react.forwardRef((onLoad, ref) => {
onLoad = onLoad.onLoad;
const merged = Object.assign(onLoad, Object.assign({ onLoad: 0 }));
2026-10-01 14:13:23 +00:00
ref = react.useRef(null);
const items = [onLoad];
2026-10-01 14:13:23 +00:00
const callback = react.useCallback((nativeEvent) => {
if (onLoad != null) {
tmp(nativeEvent.nativeEvent.url);
}
}, items);
2026-10-01 14:13:23 +00:00
const imperativeHandle = react.useImperativeHandle(ref, () => ({
play() {
if (null != ref.current) {
2026-10-01 14:13:23 +00:00
const Commands = onLoad(dependencyMap[2]).Commands;
Commands.play(tmp.current);
}
},
pause() {
if (null != ref.current) {
2026-10-01 14:13:23 +00:00
const Commands = onLoad(dependencyMap[2]).Commands;
Commands.pause(tmp.current);
}
},
stop() {
if (null != ref.current) {
2026-10-01 14:13:23 +00:00
const Commands = onLoad(dependencyMap[2]).Commands;
Commands.seek(ref.current, 0);
const Commands2 = onLoad(dependencyMap[2]).Commands;
Commands2.pause(ref.current);
}
},
seek(arg0) {
if (null != ref.current) {
2026-10-01 14:13:23 +00:00
const Commands = onLoad(dependencyMap[2]).Commands;
Commands.seek(tmp.current, arg0);
}
}
}));
2026-10-01 14:13:23 +00:00
ref(8272);
const merged1 = Object.assign(merged);
2026-10-01 14:13:23 +00:00
return <tmp5 ref={ref} onLoad={callback} />;
});
2026-10-01 14:13:23 +00:00
const result = size.fileFinishedImporting("modules/image/native/APNGPlayer.android.tsx");
export const useAPNGPlayerControls = function useAPNGPlayerControls(ref) {
let closure_0 = ref;
let closure_1 = react.useRef(false);
const items = [ref];
return react.useMemo(() => {
let ref;
return {
play() {
let current = null == closure_1_0.current;
const tmp = closure_1_0;
if (!current) {
current = ref.current;
}
if (!current) {
const current2 = tmp.current;
current2.play();
ref.current = true;
}
},
pause() {
let current = null != closure_1_0.current;
const tmp = closure_1_0;
if (current) {
current = ref.current;
}
if (current) {
const current2 = tmp.current;
current2.pause();
ref.current = false;
}
},
stop() {
let current = null != closure_1_0.current;
const tmp = closure_1_0;
if (current) {
current = ref.current;
}
if (current) {
const current2 = tmp.current;
current2.stop();
ref.current = false;
}
},
seek(arg0) {
if (null != closure_1_0.current) {
const current = tmp.current;
current.seek(arg0);
}
}
};
}, items);
};
export const APNGPlayer = forwardRefResult;