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

<p>本例演示如何将 "onpause" 事件分配给 video 元素。</p>

<p>播放和暂停视频。</p>

<video width="320" height="240" controls onpause="myFunction()">
  <source src="/static/demo/video/shanghai.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

<script>
function myFunction() {
  alert("The video was paused.");
}
</script>

</body>
</html>
运行结果: