react-native-sound icon indicating copy to clipboard operation
react-native-sound copied to clipboard

Inconsistent callback interface issue while adding `isPlaying()` interface

Open ohtangza opened this issue 8 years ago • 1 comments

Our team recently is working on adding isPlaying() function by having _isPlaying global variable in JS side. However, we encountered an issue.

  • play() has onEnd callback which is fired after playback.
  • pause and stop() accepts a callback function which is fired immediately after the order has been processed.

This means that play() does not have the same callback interface as pause() and stop() for its first parameter, which hinders us to decide when to manipulate _isPlayingvariable. Our team wants to make the_isPlayingvariable true after the actual native logic process theplayorder. In case of Android, this would beplayer.start();`.

If we add a second callback parameter for play(onEnd, callback), would it be accepted for a pull request? We are using react-native-sound heavily on our production code, so we really want to add this function for better timing control of this library.

ohtangza avatar Dec 31 '17 15:12 ohtangza