媒体播放器无法在<中传输Icecast2网址4.1

时间:2013-09-07 11:23:45

标签: android icecast

我可以在4.1+版本中播放Icecast2网址,但在早期版本中,它会抛出IOException。

我已经使用此代码播放音频流。

try {
    this.mPlayer = new MediaPlayer();
    this.mPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
    //this.mPlayer = MediaPlayer.create(context,Uri.parse("http://176.31.115.196:8214/"));
    this.mPlayer = MediaPlayer.create(context, Uri.parse("http://184.107.191.197:8065/live"));
    this.mPlayer.setOnPreparedListener(new OnPreparedListener() {
        public void onPrepared(MediaPlayer mp) {
            mp.start();
        }
    });
    } catch (IllegalStateException e) {
        Log.d(TAG, "IllegalStateException: " + e.getMessage());
    } catch (IllegalArgumentException e) {              
        Log.d(TAG, "IllegalArgumentException: " + e.getMessage());
    } catch (SecurityException e) {
        Log.d(TAG, "SecurityException: " + e.getMessage());
    } catch (Exception e) {
        Log.d(TAG, "Exception: " + e.getMessage());
    }

我有这个例外..

  

错误(1,-2147483648)
   创建失败:
   java.io.IOException:准备失败:status = 0x1
          在android.media.MediaPlayer.prepare(原生方法)
      在android.media.MediaPlayer.create(MediaPlayer.java:632)
      在android.media.MediaPlayer.create(MediaPlayer.java:609)
      在com.Rcc.Common.UserPublicData.createNewMediaPlayer(UserPublicData.java:170)
      在com.Rcc.Submain.PlaySubview $ PrepareStream.doInBackground(PlaySubview.java:837)
      在com.Rcc.Submain.PlaySubview $ PrepareStream.doInBackground(PlaySubview.java:1)
      在android.os.AsyncTask $ 2.call(AsyncTask.java:185)
      at java.util.concurrent.FutureTask $ Sync.innerRun(FutureTask.java:306)
      在java.util.concurrent.FutureTask.run(FutureTask.java:138)
      在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
      at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:581)
      在java.lang.Thread.run(Thread.java:1019)
   例外:null

另一个网址工作正常,只有冰球网的问题。 请注意,在JellyBean版本中,该URL工作正常。

0 个答案:

没有答案