From 3bfc8d49ee65680fe8acc1169bf09ac457f5dcfc Mon Sep 17 00:00:00 2001 From: chme Date: Tue, 19 Feb 2019 10:33:07 +0100 Subject: [PATCH] [web-src] Fix audio context creation in Safari --- web-src/src/audio.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/web-src/src/audio.js b/web-src/src/audio.js index 96c6325e..f88a9e2f 100644 --- a/web-src/src/audio.js +++ b/web-src/src/audio.js @@ -4,12 +4,14 @@ */ export default { _audio: new Audio(), - _context: new AudioContext(), + _context: null, _source: null, _gain: null, // setup audio routing setupAudio () { + var AudioContext = window.AudioContext || window.webkitAudioContext + this._context = new AudioContext() this._source = this._context.createMediaElementSource(this._audio) this._gain = this._context.createGain()