When using HTML5
the video player, buffered
the property is used to get the extent of the video buffer, and the event SourceBuffer
of onupdateend
is used to notify the client that new video data has been added to the buffer. The property's value changes when onupdateend
the event is fired and new video data is added to the buffer .buffered
In the callback function of this event, the time range of the current buffer of the video can be obtained through the and values buffered
of the property . The value of represents the start time of the buffer, and the value of represents the end time of the buffer. Both values are in seconds.start
end
start
end
As new video data is added to the buffer, buffered
the extent of the is expanded to include the newly added video data. SourceBuffer.appendBuffer()
Specifically, after data is added to the buffer using onupdateend
the event will be fired and the value of buffered.end will be updated with the end time of all data in the buffer.
After buffered
the value changes, the video player can use these values to determine the playable video segment and buffer size to optimize the player's performance and user experience.
It is important to note that as video data is dynamically added to the buffer, buffered
the value may change over time. Therefore, during player implementation, these values should be used to dynamically update progress bars and other UI elements to reflect the current buffering status of the video in a timely manner.