I'm using react function component and plyr-react version 3.2.1.
getting error ref.current.plyr.on is not a function
In 3.1.0 and below version it's working fine
Stackblitz Link - https://stackblitz.com/edit/react-vv9haf
CODE
const PlayerView = () => {
const ref = useRef();
useEffect(() => {
ref.current.plyr.on("ended", (event) => {
console.log("ended-event");
})
}, [])
return (
<Plyr
id="player"
options={{ ...options, controls }}
source={src}
ref={ref}
/>
);