Skip to main content

Prepare your video player to use QUANTEEC

The QUANTEEC plugin works for web and native Android players by overriding the different requests sent by the player and executing them in HTTP or P2P according to an internal decision process.

Therefore, in order to use the QUANTEEC plugin, your player must be able to:

  • Send the downloaded requests to the QUANTEEC plugin, which will execute them
  • Send the quantity of video data buffered

QUANTEEC plugin architecture

In order to function with the maximum number of players, the QUANTEEC plugin is composed of two different elements:
-The QUANTEEC Plugin Core
-An Adapter. The role of an adapter is to ensure communication between the core of our plugin and the video player. For example, the video player sends HTTP requests to the adapter, which then forwards them to the plugin core. In this way, each video player has its own unique adapter, while the core of our plugin remains the same.

The image below simply describes how the QUANTEEC plugin works.

Architecture

What is needed to integrate QUANTEEC with a video player

Request Interceptor

The QUANTEEC plugin downloads the data required for video playback. In order to do this, it must be able to replace the usual HTTP data download protocol used by the video player.

For example, in the case of the hls.js web player, the QUANTEEC plugin replaces two elements inside the configuration of the player: a pLoader and a fLoader.
As part of the native integration with ExoPlayer, we replace the DataSource with a custom DataSource that calls on QuanteecCore to manage downloads.

To work properly with the QUANTEEC plugin, a player must delegate requests to download the manifest and its contents. The URL of the data that must be downloaded is the only parameter needed when delegating a request to the QUANTEEC plugin; other data can be present (such as the quality index, the segment number, etc.) but are not mandatory. For other requests (such as DRM), the player can either perform them itself or always delegate them to QUANTEEC. Requests delegated to QUANTEEC that do not concern audio or video data will necessarily be made using HTTP.

It is also necessary to document the format of the response to a request made by the player via the QUANTEEC plugin. Then, with this documentation, we will be able to implement a version of the QUANTEEC plugin that will send the downloaded data in a format known to your player.

Requesting the buffer

In order to make the best choice between HTTP and P2P downloading, the QUANTEEC plugin core must be able to know at all times the amount of video data present in the player buffer. In order to work with QUANTEEC, a player's API must include a method for retrieving this data.