revision:
The onplaying event occurs when the audio/video is playing after having been paused or stopped for buffering.
Supported HTML tags: <audio> and <video>.
<element onplaying="script"></element>
script: this attribute contains a "single value script", which works when the onplaying event attribute is called.
play, pause and then play the video again.
<p class="spec">play, pause and then play the video again.</p> <video style="margin-left:3vw;" width="400" height="auto" controls onplaying="playVid()"> <source src="../../pics/Wuzhen-20-10_02.mp4" type="video/mp4"> Your browser does not support HTML5 video. </video> <script> function playVid() { alert("The video is now playing"); } </script>
Play, pause and then play the audio again.
<p class="spec">Play, pause and then play the audio again.</p> <audio style="margin-left:3vw;" controls onplaying="playAud()"> <source src="../../pics/horse.wav" type="audio/wav"> Your browser does not support the audio element. </audio> <script> function playAud() { alert("The audio is now playing"); } </script>