You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: