Example:
HTML
<video id="myVideo" width="320" height="176" controls ondurationchange="myFunction(this)">
<source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_5mb.mp4" type="video/mp4">
<source src="https://www.sample-videos.com/video321/mp4/240/big_buck_bunny_240p_5mb.mp4" type="video/ogg">
Your browser does not support HTML5 video.
</video>
<script>
function myFunction(x) {
alert("The duration of this video is : " + x.duration + " seconds");
}
</script>
How to Run "myFunction" when the audio is ready to start playing - HTML ondurationchange Attribute | HTML Attribute |
How to Run "myFunction" when the video is ready to start playing - | HTML Attribute |
Type: | Html |
Category: | Web Tutorial |
Sub Category: | HTML Attribute |
Uploaded by: | Admin |