hammerjs / hammer.js

A javascript library for multi-touch gestures :// You can touch this
http://hammerjs.github.io
MIT License
24.12k stars 2.62k forks source link

swipe event does not allow playing audio on iOS #1277

Open orange4glace opened 3 years ago

orange4glace commented 3 years ago

On mobile devices, playing media with mediaElement.play() needs explicit user interaction. On Android, playing media on swipe event works. On the other side on iOS, it does not work with following error.

Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.