Example:
HTML
<!DOCTYPE html>
<html>
<body>
<audio id="myAudio" controls onloadstart="myFunction()">
<source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_5MG.mp3" type="audio/ogg">
<source src="https://file-examples.com/wp-content/storage/2017/11/file_example_MP3_5MG.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<p>Play the audio file:</p>
<script>
function myFunction() {
alert("The media file has started loading");
}
</script>
<p>This example demonstrates how to use the "onloadstart" attribute on an AUDIO element.</p>
</body>
</html>
How to Run "myFunction" when the Audio data starts to load - HTML onloadstart Attribute | HTML Attribute |
How to Run "myFunction" when the Video data starts to load - HTML onloadstart Attribute | HTML Attribute |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |