var video = document.querySelectorAll("video");
for(var i=0; i<video.length; i++) {
video[i].onmousemove = function () {
this.play();
};
video[i].onmouseout = function () {
this.pause();
this.currentTime = 0;
};
}