Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android MediaPlayer Error (-38,0)

I got a problem with my media player. Sometimes an error occurs and the on error is called. There I have the Mediaplayer and two int as parameters. The first int is "-38" and the second one is "0".

What does that mean?

EDIT: Code: http://pastebin.com/3XBaFYwF

Here's my logcat @Blundell LogCat:

http://pastebin.com/Wbjm3QCW

like image 705
diiiz_ Avatar asked Feb 09 '14 14:02

diiiz_


1 Answers

error 38 means you are asking the MediaPlayer to do something when in the wrong state. You won't be able to fathom your error just from this.

Look at your Logcat before and after this error code and see what else has gone wrong. It's more than like you are calling start before the MediaPlayer has prepared or some other error of state.

see http://developer.android.com/reference/android/media/MediaPlayer.html#StateDiagram

state machine

like image 171
Blundell Avatar answered Oct 01 '22 03:10

Blundell