onloadedmetadata event
Examples
Execute JavaScript in the video's metadata is loaded:
<Video onloadedmetadata = "myFunction ()">
try it"
Bottom of this article contains more examples.
Definition and Usage
onloadedmetadata event metadata in the specified video / audio (audio / video) trigger after loading.
Video / audio (audio / video) metadata comprises: duration, size (video), text tracks.
Video / audio (audio / video) during the loading process, the order is triggered as follows:
- onloadstart
- ondurationchange
- onloadedmetadata
- onloadeddata
- onprogress
- oncanplay
- oncanplaythrough
Browser Support
Figures in the table represent the first browser to support this version of events.
event | |||||
---|---|---|---|---|---|
onloadedmetadata | Yes | 9.0 | Yes | Yes | Yes |
grammar
In HTML:
<Elementonloadedmetadata = "myScript"> try
In JavaScript:
object .onloadedmetadata = function () {myScript }; try
JavaScript, use the addEventListener () method:
object .addEventListener ( "loadedmetadata", myScript ); try
Note: Internet Explorer 8 and earlier versions of IE do not support addEventListener () method.
technical details
Whether to support the bubble: | No |
---|---|
It can be canceled: | No |
Event Type: | Event |
Supported HTML tags: | <Audio>, <video> |
More examples
Examples
Execute JavaScript in the audio metadata load:
<Audio onloadedmetadata = "myFunction ()">
try it"
Event objects