about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2020-08-02 11:20:17 +0200
committerGitHub <noreply@github.com>2020-08-02 11:20:17 +0200
commit51b5bb53015df5b360f0e366f7fc67dce75e2d6c (patch)
tree4423b0d9b7dcdc88b54dd2ad78586e5c09f6ca84
parent5faf2de93891db822d78c92f2bc2cdc33c3605c1 (diff)
Fix new audio player features not working on Safari (#14465)
Fixes #14462
-rw-r--r--app/javascript/mastodon/features/audio/index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js
index 1ab1c3117..a4e00ba96 100644
--- a/app/javascript/mastodon/features/audio/index.js
+++ b/app/javascript/mastodon/features/audio/index.js
@@ -269,8 +269,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);