From b952dce1600061027b61d151f61280793a6bea86 Mon Sep 17 00:00:00 2001 From: pradhanjicoder <71271567+pradhanjicoder@users.noreply.github.com> Date: Sun, 11 Feb 2024 15:41:36 +0530 Subject: [PATCH] Update howler.core.js iOS 16+ doesn't play html5 sounds sometimes hence a fix has been done at line number 273 which fixed the issue at my end. --- src/howler.core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/howler.core.js b/src/howler.core.js index 5198bdfc..db8973f1 100644 --- a/src/howler.core.js +++ b/src/howler.core.js @@ -269,7 +269,8 @@ var isOldOpera = (checkOpera && parseInt(checkOpera[0].split('/')[1], 10) < 33); var checkSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1; var safariVersion = ua.match(/Version\/(.*?) /); - var isOldSafari = (checkSafari && safariVersion && parseInt(safariVersion[1], 10) < 15); + // iOS version 16+ doesn't play the html5 sound sometimes, so we need to check for it. + var isOldSafari = (checkSafari && safariVersion && parseInt(safariVersion[1], 10) < 18); self._codecs = { mp3: !!(!isOldOpera && (mpegTest || audioTest.canPlayType('audio/mp3;').replace(/^no$/, ''))),