Skip to content

Commit e667b8b

Browse files
committed
Fix error with Safari UA check
Fixes #1491
1 parent 4957be0 commit e667b8b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/howler.core.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@
268268
var checkOpera = ua.match(/OPR\/([0-6].)/g);
269269
var isOldOpera = (checkOpera && parseInt(checkOpera[0].split('/')[1], 10) < 33);
270270
var checkSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1;
271-
var isOldSafari = (checkSafari && parseInt(ua.match(/Version\/(.*?) /)[1], 10) < 15);
271+
var safariVersion = ua.match(/Version\/(.*?) /);
272+
var isOldSafari = (checkSafari && safariVersion && parseInt(safariVersion[1], 10) < 15);
272273

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

0 commit comments

Comments
 (0)