lolinthedark
lolinthedark

Reputation: 65

How can I avoid accumulating delay in a livestream playback using Flowplayer?

I'm trying to use FlowPlayer to play an audio livestream on my web page (or to be more precise, my web application). The page containing both application and player is supposed to be kept open for long times, like hours, and after a bunch of test I realized the player keeps buffering the audio stream and playing it with delay every time some package was missing (I suppose this happened because of package missing due to instability of my connection). After a bunch of hours, from the original 1-2 second, the stream had piled up something like 30-35 seconds delay.

So, what I'm trying to achieve is: anytime some missing package would cause a delay in the audio stream, the audio stream would avoid this error, even causing the audio to jump, but without piling up any delay.

I searched all over the documentation and the only information about this argument I was able to find was about the buffer length. I actually set the bufferLength to 2, due to my real-time needs (with the default 3 value I had a base 5-6 second delay, not acceptable for the kind of application I'm trying to run), but I can't get a sure method to avoid delay piling.

I catch my real-time stream from a Wowza 2.0 server, using RTMP protocol.

Upvotes: 0

Views: 1601

Answers (1)

lolinthedark
lolinthedark

Reputation: 65

I finally got it to work, I just set my buffer lenght to a lower number (1 to be precise) and added a refresh function to the event handler "onEmptyBuffer" this way every time delay starts piling up, the player refreshes and get back to a 1-2sec delay. This way i only lose 1-2 seconds of communication due to refresh (not so terrible in my case study) though I won't have a delay higher than the original 2-3sec.

Upvotes: 2

Related Questions