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

onplay() still called after playback error #774

Closed
Xythus opened this issue May 21, 2017 · 0 comments
Closed

onplay() still called after playback error #774

Xythus opened this issue May 21, 2017 · 0 comments

Comments

@Xythus
Copy link

Xythus commented May 21, 2017

I'm trying to make a web app that's supposed to load and play back audio files from local storage. Because of this requirement I (sadly) can't use the Web Audio API. When the application has loaded I want to attempt an audio playback before the user has given any input, so that devices that do not have this limitation start playing back audio right away. I was planning on using the onplay() listener to set a boolean (audioStarted) to true on the first successful audio playback.

When including html5: true in the Howl options and attempting to play back the file straight away I get the following error as expected:
Uncaught (in promise) DOMException: play() can only be initiated by a user gesture.

However, the onplay() function is still called despite the unsuccessful audio playback, thus incorrectly setting the audioStarted boolean. Is this intended behavior?

ringcrl pushed a commit to ringcrl/howler.js that referenced this issue Apr 21, 2019
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

No branches or pull requests

1 participant