title: Android MediaPlayer throwing "Prepare failed.: status=0x1" on 2.1, works on 2.2
body: <p>I've been really banging my head against the table trying to get the MediaPlayer class to try to play h.264-encoded videos on Android 2.1.  My code is rather simple:</p>
  
  <pre><code>  AssetFileDescriptor fileDescriptor = getResources().openRawResourceFd(R.raw.my_movie);
    introMoviePlayer = new MediaPlayer();
    introMoviePlayer.setDataSource(fileDescriptor.getFileDescriptor(), fileDescriptor.getStartOffset(), fileDescriptor.getDeclaredLength());
    introMoviePlayer.prepare();
  </code></pre>
  
  <p>This always throws an exception at <code>prepare()</code>, with the text <code>java.io.IOException: Prepare failed.: status=0x1</code>.  I got a bit more info by using <code>MediaPlayer.create()</code> with a URI, which also throws at <code>prepare()</code>, which is actually called by <code>MediaPlayer.create()</code>, with the message <code>Command PLAYER_PREPARE completed with an error or info PVMFErrResourceConfiguration</code>.</p>
  
  <p>The same code works perfectly in Froyo (2.2).  The videos themselves play fine in the video player app.  Does anyone have perhaps a helpful hint that might help to solve this problem?</p>
  
  <p><strong>Edit</strong>: Still no solution -- very frustrating problem indeed.  However, I have found that by creating a <code>VideoView</code> and setting the URI for the raw video works.  This is very puzzling, as sending the exact same URI through a MediaPlayer class will throw.</p>