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

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

<p>播放、暂停然后再次播放视频。</p>

<video controls onplaying="myFunction()">
  <source src="/static/demo/video/shanghai.mp4" type="video/mp4">
  Your browser does not support HTML5 video.
</video>


<script>
function myFunction() {
  alert("The video is now playing");
}
</script>

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