Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding speed stream #1078

Open
wants to merge 8 commits into
base: minor
Choose a base branch
from

Conversation

wageeh-mankaryos
Copy link

@wageeh-mankaryos wageeh-mankaryos commented Jul 5, 2024

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

  • I read the CONTRIBUTING.md and followed the process outlined there for submitting PRs.
  • My change is not breaking and lands in minor branch OR my change is breaking and lands in major branch.
  • 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.
  • I updated CHANGELOG.md to add a description of the change (format: * DESCRIPTION OF YOUR CHANGE (@your-git-username)).
  • I updated/added relevant documentation (doc comments with ///).
  • I ran dart analyze.
  • I ran dart format.
  • I ran flutter test and all tests are passing.

@wageeh-mankaryos
Copy link
Author

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

@ryanheise
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants