Closed JohnWeisz closed 4 years ago
Upon further investigation it seems this issue was in fact not originating from an incomplete implementation, but from using a non-secure origin instead (developing over network, and AudioWorklet requires a secure context). The error wasn't useful, the API was simply not made available.
Regardless, I'll leave the PR open in case it's deemed useful.
Thank you, I ran into this as well. I hate it when they magically make stuff disappear on insecure origins, ran into navigator.requestMIDIAccess disappearing as well. This is not very helpful for new developers since all is well on localhost and as soon as you try to put it online nothing works anymore because of this kind of BS. This is NOT how you fix security issues because they can still make those malicious sites under https.
This is a strange one I picked up today, it seems (my) Chrome Android 73 implementation does define
AudioWorkletNode
, but notAudioContext.audioWorklet
, as if it was an incomplete implementation. However, this polyfill only checks forAudioWorkletNode
, and thus there is a runtime error.The solution I came up was the following, on https://github.com/GoogleChromeLabs/audioworklet-polyfill/blob/master/src/index.js#L22