jplayer / react-jPlayer

Html5 audio and video player library for React
MIT License
141 stars 30 forks source link

Best way to "Stop" playback? #14

Open jfbloom22 opened 6 years ago

jfbloom22 commented 6 years ago

Intention is to stop playback and reset the playhead back to the beginning. I started off dispatching two actions:

dispatch(actions.setPlayHead(id, .1));
dispatch(actions.pause(id));

This worked the first time I called it but failed subsequent times. See my other issue about this: https://github.com/jplayer/react-jPlayer/issues/13

What ended up working great: dispatch(actions.pause(id, 0));

Is this the best way to "Stop"? Suggestion: Perhaps a built in "Stop" component would be nice.

MartinDawson commented 6 years ago

This is the best way to stop.

A stop method that does this would be useful.