The Stream

Overview

The Stream is the part of the RxPlayer choosing which segments to request and pushing them to the corresponding media buffer (called SegmentBuffers in the RxPlayer) so they can later be decoded.

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 StreamOrchestrator

The StreamOrchestrator is the main entry point to interact with this part of the code.

It completely takes care of segment downloading and pushing for a whole content.

To do so, it creates the right PeriodStreams depending on the current conditions. For more information on it, you can look at the StreamOrchestrator documentation.

The PeriodStream

The PeriodStream creates and destroys AdaptationStreams for a single Manifest’s Period. If no SegmentBuffer: was created, it lazily creates one.

The AdaptationStream

The AdaptationStream creates and destroys RepresentationStreams 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 RepresentationStream will then have the task to do the segment-downloading and pushing itself.

The RepresentationStream

The RepresentationStream is the part that actually process which segments should be downloaded.

You can have more information on it in the RepresentationStream documentation.