How to get win-win playback? In mediaplayer for android

I am trying to play a continuous stream using android mediaplayer.but, I can’t avoid a break in playback by updating the datasource mediaplayer.Hw data file, can I solve this problem? thanks in advance

+3
source share
1 answer

The only way to ensure that there are no gaps in playback is to download the entire file first and start playback when finished. Otherwise, if you lose contact before the file completes the download, pause is inevitable.

I would download the background thread using the runnable / handler mechanism to a temporary location. The handler is called when the download is complete, and you load the file into the MediaPlayer instance in the handler.

+1
source

Source: https://habr.com/ru/post/1740925/


All Articles