> mp.setAudioStreamType(2); You should be using a constant here from http://code.google.com/android/reference/android/media/AudioManager.html , I'm guessing AudioManager.STREAM_MUSIC
Additionally, do you even need to set this? Finally, try using http://code.google.com/android/reference/android/media/MediaPlayer.html#create(android.content.Context,%20android.net.Uri,%20android.view.SurfaceHolder) . It should do the same things you're doing basically, but perhaps not. Cheers, Justin Android Team @ Google On Oct 26, 12:11 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I've been trying to play videos obtained as a raw resource, here is > what I did > MediaPlayer mp = new MediaPlayer(); > mp.setDisplay(getHolder()); > mp.setDataSource(getContext().getResources().openRawResourceFd(R.raw.myvideo).getFileDescriptor()); > mp.setAudioStreamType(2); > mp.prepare(); > mp.start(); > ... > > this is not the exact code (deleted my last trial after it became > horrendous)! but thats basically what I did > > I always got this exception: > > error: Prepare failed.: status=0xFFFFFFFC > java.io.IOException: Prepare failed.: status=0xFFFFFFFC > > note that this worked perfectly with mp3s (without the setDisplay call > ofc) > > I Googled the exception, found out that it was a common problem but > haven't found any clear solutions, the only lead i found was > a guy saying that it was a file format problem, however i tried this > with many different 3gp, mp4 files > > was hoping anyone could help me with this issue... thanks in advance > and best regards to you all --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---