0

How can i control phone vibration using javascript !!..

4th May 2020, 10:31 AM
mr sha
5 odpowiedzi
+ 1
window.navigator.vibrate(200); // vibrate for 200ms window.navigator.vibrate([100,30,100,30,100,30,200,30,200,30,200,30,100,30,100,30,100]); You can either set a single value or pass a array. Note: It will not work on Sololearn due to permissions.
4th May 2020, 11:38 AM
Amey Bhavsar
Amey Bhavsar - avatar
+ 2
Amey Bhavsar thanks for your idea...I've implemented it in my code, check it out: https://code.sololearn.com/Wh9jFl2q0fzG/?ref=app
9th May 2020, 2:25 PM
Bot
Bot - avatar
4th May 2020, 11:39 AM
Amey Bhavsar
Amey Bhavsar - avatar
+ 1
When we pass a array as the parameter, it creates a pattern of vibration.
4th May 2020, 7:05 PM
Amey Bhavsar
Amey Bhavsar - avatar
0
What happens when we pass array as paramete😐
4th May 2020, 4:51 PM
mr sha