Using FileDescriptor with HTTP URLs in Android?
<p>I was hoping this was going to work for getting Android's MediaPlayer to stream from a URL using authentication, but now I'm not so sure. I have no problem getting it to stream from an open server (no authentication) but I don't see any way to tell MediaPlayer to use basic authentication unless perhaps using the FileDescriptor argument works? So I tried this but got the following error:</p>

<pre><code>IllegalArgumentException: Expected file scheme in URI http://www.myserver.com/music.mp3
</code></pre>

<p>My code looks something like this:</p>

<pre><code>File f = new File(new URL("http://www.myserver.com/music.mp3").toURI());
FileInputStream fis = new FileInputStream(f);
mediaplayer.SetDataSource(fis.getFD());
</code></pre>

<p>Is it correct to say that a FileDescriptor can only be used with local <code>file://</code> URLs and not normal <code>http://</code> URLs? If so, does anyone have any other ideas on how to stream from a server that requires authentication using Android's MediaPlayer?</p>
