question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] onProgress.listen(e) not working on Android

See original GitHub issue

Flutter 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

3reactions
Larpouxcommented, Oct 9, 2020

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.

2reactions
PabloduPontavicecommented, Oct 6, 2020

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found