How do I use jQuery to pause or stop html5 video?

Please try this link:

Towards the middle of the page click on tab: Video & Allegati
Click to play video
Then click on another tab, the video is still playing.

How do I use jQuery to pause/stop this video when I click on another tab?

thanks in advance
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

badwolfffAuthor Commented:
by the way I am using video.js
Julian HansenCommented:
The basics are as follows

var video = document.getElementById('vidoeid');


Open in new window

The following sample demonstrates the concept - source code below and in the sample
<!doctype html>
<link href="css/bootstrap.css" rel="stylesheet" />
<style type="text/css">
<div class="container">
    <video id="thevideo" src=""></video>
  <button class="video-control" data-action="play">Play</button>
  <button class="video-control" data-action="pause" disabled>Pause</button>

<h4>Source Code</h4>
<iframe src="t939s.html" style="width: 100%; border: 0; padding: 0; margin: 0; height: 400px"></iframe>
<script src=""></script>

<!-- Latest compiled and minified JavaScript -->
<script src="js/bootstrap.js"></script>
<script type="text/javascript">
$(function() {
  $('.video-control').click(function(e) {
    var video = document.getElementById('thevideo');
    var action = $(this).data('action');
    if (action == 'play') {;
    else if (action == 'pause') {
      $(this).prop('disabled', true);

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.