Skip to content

Commit

Permalink
Fix new audio player features not working on Safari (mastodon#14465)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored and Mage committed Jan 14, 2022
1 parent 636d850 commit 3a7a4e8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/javascript/mastodon/features/audio/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3a7a4e8

Please sign in to comment.