I'm using MediaPlayer
to stream a radio over HTTP. On Lollipop my stream takes about a minute to start which is unacceptable. It takes about 20 seconds on Kitkat, which is already a pain but now became unusable.
There is a well known problem with this component related to buffering: the amount of bytes to buffer is harcoded and can't be changed.
My code is really standard
player.reset();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setDataSource(streamUrl);
player.prepareAsync();
And on prepared I do
player.start();
I've heard about alternatives as GStreamer
but I couldn't make it work on Windows.
I wonder if anyone has a working solution to stream radio over HTTP with a decent start delay.
EDIT
I tested ExoPlayer but the lower start time I get is 15 seconds. The player is stuck on "preparing" state (not buffering, that's later so far I see).
EDIT
The format of the stream is AAC
EDIT
I tested https://code.google.com/p/aacdecoder-android/ but the only problem this library has is the lack of support to stream pause. It's a requirement of my application to support pause on online stream.