Clicking HTML 5 Video element to play, pause video, breaks play button
The simplest form is to use the onclick listener: <video height=”auto” controls=”controls” preload=”none” onclick=”this.play()”> <source type=”video/mp4″ src=”vid.mp4″> </video> No jQuery or complicated Javascript code needed. Play/Pause can be done with onclick=”this.paused ? this.play() : this.pause();”. To keep it from clashing with the video controls on some browsers, call preventDefault on the click event: onclick=”this.paused ? … Read more