24 lines
962 B
TypeScript
24 lines
962 B
TypeScript
// Metro module 8065 (f8066).
|
|
import { memo, useRef, useEffect } from "react";
|
|
import { StyleSheet } from "react-native";
|
|
import { useAPNGPlayerControls, APNGPlayer } from "../../../image/native/APNGPlayer.android";
|
|
import { calculateProfileEffectHeight } from "./ProfileEffectUtils";
|
|
const r22 = memo(function({ layerConfig, animate, paused, width, accessibilityLabel, onLoad }) {
|
|
const ref = useRef(null);
|
|
const aPNGPlayerControls = useAPNGPlayerControls(ref);
|
|
useEffect(() => {
|
|
if (animate && !paused) {
|
|
aPNGPlayerControls.play();
|
|
} else {
|
|
aPNGPlayerControls.pause();
|
|
}
|
|
}, [animate, paused, aPNGPlayerControls]);
|
|
return <APNGPlayer ref={ref} url={layerConfig.src} autoplay={false} style={[StyleSheet.absoluteFill, {
|
|
position: "absolute",
|
|
width,
|
|
height: calculateProfileEffectHeight(layerConfig, width),
|
|
opacity: animate ? 1 : 0
|
|
}]} ariaLabel={accessibilityLabel} onLoad={onLoad} />;
|
|
});
|
|
export default r22;
|