1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-24 07:06:34 +09:00

Fix new audio player features not working on Safari (#14465)

Fixes #14462
This commit is contained in:
ThibG 2020-08-02 11:20:17 +02:00 committed by GitHub
parent 5faf2de938
commit 51b5bb5301
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);