I\'m using the following code to add click-to-play functionality to HTML5 video:
$(\'video\').click(function() {
if ($(this).get(0).paused) {
$(this).g
I know this is an old question but I ran into the same issue and found an other solution! Playing the video on click and also pause it on click. But as the original poster I ran into problems with the controls. Solved the issue with jquery like this:
$("video").click(function (e) {
if(e.offsetY < ($(this).height() - 36)) // Check to see if controls where clicked
{
if(this.paused)
this.play();
else
this.pause();
}
});
I check the offset in the click and if it is over the controls my play/pause functions doesn't do anything.