The video object property buffered is read only property that used to retrieve a TimeRanges object representing the buffered parts of a video. It returns the TimeRanges object that represents the user's buffered ranges of the video.
video : A video element object to retrieve buffered property
1 <html>
2 <style>
3 .container {
4 margin: 10px 0;
5 }
6 </style>
7 <body>
8 <h1>The Video Object</h1>
9 <h2>Example</h2>
10
11 <div>
12 <video id="video" width="320" height="240" controls >
13 <source src="sample.mp4" type="video/mp4">
14 Your browser does not support the video tag.
15 </video>
16 </div>
17 <p>
18 <button onclick="access()">Access</button>
19 </p>
20 <p id="result"></p>
21
22 <script>
23 function access() {
24 const video = document.getElementById("video");
25 const str = `The video buffered length ? <b>${video.buffered.length}</b>`;
26 document.getElementById("result").innerHTML = str;
27 }
28 </script>
29 </body>
30 </html>
Video property buffered
TimeRanges object properties
1. | length : It retrieves the number of buffered ranges in the video |
2. | start(index) : It retrieves the start position of a buffered range |
3. | end(index) : It retrieves the end position of a buffered range |
Related options for your search