Rather, I misread prachi's answer:( The correct description of what
state it must be in is rather different: since setDataSource() IS what
moves the MediaPlayer from the Idle to the Initialized state, you
should not use create(), you should use prepared(), and in the order
prachi said: setDataSource() first, and only after, even immediately
after, call prepare(). You will get an illegal state exception if
setDataSource() is called in any but the Idle state.

You ARE in the Idle state when you call setDataSource(), aren't you?

On Jul 13, 1:02 am, Indicator Veritatis <[email protected]> wrote:
> As prachi's answer implies, you need to be in the prepared state when
> calling setDataSource(). The other way to get there is to call
> MediaPlayer.create(). Both result in the prepared state.
>
> Likewise, you need to make sure the path you give to setDataSource()
> is exactly correct. The best way to do this, instead of hardcoding the
> reference to '/sdcard/', is to use
> android.os.Environment.getExternalStorageDirectory() (q.v.).
>
> On Jul 11, 9:37 pm, Siva <[email protected]> wrote:
>
> > Hi friends/experts,
>
> > I need to download audio from web server and I need to save into
> > device memory.
>
> > Then, I need to play that audio from my application.
>
> > I know, how to play audio if that is available in res/raw folder. But,
> > I can't able to play audio from SD Card...
>
> > I am getting following error:
>
> >     ERROR/PlayerDriver(31): Command PLAYER_SET_DATA_SOURCE completed
> > with an error or info PVMFErrNotSupported
>
> > Can any help me on this. I need this very urgent...
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to