chintan9 / plyr-react

A simple, accessible and customisable react media player for Video, Audio, YouTube and Vimeo
https://github.com/chintan9/plyr-react
MIT License
473 stars 52 forks source link

Event handlers not working at all #1059

Open saidarshan27 opened 1 year ago

saidarshan27 commented 1 year ago

Event hadnlers like onPlay, onClick, onPause not working at all. I tried to reproduce it in a codesandbox.

import "./styles.css";
import Plyr from "plyr-react";
import "plyr-react/plyr.css";

export default function App() {
  return (
    <Plyr
      type="youtube"
      videoId="umldliRDefQ"
      onPlay={() => console.log("playing")}
      onClick={() => {
        console.log("clicking");
      }}
    />
  );
}

Steps to reproduce the behavior:

  1. Go to (https://codesandbox.io/s/recursing-morning-b1mk1t?file=/src/App.js

Expected behavior I want a callback to be run onPlay, onPause, onSeek to attach custom handlers.

[https://stackoverflow.com/questions/76065265/plyr-react-event-callbacks-not-working-at-all](stackoverflow question)

metacoding commented 1 year ago

Yes I confirm this issue exists, a few handlers work others don't