goldenptr
goldenptr

Reputation: 331

Exoplayer to play live video chunks received as byte arrays one after another maintaining continuity

I am trying to develop a live video streaming application using bluetooth.

I already have completed up to receiving video chunks in the client side where a callback gets called when each video chunk arrives, like the one given below.

    chunkReceived(Byte[] chunk)
    {

    }

Now I have to develop a video player using Exoplayer which goes on playing the video chunks as they are received. I had a look into the Exoplayer documentation but it mostly deals with playing from a URI and there is not enough explanation on how to play video chunks one after another maintaining continuity.

Can any one please help me on this or share your ideas on this.

Upvotes: 3

Views: 1791

Answers (1)

Christo
Christo

Reputation: 301

For custom sources, com.google.android.exoplayer.upstream.DataSource interface has to be implemented.

In the callback you mentioned, store the data and in the read function of new datasource, provide the stored data.

For supporting RTP in exoplayer for a previous project, I did the same and it worked perfectly.

Upvotes: 1

Related Questions