about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-08-02 11:20:17 +0200
committerThibaut Girka <thib@sitedethib.com>2020-08-02 14:35:40 +0200
commitde7ba22c458c3eb9d0edf0c4c25250870c8a60d5 (patch)
treefbfbc1daae45e7b4cdf8c0525b646a39ba29af96
parent8f3295f21254af8dd35e61a046223f1207528631 (diff)
[Glitch] Fix new audio player features not working on Safari
Port 51b5bb53015df5b360f0e366f7fc67dce75e2d6c to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
-rw-r--r--app/javascript/flavours/glitch/features/audio/index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js
index 4e85e3c58..33e67fcbe 100644
--- a/app/javascript/flavours/glitch/features/audio/index.js
+++ b/app/javascript/flavours/glitch/features/audio/index.js
@@ -254,8 +254,9 @@ class Audio extends React.PureComponent {
   }
 
   _initAudioContext () {
-    const context  = new AudioContext();
-    const source   = context.createMediaElementSource(this.audio);
+    const AudioContext = window.AudioContext || window.webkitAudioContext;
+    const context      = new AudioContext();
+    const source       = context.createMediaElementSource(this.audio);
 
     this.visualizer.setAudioContext(context, source);
     source.connect(context.destination);