chrisguttandin / standardized-audio-context

A cross-browser wrapper for the Web Audio API which aims to closely follow the standard.
MIT License
680 stars 33 forks source link

Missing the native AudioContext constructor. #1009

Closed Talb2005 closed 8 months ago

Talb2005 commented 8 months ago

I see in our logs that some Safari users are experiencing the Error: "Missing the native AudioContext constructor." once a new AudioContext is being instantiated. The Safari versions in which this error occured are 17.0 and 17.2. What could be the reason for these errors and what can we do about it?

chrisguttandin commented 8 months ago

Hi @Talb2005,

without a way to reproduce the problem I can only speculate why this is happening. When Safari finally removed the prefixed webkitAudioContext it was still possible to set a feature flag which disabled the unprefixed AudioContext. As a result none of them was available.

Is it happening on iOS, iPadOS or macOS? Do you know of a way to trigger the problem?

You could also use isSupported() to check if standardized-audio-context found all the APIs it needs to prevent triggering a runtime error.

Talb2005 commented 8 months ago

Hi @chrisguttandin , Thanks for your quick reply. I'm not able to reproduce it.. In my logs I see a total of 16 such error events, experienced by a total of 6 users over the last 3 months. So this error is very rare.. (we have thousands of users each day). I see it happened only once on an iPhone iOS 17.2.1 Safari 17.2. All the other occurences were on macOS using Safari 17.0 and Safari 17.2.

chrisguttandin commented 8 months ago

Just another random thought ... could these be emulated/virtual test devices without any physical audio hardware?

I'm sorry but there is not much I can do without a way to reproduce the issue. I'm closing this for now. Please feel free to open it again in case you discover a way to reproduce it.