1

I am using a simple code to stream a radio from url like this:

       player = new MediaPlayer();
  try {
    player.setDataSource("XYZ.com/streaming link");
    player.prepare();
    player.setOnPreparedListener(new OnPreparedListener() {

        @Override
        public void onPrepared(MediaPlayer mp) {
            // TODO Auto-generated method stub
              player.start();
              ma.MyProgressdis();
        }
    });
} catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
}

But when screen Orientation changes the media player stops for a while and start streaming again. I have tried using onConfigurationChanged method but I am confused about what could I do to continue the streaming without pausing .

Navdroid
  • 1,541
  • 3
  • 25
  • 52

0 Answers0