tags:

views:

263

answers:

1

Hi, I am trying to play continuous stream using android mediaplayer.but am not able to avoid gap in playback while updating the datasource file of mediaplayer.Hw can i overcome this problem? Thanks in advance

A: 

The only way to guarantee no gaps in playback is to download the whole file first and start playback when it's finished. Otherwise, if you lose connectivity before the file is finished downloading, pausing is unavoidable.

I'd download on a background thread using the runnable/handler mechanism to a temp location. The handler gets called when downloading is complete, and you load the file into the MediaPlayer instance in the handler.

Rich