I am streaming a live .mp3
from an online source. The problem is that between prepareAsync()
and onPrepared()
, almost 1 minute passes. That means that prepareAsync
is taking upwards of 1 minute to prepare before playback can start. The code is below:
void start1(String a){
mp.setDataSource(a);
mp.setOnPreparedListener(this);
mp.prepareAsync();
running=true;
}catch(Exception e){
noerror=false;
}
}
@Override
public void onPrepared(MediaPlayer mp1){
Log.d("in here2","okay");
//mp.start();
Log.d("in here2","okay");
}
This is happening in emulator. Is there something wrong with the code?