Animation
Here is an example showing how to start an animation on an element.
import type {
ICraftPlayerInstance,
} from "@icraft/player";
import { ICraftPlayer } from "@icraft/player";
import { useRef } from "react";
export default () => {
const instanceRef = useRef<ICraftPlayerInstance>();
const onReady = ()=>{
const ins = instanceRef.current
const nginx = ins.getElementsByName('Nginx')[0]
nginx.startHeartbeatAnimation();
}
return (
<ICraftPlayer
fileUrl="/docker.iplayer"
ref={instanceRef}
onReady={onReady}
/>
);
};