diff --git a/src/index.js b/src/index.js index 928ac14..9734cd6 100644 --- a/src/index.js +++ b/src/index.js @@ -47,7 +47,7 @@ if (typeof AudioWorkletNode !== 'function') { return scriptProcessor; }; - Object.defineProperty(AudioContext.prototype, 'audioWorklet', { + Object.defineProperty((window.AudioContext||webkitAudioContext).prototype, 'audioWorklet', { get () { return this.$$audioWorklet || (this.$$audioWorklet = new window.AudioWorklet(this)); }