How streaming flow works ?

Gaurav Bansal
2 min readApr 5, 2020

Streaming is not only about proving media url to player and listen the music but it is actually an underlying architecture which facilitates the entire system to support it with content and its mapping urls. We can divide this architecture into below components:

a) Client Box : It can be a android, ios or any frontend app, where user interacts with the UI and give commands to the system to play the content, it is responsible for fetching streaming url and providing it to player engine to play the content.

b) Api Box : To server its client requests, either with the contents to display on UI such as tracks, albums or playlists or It can be streaming urls which are mapped to track IDs.

c) Content Ingestion : It is responsible to upload the media content to the CDN (Content storage server), and retrieving the corresponding streaming url which are mapped to actual file location of media content. This streaming url saved into DB, which later retrieved by API box based on track ID.

Here is the flow diagram of above working.

Streaming Architecture Flow Diagram

Streaming Working flow :

  1. Receives the track object.
  2. Fetch the streaming url from the track object itself.
  3. Provide the streaming url and expiry time to streaming url validator.
  4. Get the validity of the streaming url if it is not expired.
  5. If it’s valid then provide it to the player engine otherwise then make a request to the backend server.
  6. In case if API receives the request for streaming url, then it sends requests to the DB based on the track id.
  7. DB, which contains mapping of streaming url with track id, provides the streaming url,
  8. Then API provides this streaming url back to the client.
  9. Streaming url is provided to the Player engine.
  10. Player engine calls the Exoplayer’s preparePlayer method to start streaming.

Content Ingestion :

a) Media content is uploaded to the CDN service such as akamai.

b) In turn CDN provides the streaming url which maps to the content location.

c) Then this streaming url is saved into the content DB corresponding to the track id.

Let me know in case if you have any questions.

--

--

Gaurav Bansal

AVP Technical Architect in Sony Pictures, Ex Gaana. Interested to share what I learned and what I experienced and enthusiastic to learn more new things everyday