-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mobileAutoEnable totally breaks Chrome's touch events #1003
Comments
I encountered this error in my app after I updated the library to v2.0.14 yesterday. Will anyone be kind enough to share the code on how can I implement a quick fix to get rid of the error message? Something we can just cut and paste the code - because some of us like me don't really understand how the audio part works. :-) Thank you so much in advance. |
Thanks, this has now been fixed and I'll get a v2.0.15 out soon. |
Now that Howler is running its event-based auto-enable on Chrome, all touch events are broken due to Chrome forcing document-level touch handlers to be passive.
(Clickable link from the image: https://www.chromestatus.com/features/5093566007214080)
To reproduce:
Howler's document-level
touchstart
event handler callspreventDefault
on the event, but recent versions of Chrome forcetouchstart
event handlers — and other potentially scroll-blocking handlers — to be passive (see the relevant item in the Chrome platform changelog). Passive events can't have their default actions prevented, so Howler'sunlock
handler throws an error which breaks that touch event and prevents interaction with the document.This is affecting Chrome desktop and Chrome for Android version 56 and above, including web views on Android.
A quick fix would involve checking that
unlock
handler to make sure it isn't passive before preventing its default handler. However, it's unclear to me why the default handler should be prevented at all, as thatunlock
method seems like it should always be passive — perhaps that line can be removed altogether?The text was updated successfully, but these errors were encountered: