I didn't setup the audio stream at the beginning, just tried it to see if it has any effect, it didn't have any
how do I use a uri to refer to a local resource in the res folder? what does error code -4 mean ? is there a list of supported video formats or something ? i know for sure now its not related to the set display call as i removed it and an error still occurs i also tried the asynch version of prepare and it produced the same result error (-4,0) On Oct 29, 11:54 pm, "Justin (Google Employee)" <[EMAIL PROTECTED]> wrote: > > mp.setAudioStreamType(2); > > You should be using a constant here > fromhttp://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 > usinghttp://code.google.com/android/reference/android/media/MediaPlayer.ht...) > . 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.myvide > > o).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 [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 -~----------~----~----~----~------~----~------~--~---

