Video pause() Method - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Video


The pause() method pauses the video.



Return Value

No return value

A video with play and pause buttons:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<video id="myVideo" width="320" height="240" controls>
  <source src="your.mp4" type="video/mp4">
  <source src="your.ogg" type="video/ogg">
  Your browser does not support the video tag.
</video>//from   w w w . ja  v  a  2s.  c  o  m

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {
    var x = document.getElementById("myVideo");
    document.getElementById("demo").innerHTML = "Start: " + x.played.start(0) + " End: " + x.played.end(0);


Related Tutorials