×

Save Your Code

If you click the save button, your code will be saved, and you get an URL you can share with others.

By clicking the "Save" button you agree to our terms and conditions.

Report Error

×

Save to Google Drive

If you have a Google account, you can save this code to your Google Drive.

Google will ask you to confirm Google Drive access.

×

Open from Google Drive

If you have saved a file to Google Drive, you can open it here:

Result Size: 625 x 571
x
 
<!DOCTYPE html>
<html>
<body>
<p>This example shows the difference between the onseeking event and onseeked event.</p>
<p>The onseeking event occurs everytime the user STARTS moving/skipping to a new position in the audio/video.</p>
<p>The onseeked event occurs when the user is FINISHED moving/skipping to a new position in the audio/video</p>
<p>Move to a new position in the video. <strong>Tip:</strong> Try to hold down the mouse button and seek back and forth in the video playback.</p>
<video controls onseeking="myFunction()" onseeked="mySecondFunction()">
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>
<p>seeking occured: <span id="demo"></span> times.</p>
<p>seeked occured: <span id="demo2"></span> times.</p>
<script>
x = 0;
function myFunction() {
  document.getElementById("demo").innerHTML = x += 1;
}
y = 0;
function mySecondFunction() {
  document.getElementById("demo2").innerHTML = y += 1;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onseeking_onseeked by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:59 GMT -->
</html>
×

Report a Problem: