alexanderwallin / react-player-controls

⏯ Dumb and (re)useful React components for media players.
http://alexanderwallin.github.io/react-player-controls/
ISC License
191 stars 35 forks source link

Is it possible to pause video on time marker? #34

Closed seleckis closed 6 years ago

seleckis commented 6 years ago

I need some event like onEnter for TimeMarker when I can pause the video. Is it possible right now? Or it is not the purpose the library is made for?

alexanderwallin commented 6 years ago

Hi @seleckis! I'm not sure I understand what you need to do. Could you explain it more in depth?

seleckis commented 6 years ago

I have a video which should start to play on some trigger (I use react-waypoint to catch the moment when user scrolls to some point). But it should pause after 10 second. Then scroll again and play more 10 seconds. And so on. I could set TimeMarkers for these 10 or whatever seconds episodes, but how can I play/pause video on them? I know there is a timeupdate event which could be used for checking current time (here is an example), would be great to implement something similar in your library.

Simples workaround is to set ref and use timeupdate event which I have mentioned, but it is not react-way.

alexanderwallin commented 6 years ago

I see! This library does not deal with any actual audio or video playback, it merely provides a set of handy UI components to build the interface with.

Good luck with your app!