|-- flutter_sound 6.1.4
| |-- flutter_sound_platform_interface 1.0.0
onProgress.listen(e) never being triggered
Android Emulator (Pixel_2_API_29)
Describe the bug
When setting the value of the StreamSubscription to listen to the progress of the player. The listener never seems to be called. This only happened when I switched from version 4.0.6 to 6.1.4 which required me to no longer use onPlayerStateChanged but to replace it with onProgress.
To Reproduce
playerSubscription = playerModule.onProgress.listen((event) {
print('$event');
});
This isn't printing the event.
I saw this was already raised as an issue here https://github.com/dooboolab/flutter_sound/issues/473 but seemed to lack information so I decided to make this issue.
When do you call setSubscriptionDuration() ? Before or after startPlayer() ?
What value for the setSubscriptionDuration() parameter ?
I was not setting it at all.
I just tried setting it before calling startPlayer() with a value of 10 ms as the parameter and it's working! Thank you!
This is not OK that it works on iOS and not Android when setSubscription() is not called. It should be same on both devices.
I will fix that.
Also, I am considering let the verb setSubscriptionDuration() deprecated.
I think it will be less error prone for the developer if it is a parameter for StartPlayer() and not a separated verb.
And also the documentation must be accurate. I think the actual documentation is incorrect.
Most helpful comment
This is not OK that it works on iOS and not Android when
setSubscription()is not called. It should be same on both devices.I will fix that.
Also, I am considering let the verb
setSubscriptionDuration()deprecated.I think it will be less error prone for the developer if it is a parameter for
StartPlayer()and not a separated verb.And also the documentation must be accurate. I think the actual documentation is incorrect.