Skip to content

Commit

Permalink
Add extra check for failed AudioContext setup on Safari
Browse files Browse the repository at this point in the history
Fixes #1021
  • Loading branch information
goldfire committed Dec 7, 2018
1 parent a35de7a commit 758358e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2308,6 +2308,11 @@
Howler.usingWebAudio = false;
}

// If the audio context creation still failed, set using web audio to false.
if (!Howler.ctx) {
Howler.usingWebAudio = false;
}

// Check if a webview is being used on iOS8 or earlier (rather than the browser).
// If it is, disable Web Audio as it causes crashing.
var iOS = (/iP(hone|od|ad)/.test(Howler._navigator && Howler._navigator.platform));
Expand Down

0 comments on commit 758358e

Please sign in to comment.