HTML Audio/Video DOM loadeddata Event

Example

Indicate that the data of the current frame is available:

myVid=document.getElementById("video1");
myVid.onloadeddata=alert("Browser has loaded the current frame");

Try It Yourself

Definition and Usage

The loadeddata event will occur when the data of the current frame has been loaded, but there is not enough data to play the next frame of the specified audio/video.

The following events will occur in sequence when the audio/video is in the loading process:

Browser Support

All mainstream browsers support the loadeddata event.

Note:Internet Explorer 8 or earlier browsers do not support this event.

Syntax

In HTML:

<audio|video onloadeddata="SomeJavaScriptCode">

In JavaScript:

audio|video.onloadeddata=SomeJavaScriptCode;

Use addEventListener():

audio|video.addEventListener("loadeddata", function()
  {
  //Some JavaScript Code
  

Technical Details

The following HTML tags are supported: <audio>, <video>
The following JavaScript objects are supported: Audio, Video

More Examples

Use the loadeddata attribute on HTML elements

Listen to the loadeddata event using addEventListener()