|
|
The HTML onprogress Attribute is a event attribute which occurs when the browser is downloading the specified audio or video. Attribute Value: This attribute contains single value script which works when onprogress event attribute call. This attribute is supported by <audio> and <video> tags.
|
<script>
function myFunction() {
alert('Downloading video');
}
</script>
<video onprogress="myFunction()">
The onprogress attribute fires when the browser is in the process of getting the media data (downloading the media).
During the loading process of an audio/video, the following event attributes occur, in this order:
The numbers in the table specify the first browser version that fully supports the event attribute.
<element onprogress="script">
| Value | Description |
|---|---|
| script | The script to be run on onprogress |
| Supported HTML tags: | <audio> and <video> |
|---|
It will Ppress play on the video.
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() { alert('Downloading video');
}
</script>
<p>Press play on the video:</p>
<video controls onprogress="myFunction()"> <source src="https://download.samplelib.com/mp4/sample-5s.mp4" type="video/mp4"> <source src="https://download.samplelib.com/mp4/sample-5s.mp4" type="video/ogg"> Your browser does not support HTML5 video.
</video>
<p>Video courtesy of <a href="https://www.bigbuckbunny.org/" target="_blank">Big Buck Bunny</a>.</p>
</body>
</html>
It will press play on the audio.
<!DOCTYPE html>
<html>
<body>
<script>
function myFunction() {
alert('Downloading audio');
}
</script>
<p>Press play on the audio:</p>
<audio controls onprogress="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>
| html event attributes |
Type: | Develop |
Category: | Web Tutorial |
Sub Category: | HTML Media Events Attribute |
Uploaded by: | Admin |
Read Articlehttps://develop.horje.com/learn/1434/reference