audioplayers
audioplayers copied to clipboard
Add onPlaybackRateChanged (Stream<double>)
Similarly to onAudioPositionChanged and onDurationChanged
Might also be solved with https://github.com/luanpotter/audioplayers/issues/512
Closing this due to reports of this being fixed on newer versions. Feel free to open a new issue in case of this still happening
I kindly disagree as there is no onPlaybackRateChanged (or similar) stream in audioplayers' documentation. This feature request haven't been solved yet. Please reopen this issue or prove it is solved
I kindly disagree as there is no onPlaybackRateChanged (or similar) stream in audioplayers' documentation. This feature request haven't been solved yet. Please reopen this issue or prove it is solved
You are correct. The linked issue confused me and I though it was a merged pr instead, re opening.
Yeah this is definitely this is not implemented yet.
But I am wondering why this is needed, because playback rate is exclusively controlled by the user. duration and position change on the backend and thus need streams. We don't have a stream for volume for example.
Is there a bit more context on why this is needed?
The current state is, that user has to set some rate state variable and update it every time he calls setPlaybackRate. Also he has to call a callback at all these places recalculating position and duration. So it ends up with a lot of the same code in several places. I made a workaround to do all of this stuff when position changes. This makes it more unintuitive, but works well (see https://github.com/dvorapa/stepslow/blob/master/lib/main.dart). For me this is no longer needed as my workaround works. Feel free to close it if you feel it's not worth the time spent on it.
I agree on having a variable to check the current rate, but I don't see a reason for a constantly updated stream, as it's controlled by the user.
Ok I think I understand: the duration and position (in seconds) may changes dependent on the rate, as in real time the overall duration of a song is larger or shorter then. But this may needs rather another stream for realTimeDuration
and realTimePosition
and in contrast to the player position and duration. But honestly I think it's something the user can solve himself, if needed.