blob: 1cd9daf172f2a003c2340dd4c9d20a88c3eac48f [file] [log] [blame]
<!DOCTYPE html>
<meta charset='utf-8'/>
<title>Vibration API: cancel ongoing vibrate() with a new call to vibrate</title>
<link rel='author' title='Robin Berjon' href=''/>
<link rel='help' href=''/>
<meta name='flags' content='dom, interact'/>
<meta name='assert' content='Cancel the pre-existing instance of the processing vibration patterns algorithm, if any.'/>
After hitting the button below, your device must vibrate continuously for a short period of time (roughly one
second), then vibrate a series of short bursts. If the initial continuously vibration is longer (roughly five
seconds, it should feel somewhat long) or if there is no series of short vibration bursts then the test has
<button id='vib'>Vibrate!</button>
<script src='/common/vendor-prefix.js' data-prefixed-objects='[{"ancestors":["navigator"], "name":"vibrate"}]'></script>
if (undefined !== navigator.vibrate) {
document.getElementById("vib").onclick = function () {
setTimeout(function () {
navigator.vibrate([200, 200, 200, 200, 200, 200, 200, 200, 200]);
}, 1000);