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

"Unhandled Promise Rejection" error when trying to play audio in Safari #2

Open
rickcurran opened this issue Jun 15, 2022 · 0 comments

Comments

@rickcurran
Copy link

Hi, the following error is triggered in Safari when trying to play the recorded audio:

Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

The issue seems to be Safari being a bit tougher on what it is seeing as an auto-playing audio file, although a button is being clicked to stop the audio recording the stopAudioRecording function then automatically calls playAudio(audioAsblob) but Safari seems to see this process as the audio trying to autoplay (perhaps because the playAudio function creates the audio HTML element dynamically at that point?).

I was wondering if there was any way to work around this error by adding a completely separate Play button to trigger playback of the audio?

Thanks!

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