I have a situation with the android MediaPlayer object.
I'm playing a m3u8 file from a server and I was wondering if there's a way for the player to load the streaming only once?
What's going on is that I enter the activity, and when this is loading, I go and play the stream, but when I go landscape, the player reloads, causing the app to slow down a bit.
Here's my code, that handles the load thing:
MediaController mc = new MediaController(this);
mVideoView.setMediaController(mc);
final String urlStream = Constantes.URL_VIDEO;
runOnUiThread(new Runnable() {
@Override
public void run() {
startLoader();
mVideoView.setVideoURI(Uri.parse(urlStream));
mVideoView.start();
}
});
Any help is always appreciated!