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

Created on 6 Oct 2020  路  3Comments  路  Source: Canardoux/tau

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.

maybe bug

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ggirotto picture ggirotto  路  3Comments

mhstoller picture mhstoller  路  5Comments

palfrey picture palfrey  路  3Comments

alby97 picture alby97  路  5Comments

felixjunghans picture felixjunghans  路  4Comments