react-native-track-player icon indicating copy to clipboard operation
react-native-track-player copied to clipboard

[Feature Request] Expose isServiceBound / hasInitialized Bool

Open uzegonemad opened this issue 1 year ago • 2 comments

What is the need and use case of this feature? My app has some observed properties / reactions that fire when the app is launched. It isn't feasible to call this code after setupPlayer() has been called because of past design considerations that are difficult to refactor. This leads to player_not_initialized rejections.

It would be great if the Android isServiceBound and iOS hasInitialized bools were exposed so my code could wait for player setup. I think there was a PR/patch for this in past versions

Describe the ideal solution Add a public function like isPlayerSetup() which returns the related bool.

Describe alternatives you've considered Right now, I have a wrapper function that calls getPlaybackState() and checks for the status of the promise. Returning the state of the bool seems a little cleaner.

How I can Help I can probably work up a PR in the next month or so unless someone beats me to it.

uzegonemad avatar Jan 26 '24 17:01 uzegonemad

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Apr 26 '24 01:04 github-actions[bot]

Still relevant

uzegonemad avatar Apr 26 '24 02:04 uzegonemad

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 26 '24 01:07 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Aug 02 '24 01:08 github-actions[bot]