diff options
author | ThibG <thib@sitedethib.com> | 2020-08-02 22:46:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-02 22:46:25 +0200 |
commit | b988bc75649425266e848a25290a86a9fc53625e (patch) | |
tree | 0ca60f5d88936a2d768e29fe248f8d78eabd2581 /app/javascript/flavours | |
parent | 141ac8db8b98230188b13f1da801611bcdc6a9f1 (diff) | |
parent | 8f0e6122a9cf85216d7e73bda5fa8338458b2b77 (diff) |
Merge pull request #1393 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/javascript/flavours')
-rw-r--r-- | app/javascript/flavours/glitch/features/audio/index.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 33e67fcbe..f2c2fe4e0 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -113,6 +113,10 @@ class Audio extends React.PureComponent { } togglePlay = () => { + if (!this.audioContext) { + this._initAudioContext(); + } + if (this.state.paused) { this.setState({ paused: false }, () => this.audio.play()); } else { @@ -131,10 +135,6 @@ class Audio extends React.PureComponent { handlePlay = () => { this.setState({ paused: false }); - if (this.canvas && !this.audioContext) { - this._initAudioContext(); - } - if (this.audioContext && this.audioContext.state === 'suspended') { this.audioContext.resume(); } |