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 Eugen Rochko
parent 58c59af573
commit 856cb96a2b

View File

@ -269,8 +269,9 @@ class Audio extends React.PureComponent {
} }
_initAudioContext () { _initAudioContext () {
const context = new AudioContext(); const AudioContext = window.AudioContext || window.webkitAudioContext;
const source = context.createMediaElementSource(this.audio); const context = new AudioContext();
const source = context.createMediaElementSource(this.audio);
this.visualizer.setAudioContext(context, source); this.visualizer.setAudioContext(context, source);
source.connect(context.destination); source.connect(context.destination);