chintan9/plyr-react

Player events does not trigger any callbacks

amrtaher1234 opened this issue · 1 comments

Describe the bug
the player events like onPause and onPlay does not trigger anything, I tried to run such events on the provided stackblitz link provided in your README here https://stackblitz.com/edit/react-fpmwns?file=src%2FApp.js and still nothing happens
To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://stackblitz.com/edit/react-fpmwns?file=src%2FApp.js '
  2. Add to the <Plyr/> an event like :
<Plyr onPause={() => alert(1)} onPlay={() => console.log('playing')} />
  1. Click on play and pause the player, inspect the console ( nothing in the output and no alerts shown )

Expected behavior
The events should trigger the callbacks provided to them

Desktop (please complete the following information):

  • Window 10
  • Chrome

Hey, @amrtaher1234 thanks for the report,
Plyr ecosystem overrides the actual video playing system, so the actual HTMLMediaElement won't work as expected.
You can use plyr [Standard Media Events](use https://github.com/sampotts/plyr#standard-media-events) instead.
take a look at our examples in the examples directory
and make sure you are using the latest release for your convention, the stackblitz you sent used the previous version.

We will change the link in the doc in near future, and all PRs are welcomed :)