English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTMLMediaElement.buffered returns a read-only TimeRanges object that returns the buffered area of the media
HTML Audio/Video DOM Reference Manual
Get the first buffered range of the video in seconds (partial):
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML Audio/Video buffered property usage-Basic Tutorial(oldtoolbag.com>/title> </head> <body> <button onclick="getFirstBuffRange()" type="button">Get the first buffered range of the video</button> <br> <video id="video1" controls="controls"> <source src="movie.mp4" type="video/mp4"> <source src="movie.ogg" type="video/ogg> Your browser does not support HTML5 video tag. </video> <script> myVid=document.getElementById("video1"); function getFirstBuffRange() { alert("Start: " + myVid.buffered.start(0) + " End: " + myVid.buffered.end(0)); } </script> </body> </html>Test to see </›
The buffered property returns a TimeRanges object.
The TimeRanges object represents the user's audio/Video buffered range.
The buffered range is the buffered audio/The time range of the video. If the user skips the audio/If the video is buffered, multiple buffered ranges will be obtained.
Note: This property is read-only.
IEFirefoxOperaChromeSafari
All major browsers support the buffered property.
Note:Internet Explorer 8 And earlier versions do not support this property.
audio|video.buffered
Type | Description |
---|---|
TimeRanges object | Represents audio/The buffered part of the video. Properties of TimeRanges objects:
Note:The first buffered rangeSubscriptIs 0. |