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

Create helper for updating progress bars for position in a sane way #4

Closed
adamcik opened this issue Mar 7, 2015 · 3 comments
Closed

Comments

@adamcik
Copy link
Member

adamcik commented Mar 7, 2015

Related to "solving" mopidy/mopidy#434 - Idea is to take care of all the making sure we account for timeouts running over and using animation frames so we get more accurate timing and don't get updated when the tab isn't visible.

http://jsfiddle.net/deqfpk8x/9/ has a quick prototype for this.

@adamcik
Copy link
Member Author

adamcik commented Mar 7, 2015

http://jsfiddle.net/deqfpk8x/15/ is the updated version. Changed the API to be "callback" oriented, in the sense that you create a Progress object for each callback you want to run. Then you just call start and stop as needed. I've also made sure we handle missing position and duration params. And that we can handle infinite play type situations.

@adamcik
Copy link
Member Author

adamcik commented Mar 7, 2015

Continued playing with this, http://jsfiddle.net/us0zschg/6/ is more or less the same as the last one, but we now have a setTimeout based fallback.

@adamcik
Copy link
Member Author

adamcik commented Mar 8, 2015

Having discussed this with @jodal on IRC this will likely just end up as it's own standalone repo. So closing this and will add info about the helper to the main mopidy docs once it is up.

@adamcik adamcik closed this as completed Mar 8, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant