代码示例:(标识:event_onseeking_onseeked)
<!DOCTYPE html>
<html>
<body>

<p>本例显示了 onseeking 事件和 onseeked 事件之间的区别。</p>

<p>每次用户开始移动/跳到音频/视频中的新位置时,都会发生 onseeking 事件。</p>

<p>当用户完成移动/跳到音频/视频中的新位置时发生 onseeked 事件。</p>

<p>请移动到视频中的新位置。<b>提示:</b> 尝试按住鼠标按钮并在视频播放中来回搜索。</p>

<video controls onseeking="myFunction()" onseeked="mySecondFunction()">
  <source src="/static/demo/video/shanghai.mp4" type="video/mp4">
  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>
</html>
运行结果: