Play audio
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() { alert('The audio has started to play');
}
</script>
<p>Press play on the audio:</p>
<audio controls onplay="myFunction()"> <source src="https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/" type="audio/ogg"> <source src="https://file-examples.com/index.php/sample-audio-files/sample-mp3-download/" type="audio/mpeg"> Your browser does not support the audio element.
</audio>
</body>
</html>
Type
: |
html |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Media Events Attribute |
Uploaded by
: |
Admin |