adding speed stream
Replace this paragraph with a description of what this PR is changing or adding, and why.
If there's an open issue your PR is fixing, please list it here.
Pre-launch Checklist
- [x] I read the CONTRIBUTING.md and followed the process outlined there for submitting PRs.
- [x] My change is not breaking and lands in
minorbranch OR my change is breaking and lands inmajorbranch. - [x] If I'm the first to contribute to the next version, I incremented the version number in
pubspec.yamlaccording to the pub versioning philosophy. - [x] I updated CHANGELOG.md to add a description of the change (format:
* DESCRIPTION OF YOUR CHANGE (@your-git-username)). - [x] I updated/added relevant documentation (doc comments with
///). - [x] I ran
dart analyze. - [x] I ran
dart format. - [x] I ran
flutter testand all tests are passing.
just minor change but needed for adding speed stream parameter to be able to create slider with player speed
Thanks @wageeh-mankaryos for the PR. I am not yet convinced of the correct approach for this, and the naming is also not consistent with existing streams in the package.
Using the current API, you can of course already listen to playbackState. For example:
playbackState.map((state) => state.speed).distinct()
Have you tried this?
One concern might be the efficiency of it if you are using a slider to control it smoothly, since every fraction that the speed moves it is also broadcasting that to the notification, and you need to test whether the notification bus can cope with events at such a high frequency, but inevitably the speed does need to be reflected here, too.
My personal feeling is that playbackState is what this plugin should be focused on, and anything else can be added by the app via extension methods or various other mechanisms that can be used to implement custom events or actions.