YouTip LogoYouTip

Av Met Load

## HTML Audio/Video DOM load() Method The `load()` method is a built-in HTML5 Audio/Video DOM method used to reload or update an audio or video element. When you dynamically change the source (`src`) or other settings of a media element via JavaScript, the browser does not automatically load the new media file. Calling the `load()` method forces the browser to reset the media element and load the new resource. --- ## Syntax ```javascript mediaElement.load(); ``` ### Parameters * This method does not accept any parameters. ### Return Value * **None** (`undefined`). --- ## Browser Support | Method | Internet Explorer | Firefox | Opera | Google Chrome | Safari | | :--- | :--- | :--- | :--- | :--- | :--- | | `load()` | IE 9+ | Supported | Supported | Supported | Safari 6+ | *Note: Internet Explorer 8 and earlier versions do not support the `load()` method.* --- ## Code Examples ### Example 1: Dynamically Changing Video Sources and Reloading The most common use case for `load()` is when you need to switch the video or audio source dynamically using JavaScript. ```html ``` ### Example 2: Resetting a Media Element If you want to stop a video or audio file from playing and reset it back to its initial loading state (buffered state and poster frame), you can call `load()`. ```javascript var video = document.getElementById("videoPlayer"); function resetVideo() { // Stops playback, resets the playhead to 0, and reloads the media video.load(); } ``` --- ## Important Considerations 1. **When is `load()` required?** * If you modify the `` elements nested inside a `
← Av Met PlayAv Met Canplaytype β†’