Horje

Alert that the audio is playing

It will press play on the video.

index.html
Example: HTML
<!DOCTYPE html> 
<html> 
<body> 

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

<p>Press play on the audio.</p>

<audio controls onplaying="myFunction()">
  <source src="https://download.samplelib.com/mp4/sample-5s.mp4" type="audio/ogg">
  <source src="https://download.samplelib.com/mp4/sample-5s.mp4" type="audio/mpeg">
  Your browser does not support the audio element.
</audio>

</body> 
</html>

Output should be:

Alert that the audio is playing




Type:
html
Category:
Web Tutorial
Sub Category:
HTML Media Events Attribute
Uploaded by:
Admin