how can i add pause and play functionality to the code in this link? http://svay.com/experiences/mouse-recorder/
currently here you can play and stop only.
how can i add pause and play functionality to the code in this link? http://svay.com/experiences/mouse-recorder/
currently here you can play and stop only.
Just looking at the code..
There is a startRecord function
function startRecord(){
setFPS();
state = 2;
disableAction();
timer = window.setInterval('pushCoordinates()', Math.floor(1000/fps));
document.getElementById('console').value = '';
window.onmousemove = grabCoordinates;
}
and a stopRecord function:
function stopRecord(){
window.clearInterval(timer);
saveCoordonnees();
state = 0;
enableAction();
document.getElementById('which').selectedIndex = 0;
}
You could probalby make a button with the that triggers pauseRecord and to something like
function pauseRecord(){
//stop the timer
window.clearInterval(timer);
}
and then one that triggers resumeRecord
function resumeRecord() {
//start the timer again
timer = window.setInterval('pushCoordinates()', Math.floor(1000/fps));
window.onmousemove = grabCoordinates;
}