Posted by: Josh Rowe Last Updated: June 05, 2022 Created: March 10, 2020
Share this:
Comments
Indal Singh
3y
it's not work properly showing some error in console "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page." or "MediaElementAudioSource outputs zeroes due to CORS access restrictions"
Reply
Josh Rowe
3y
Hey, Indal. It appears there may have been a browser update since this article was written, requiring a user action in the browser viewport before allowing the use of AudioContext. This has been corrected by adding a new event handler to the audio player itself, only initializing AudioContext if undefined to allow pausing and resuming the audio without throwing a console error. The article and GitHub repository have been updated to reflect the updates. Thanks for pointing this out!
Reply
Henrik Juul-Nyholm
2y
You should add a 'isplaying' variable to the FrameLooper function and toggle it with onpause and oncomplete events to stop the FrameLooper keep running.
Comments
Indal Singh
Josh Rowe
AudioContext
. This has been corrected by adding a new event handler to the audio player itself, only initializingAudioContext
if undefined to allow pausing and resuming the audio without throwing a console error. The article and GitHub repository have been updated to reflect the updates. Thanks for pointing this out!Henrik Juul-Nyholm