MediaPlayer流不适用于Galaxy SII

时间:2014-10-12 16:02:18

标签: android stream android-mediaplayer

我的客户说流不适合他,他在Galaxy SII上。我不知道为什么,它对我有用。

player = new MediaPlayer();
try {
    player.setDataSource("http://radijas.tau.lt:8000/stream");
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalStateException e) {
    e.printStackTrace();
} catch (IOException e) {
    e.printStackTrace();
}
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setOnBufferingUpdateListener(new OnBufferingUpdateListener() {
public void onBufferingUpdate(MediaPlayer mp, int percent) {
    Log.i("Buffering", "" + percent);
}
});
//...
player.prepareAsync();
player.setOnPreparedListener(new OnPreparedListener()
{
    public void onPrepared(MediaPlayer mp)
    {
        player.start();
    }
});

0 个答案:

没有答案