I have been developing a custom MPEG-DASH streaming player using the HTML5 video element. Essentially, I am setting up a MediaSource and attaching a SourceBuffer to it. After that, I am appending DASH fragments into this sourcebuffer and everything is functioning smoothly.
Now, my goal is to dynamically pre-fetch these segments based on the current time of the media element. However, in doing so, I have encountered numerous uncertainties that are not addressed in the MediaSource documentation.
Is there a way to determine the maximum amount of data that a sourceBuffer can handle at once? If I were to append all the fragments of a very large video into the sourcebuffer, would it be able to accommodate them without issues or would it potentially slow down my browser?
How can I calculate the number of fragments within a sourcebuffer?
What is the method for determining the presentation time or end time of the last segment in the SourceBuffer?
How do I selectively remove specific sets of fragments from the SourceBuffer and replace them with segments of different resolutions? (This is essential for enabling adaptive resolution switching during runtime.)
Thank you.