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

Fix error when a play() call was interrupted by a call to pause() #835

Merged
merged 3 commits into from
Dec 15, 2017

Conversation

dmednis
Copy link
Contributor

@dmednis dmednis commented Oct 20, 2017

#718

Handled the case where this exception was thrown:

Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

The error would occur when audio.pause() and audio.play() are called in rapid succession.

Implemented a lock that prevents audio.pause() from being executed when there is a pending audio.play() returned promise. The lock gets lifted and queued actions are executed after the promise has resolved.

@dmednis
Copy link
Contributor Author

dmednis commented Dec 7, 2017

Any plans on merging this?

@goldfire
Copy link
Owner

I'll get this merged shortly, thanks! For future reference, avoid modifying anything in dist as that all gets generated with a build task.

@goldfire goldfire merged commit 66c0769 into goldfire:master Dec 15, 2017
@swhopkins
Copy link

I was trying to upgrade and this commit seems to be causing some issues in Safari. If I start playing, then seek, I get a 'Unhandled Promise Rejection: [object DOMError]' and can no longer pause. In 2.0.5 I get the same exception, but pause still works. Has anyone else run into this or have a workaround?

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.

3 participants