audio_service icon indicating copy to clipboard operation
audio_service copied to clipboard

adding speed stream

Open wageeh-mankaryos opened this issue 1 year ago • 2 comments

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 minor branch OR my change is breaking and lands in major branch.
  • [x] If I'm the first to contribute to the next version, I incremented the version number in pubspec.yaml according 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 test and all tests are passing.

wageeh-mankaryos avatar Jul 05 '24 18:07 wageeh-mankaryos

just minor change but needed for adding speed stream parameter to be able to create slider with player speed

wageeh-mankaryos avatar Jul 05 '24 18:07 wageeh-mankaryos

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.

ryanheise avatar Jul 10 '24 12:07 ryanheise