Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

When building native-like web apps I noticed that they lack tactile feedback, e.g. tap sound or vibration after pressing button. Is it actually possible to implement with web apps at all?


You can play sound with the audio API since the user is interacting with the page. However, the vibration API is only implemented in Chrome and Firefox on mobile. Safari removed it from WebKit.

https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_A...

https://developer.mozilla.org/en-US/docs/Web/API/Vibration_A...


Not when running solely on the web in a browser unfortunately. A tool like Capacitor has haptic feedback support if you deploy your app natively, however: https://capacitorjs.com/docs/apis/haptics




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: