-
Notifications
You must be signed in to change notification settings - Fork 853
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
onDurationChanged called constantly on Android #136
Comments
@Kretin1 , that seems to be by design. The method is called every position update. I believe it might be because while the audio buffers the duration might change. Is it causing any problems to you though? If so, we can consider changing that. But it seems to me that you could just not listen to that event hahaha |
@luanpotter I think onDurationChanged should be called just once to know the entire length of the audio. This is how it works even with html5 audio. Also onDurationChanged is not called after setUrl() on android but it is called on ios. Is this something you are looking into? |
I agree. I expected to use onDurationChanged to know when a clip has been loaded or changed. Currently I need to keep my own variable, and check if it's changed... something that I expect would be more efficient if done in the native code. But most importantly, whatever you choose it should not work differently for Android and iOS. |
same problem |
Same here |
+1 |
@luanpotter this discussion is still valid? Is this still something that we want to add? |
What I hear from the comments here, is that an async mechanism is needed to know when the player is ready. |
This should be easy to fix by moving the |
#1460) # Description Unlike on other platforms, onDuration is constantly called on Android. This PR avoids calling onDuration on every position event. OnDuration is still once called with the correct duration after having prepared the source.
This is reported to have been solved in #107 but it's happening to me in 0.10.0.
Also occurring in 0.10.1
The text was updated successfully, but these errors were encountered: