title: I can't play audio from URL by MediaPlayer Android
body: <p>I have some problem with playing audio from url, namely I get two following exceptions:</p>
  
  <pre><code>E/MediaPlayer(3387): error (1, -2147483648)
  E/MediaPlayer(3387): Error (1,-2147483648)
  </code></pre>
  
  <p>In my code, I declare a MediaPlayer object and String with URL</p>
  
  <pre><code>MediaPlayer mMediaPlayer;
  String url ="http://ciacho090.wrzuta.pl/audio/31h2JLMRCE7/eminem_soldier.mp3";
  </code></pre>
  
  <p>In my MainActivity, I initialize mMediaPlayer by default constructor and set stream type</p>
  
  <pre><code>mMediaPlayer = new MediaPlayer();
  mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
  </code></pre>
  
  <p>Then I set source on url and request async prepare catching possibility exceptions by this code:</p>
  
  <pre><code>try
          {
              mMediaPlayer.setDataSource(url);
              mMediaPlayer.prepareAsync();
          }
          catch(IOException e)
          {
              e.printStackTrace();
          }
          catch (IllegalArgumentException e) 
          {
              e.printStackTrace();
                  }
          catch (IllegalStateException e) 
          {
              e.printStackTrace();
          }
  </code></pre>
  
  <p>finally I set onPreparedListener:</p>
  
  <pre><code>mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() 
          {
  
              @Override
              public void onPrepared(MediaPlayer mp) 
              {
                  mp.start();
              }
          });
  </code></pre>
  
  <p>I get above exceptions and the music doesn't play. In Manifest, I have declared these permissions and min sdk version to 8</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt; //i know- it's unneccesary
  </code></pre>
  
  <p>Maybe settings in manifest are cause of issues or url link to music file. I don't know whether it's capable to progressive download. Maybe can You give me some link? And why it doesn't work?</p>