title: Android java.io.IOException with audio streaming
body: <p>When I am running audioplayer in streaming by using webservices I am getting IOException</p>
  
  <pre><code>08-19 09:24:54.235: WARN/System.err(394): java.io.IOException: Prepare failed.: status=0x64
  08-19 09:24:54.235: WARN/System.err(394):     at android.media.MediaPlayer.prepare(Native Method)
  08-19 09:24:54.235: WARN/System.err(394):     at com.sparsh.xavier.media.activity.AudioPlayerActivity$6$1.run(AudioPlayerActivity.java:183)
  08-19 09:24:54.295: WARN/System.err(394):     at android.os.Handler.handleCallback(Handler.java:587)
  08-19 09:24:54.295: WARN/System.err(394):     at android.os.Handler.dispatchMessage(Handler.java:92)
  08-19 09:24:54.295: WARN/System.err(394):     at android.os.Looper.loop(Looper.java:123)
  08-19 09:24:54.295: WARN/System.err(394):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  08-19 09:24:54.295: WARN/System.err(394):     at java.lang.reflect.Method.invokeNative(Native Method)
  08-19 09:24:54.295: WARN/System.err(394):     at java.lang.reflect.Method.invoke(Method.java:521)
  08-19 09:24:54.295: WARN/System.err(394):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  08-19 09:24:54.295: WARN/System.err(394):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  08-19 09:24:54.295: WARN/System.err(394):     at dalvik.system.NativeStart.main(Native Method)
  08-19 09:24:55.075: ERROR/AudioService(68): Media server died.
  </code></pre>
  
  <p>I have the above error when I am using below url
  <a href="http://cdnbakmi.kaltura.com/p/672322/sp/67232200/raw/entry_id/0_281db5u2/version/0" rel="nofollow">http://cdnbakmi.kaltura.com/p/672322/sp/67232200/raw/entry_id/0_281db5u2/version/0</a></p>
  
  <p>but execute my application with out any errors when I am trying with sample url <a href="http://www.pocketjourney.com/downloads/pj/tutorials/audio.mp3" rel="nofollow">http://www.pocketjourney.com/downloads/pj/tutorials/audio.mp3</a> </p>
  
  <p>I write bellow code for my application</p>
  
  <pre><code>mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  mediaPlayer.reset();
  mediaPlayer.setDataSource(audioURL);
  mediaPlayer.prepare(); // might take long! (for buffering, etc)
  mediaPlayer.start();
  </code></pre>
  
  <p>please tell me is this problem with my coding or with providing url.</p>
  
  <p>thanks in advance.</p>
  
  <p><strong>edit:</strong>
  I solve this problem by using this code</p>
  
  <pre><code>HttpURLConnection conn = (HttpURLConnection) url.openConnection();
  conn.setInstanceFollowRedirects(false);
  String redirectUrl = conn.getHeaderField("Location");
  </code></pre>
  
  <p>I get the redirect url by using above code.</p>