Android媒体播放器错误(1,-2147483648)

时间:2013-05-02 12:04:44

标签: android android-mediaplayer

这是link我试图播放音频而没有运气。

我的代码是:

MediaPlayer player = new MediaPlayer();
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
try {
    player.setDataSource("http://www.nomadicsmart.com/co-notes/files/testsong_20_sec.mp3");
    //   player .prepare();
    player.prepareAsync();
    player.setOnPreparedListener(new OnPreparedListener() { 
        public void onPrepared(MediaPlayer mp) {
            Log.d("f","media3");
            mp.seekTo(0);
            mp.start();
        }
    });
    //  player .seekTo(0);
    } catch (IllegalArgumentException e1) {
        e1.printStackTrace();
    } catch (SecurityException e1) {
        e1.printStackTrace();
    } catch (IllegalStateException e1) {
        e1.printStackTrace();
    } catch (IOException e1) {
        e1.printStackTrace();
    }

0 个答案:

没有答案