amaneureka/T-Rex

[Safari] Can't find variable: AudioContext

Closed this issue · 1 comments

Hey! When testing the website I'm getting an error in the console saying "Can't find variable: AudioContext".

I haven't tested it yet, but I think you can fix it by replacing AudioContext with webkitAudioContext when the client is using the desktop version of Safari.

Thanks!

I fixed it by adding following code block

var AudioContext = window.AudioContext          // Default
              || window.webkitAudioContext;  // Safari and old versions of Chrome
this.audioContext = new AudioContext();```