Solved: pause html5 video jquery

The main problem related to pausing HTML5 video using jQuery is that it is not supported in all browsers. While most modern browsers support HTML5 video, some older versions of Internet Explorer and other browsers may not. Additionally, jQuery does not have a built-in method for pausing HTML5 video, so developers must use a workaround such as setting the currentTime property of the video element to 0 or using an external library like MediaElement.js to pause the video.


<script>
  $(document).ready(function(){
    $("#video").click(function(){
      if($("#video").get(0).paused){
        $("#video").get(0).play();  
      } else { 
        $("#video").get(0).pause(); 
      }  
    });  
  });  
</script>

1.

HTML55 tag video vs Youtube video

The HTML5

Youtube videos are embedded into an HTML document using an iframe element. This allows you to embed a Youtube video directly into your page without having to use any additional code or plugins. The iframe element also allows for more customization of the video's appearance and behavior than with the

How to pause video in html5 using jQuery

Related posts:

Leave a Comment