Hello everyone ๐
In this article, we will see how can we use Vibration API in our websites.
We can use the Vibration API to provide haptic or vib...
For further actions, you may consider blocking this person and/or reporting abuse
๐
For anyone using Angular, ngx-vibration makes using vibrations easy as pie.
Thank you for sharing that.
Sigh. What will happen to the phones if I do this in an infinite interval??!
I'm not sure what type of impact devices can have but it will eat up more battery.
Well, at least I can make a milk shake by placing my cup on the phone while visiting a site with infinite vibration.
You can use it as a massager too.
true
Time to build that massager app I always wanted to
You can open your virtual massage parlour ๐.
Tried it on my phone and it doesnt work :<
New APIs like these take a while to get widespread support, Apps that come out using these would be "experimental" til they are widely accepted.
Yeah, you are right. But this API is not so new, I don't know why other environments are taking so long to add support for it.
Hey @pavelloz , It's working fine. Check out this Live Page.
Not working on android/firefox :\
Yeah. Firefox has some issue. It is working only on Chrome Android.
Check this comment.
It doesn't really work though.
Its working on Chrome android. Firefox android has some bug.
Doesn't work on iPhone either
Checked the docs. As usual, iOS doesn't allow to access the API in the browser. So currently, its working perfectly only on Chrome android.
Good to know this new Web API.
Thanks!
Wow I didn't know about this! Although I wonder, when do we actually need to use vibration when visiting websites via the browser. I don't remember encountering this functionality while browsing.
Vibration is used by some sites while showing error, wrong input, or to give a haptic feedback on clicking action buttons responsible for undo-able task etc.
This is really awesome! Trying to embed it in my web based game!
Glad you liked it.
Live example (check with your phone) - jsfiddle.net/unfor19/zeh3d1uo/
For me it works, on Galaxy S10 , Chrome 90.0.4430.91
Thank you for that.
I have hosted the page to make it easier for readers to test it.
Live Page
Why it doesnt work on firefox?
I think we have to use the
mozVibrate
method for firefox. Let me update the code.Edited: So I tried and tested it, and came to know that somehow it is not working with Firebox. There are some open issues on Github too.
Seems really easy to implement. I could give it a shot! Thanks for sharing!
You're welcome.
You can try this too. You will like it.