Skip to content

Commit

Permalink
Fix error with Safari UA check
Browse files Browse the repository at this point in the history
Fixes #1491
  • Loading branch information
goldfire committed Jun 30, 2021
1 parent 4957be0 commit e667b8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
var checkOpera = ua.match(/OPR\/([0-6].)/g);
var isOldOpera = (checkOpera && parseInt(checkOpera[0].split('/')[1], 10) < 33);
var checkSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1;
var isOldSafari = (checkSafari && parseInt(ua.match(/Version\/(.*?) /)[1], 10) < 15);
var safariVersion = ua.match(/Version\/(.*?) /);
var isOldSafari = (checkSafari && safariVersion && parseInt(safariVersion[1], 10) < 15);

self._codecs = {
mp3: !!(!isOldOpera && (mpegTest || audioTest.canPlayType('audio/mp3;').replace(/^no$/, ''))),
Expand Down

0 comments on commit e667b8b

Please sign in to comment.