[BUG] onProgress.listen(e) not working on Android
See original GitHub issueFlutter Sound Version : flutter_sound 6.1.4
- Result of the command “flutter pub deps | grep flutter_sound” (very important):
|-- flutter_sound 6.1.4
| |-- flutter_sound_platform_interface 1.0.0
Severity
onProgress.listen(e) never being triggered
Platforms you faced the error
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.
Additional context**
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.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
[BUG] onProgress.listen(e) not working on Android · Issue #482
When setting the value of the StreamSubscription to listen to the progress of the player. The listener never seems to be called. This...
Read more >Mediaplayer progress update to seekbar not smooth?
I am using mediaplayer to play the recorded .wav file and meantime I want to update to a seekbar. Everything is working fine...
Read more >Creating a Flutter audio player and recorder app
Learn how to add audio recording and playing features to a Flutter app so you can create your own audio-based modern apps.
Read more >Button | Android Developers
If you are not satisfied with the default button style, you can customize it. ... than the view is wide to be ellipsized...
Read more >XMLHttpRequest: progress event - Web APIs - MDN Web Docs
In other words, it tells if the progress is measurable or not. loaded Read only. A 64-bit unsigned integer value indicating the amount...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 verbsetSubscriptionDuration()
deprecated. I think it will be less error prone for the developer if it is a parameter forStartPlayer()
and not a separated verb.And also the documentation must be accurate. I think the actual documentation is incorrect.
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!