Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Dcument AudioPlaybackState.Error codes #2325

Open
eedeebee opened this issue Jun 12, 2024 · 5 comments
Open

[Feature Request] Dcument AudioPlaybackState.Error codes #2325

eedeebee opened this issue Jun 12, 2024 · 5 comments

Comments

@eedeebee
Copy link

eedeebee commented Jun 12, 2024

What is the need and use case of this feature?
I want to capture playback errors (to sentry for example), but some errors are expected under normal conditions of use. In particular, I want to be able to differentiate errors caused by the network being inaccessible as those are interesting to me (content is missing or corrupt or whatever other errors I don't actually know since they aren't documented) per se. There are apis that will tell me when the device is on/off line but coordinating those with rntp will make it challenging and it would be more practical if rntp just documented the errors it sends so I could make a call on what is interesting or not.

Describe the ideal solution
Documentation of the error codes

Describe alternatives you've considered
See above - it would be possible to use some other utility for detecting networking state but coordinating that state with rntp error state and the timing of changes would likely be challenging at best.

** Example **
For example, when I'm calling fetch I can ignore the networking errors this way

if (!(error instanceof TypeError) && (error as Error).name !== "TimeoutError") {    
       Sentry.captureException(error);
}
@lovegaoshi
Copy link
Contributor

i dont think rntp reimplements any of the native errors. so u shiuld consult the native players error constants and diy

@eedeebee
Copy link
Author

eedeebee commented Jun 13, 2024 via email

@lovegaoshi
Copy link
Contributor

cant u just open up xcode/android studio and click though a bunch of function names, and they will land u to what native players used?

but if ud like u can add this to the docs. Android is kotlinaudio -> exoplayer 2, and iOS is swiftaudioex -> AVPlayer. much appreciated. they are somewhat described in the example app's readme.
https://github.com/doublesymmetry/react-native-track-player/tree/main/example

Copy link
Contributor

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 github-actions bot added the Stale label Sep 12, 2024
@eedeebee
Copy link
Author

eedeebee commented Sep 12, 2024 via email

@github-actions github-actions bot removed the Stale label Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants