我在codejanitor上的网络服务器是不是专为流媒体设计的?或者我做错了什么?
我尝试了以下两种方法:
try {
mp = MediaPlayer.create(
AmazonClipActivity.this,
Uri.parse("http://codejanitor.us/good.mp3"));
mp.setOnPreparedListener(new OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.start();
}
});
} finally {
if(mp!=null) {
mp.release();
mp =null;
}
}
和
try {
mp = MediaPlayer.create(
AmazonClipActivity.this,
Uri.parse("http://codejanitor.us/good.mp3"));
mp.start();
} finally {
if(mp!=null) {
mp.release();
mp =null;
}
}
AND产生:
05-19 12:27:48.104: DEBUG/MediaPlayer(1730): Couldn't open file on client side, trying server side
05-19 12:27:48.104: INFO/StagefrightPlayer(68): setDataSource('http://codejanitor.us/good.mp3')
05-19 12:27:48.104: INFO/NuHTTPDataSource(68): connect to codejanitor.us:80/good.mp3 @0
05-19 12:27:53.653: INFO/NuCachedSource2(68): ERROR_END_OF_STREAM