GoogleChromeLabs / audioworklet-polyfill

🔊 Polyfill AudioWorklet using the legacy ScriptProcessor API.
https://googlechromelabs.github.io/audioworklet-polyfill/
Apache License 2.0
195 stars 20 forks source link

Do not crash if non-prefixed AudioContext isn't available #11

Closed warpdesign closed 6 years ago

warpdesign commented 6 years ago

Safari 11.x only has prefixed webAudioContext: without this patch the polyfill crashes.

Fixes #9

googlebot commented 6 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers
warpdesign commented 6 years ago

I signed it.

googlebot commented 6 years ago

CLAs look good, thanks!

developit commented 6 years ago

FWIW I usually recommend "polyfilling" AudioContext in Safari globally:

if (!window.AudioContext && window.webkitAudioContext) = window.AudioContext = window.webkitAudioContext;
developit commented 6 years ago

Shipped in 1.1.1! Cheers.

warpdesign commented 6 years ago

My app now work perfectly in Safari & Firefox!