The Buffers

Overview

The Buffers is the part of the RxPlayer choosing which segments to request and pushing them to the corresponding SourceBuffer.

It tries to choose the optimal segments based on:

  • current network conditions

  • browser capacities

  • the current playing conditions

  • what segments it already has bufferized

The BufferOrchestrator #####################################################$

The BufferOrchestrator is the main entry point to interact with the buffer. It completely takes care of segment downloading and pushing for a whole content.

To do so, it creates the right PeriodBuffers depending on the current conditions. For more informations on it, you can look at the BufferOrchestrator documentation.

The PeriodBuffer

The PeriodBuffer creates and destroys AdaptationBuffers for a single manifest’s Period. If no SourceBuffer was created, it lazily creates one (this only applies to custom SourceBuffer - not managed by the browser - like text).

The AdaptationBuffer

The AdaptationBuffer creates and destroys RepresentationBuffers for a single manifest’s Adaptation (such as a particular audio language, a video track etc.) based on the current conditions (network bandwidth, browser conditions…).

The RepresentationBuffer will then have the task to do the segment-downloading and pushing itself.

The RepresentationBuffer

The RepresentationBuffer is the part that actually calculates which segments should be downloaded.

You can have more informations on it in the RepresentationBuffer documentation.

The SegmentBookkeeper

The SegmentBookkeeper keeps track of which segments is currently bufferized to avoid unnecessary re-downloadings of them.

You can have more informations on it in the SegmentBookkeeper documentation.