Kilvish Shakal Kilvish Shakal - 1 year ago 94
CSS Question

Check if a HTML5 video is playing using jquery

I've written a small jquery code to override HTML 5 play function. However, I am not able to check if a video is playing or not.
Here is my jquery code

$("video").click(function() {
var video = $("#myvideo").get(0);;
$(".play").css("display", "none");
return false;
$("#myvideo").bind("pause ended", function() {
$(".play").css("display", "block");

Just give me simple tips to show a div with
(I have CSS for it) when the video is paused and pause the video as well.

Answer Source

You'd use the paused property to check if the video is paused.
If it's not paused, it's playing

$("video").click(function() {
    var video = $("#myvideo").get(0);

    if ( video.paused ) {;
    } else {

    return false;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download