We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01ff1ca commit f4955c1Copy full SHA for f4955c1
1 file changed
tuna.js
@@ -133,14 +133,14 @@
133
return new Tuna(context);
134
}
135
136
- var window = window || {};
+ var _window = typeof window === 'undefined' ? {} : window;
137
138
- if (!window.AudioContext) {
139
- window.AudioContext = window.webkitAudioContext;
+ if (!_window.AudioContext) {
+ _window.AudioContext = _window.webkitAudioContext;
140
141
if (!context) {
142
console.log("tuna.js: Missing audio context! Creating a new context for you.");
143
- context = window.AudioContext && (new window.AudioContext());
+ context = _window.AudioContext && (new _window.AudioContext());
144
145
146
throw new Error("Tuna cannot initialize because this environment does not support web audio.");
0 commit comments