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

Address event lag through platform channels #21

Closed
ryanheise opened this issue Jan 2, 2020 · 3 comments
Closed

Address event lag through platform channels #21

ryanheise opened this issue Jan 2, 2020 · 3 comments
Assignees
Labels
3 testing bug Something isn't working
Projects

Comments

@ryanheise
Copy link
Owner

ryanheise commented Jan 2, 2020

Note to self: there is a slight lag between the time an event is broadcast from the platform side and the time it is received on the flutter side, which may create surprises for flutter-side state processing. For example, after await setUrl(...) completes on the flutter side, the state transition to stopped may lag slightly, and for a brief moment querying player.playbackState may still report connecting.

At some point, this code should be improved so that events are categorised into flutter-side initiated events which should update on the flutter side immediately, and asynchronous events which originate on the platform side, such as when buffering is detected, and for which the lag is not a problem.

@ryanheise ryanheise self-assigned this Jan 2, 2020
@yringler
Copy link

yringler commented Jan 6, 2020

For example, after await setUrl(...) completes on the flutter side, the state transition to stopped may lag slightly, and for a brief moment querying player.playbackState may still report connecting.

Yes! I dealt with this exact issue. I ended up using playbackStateStream, and taking the first value which wasn't connecting

@ryanheise
Copy link
Owner Author

Fixed in the latest commit on master.

@github-actions
Copy link

github-actions bot commented Nov 7, 2021

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 testing bug Something isn't working
Projects
No open projects
just_audio
  
To do
Development

No branches or pull requests

2 participants