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

Rapidly skipping through playlist tracks can throw console error #28

Closed
benwiley4000 opened this issue Feb 4, 2017 · 1 comment
Closed
Labels

Comments

@benwiley4000
Copy link
Owner

benwiley4000 commented Feb 4, 2017

Rapid-fire skips can lead to a console error: Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

While this error doesn't (yet) appear to have any particular negative consequences, we should try to avoid throwing it.

This answer from Stack Overflow may help us think about how to solve the problem.

@benwiley4000 benwiley4000 modified the milestone: 1.1.4 Release May 17, 2017
@benwiley4000
Copy link
Owner Author

There's not a clear perfect solution for this one. We have a couple of partial solutions:

  • In supporting browsers, wait on the Promise from the play and pause methods to fire another play or pause.
  • Only play or pause if we aren't already in that state.
    The problem is (I tested it), there's another similar error which will crop up even if we did sequence the method calls: Uncaught (in promise) DOMException: The play() request was interrupted by a new load request.

This one's trickier - the load request is because we assigned the src attribute on our audio element, and we don't have a clear way to wait on that. We could try to obfuscate it, but since all our functionality already works, and this error only surfaces for extremely fast song navigation, it would be best to let the errors surface in the console, in case one of them is actually important.

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

No branches or pull requests

1 participant