On May 27, 12:39 pm, Marco Nelissen <marc...@android.com> wrote:
> On Wed, May 27, 2009 at 10:23 AM, Hamy <hamilt...@gmail.com> wrote:
>
> > Marco,
>
> > Thank you so much! I just spent a day and a half trying every example
> > I could get my hands on, and about 2 minutes before you replied I
> > found a hint that video could not be a raw resource. I had just been
> > adapting every example to include that, and it never occurred to me
> > that might be the problem!
>
> > The dev guide I reference is here
> >http://developer.android.com/guide/topics/media/index.html
> > It is very lacking on video info in general, but in particular it
> > never mentions that video cannot be a raw resource, and I never found
>
> That is not entirely true. You can't play video from a resource using any of
> the MediaPlayer.create() convenience functions, however you can create a new
> MediaPlayer with 'new' and then use setDataSource(int resourceid) to make it
> play from a resource, including video.
>
Hm, I don't see that overload in 
http://developer.android.com/reference/android/media/MediaPlayer.html
. All I see are:
setDataSource(FileDescriptor), setDataSource(String), setDataSource
(Context, Uri), setDataSource(FileDescriptor, long, long)

I guess there is some way to get a FileDescriptor from the resourceID
- I think there is, but I cannot remember it.

> that on Google's site anywhere! I would like to file a issue, but
>
> > before I do, do you know if they include it elsewhere? I don't want to
> > turn in an issue that says it is never mentioned, and then have them
> > dismiss it because it was mentioned somewhere I didn't look.
>
> It's not documented like that explicitly, however it follows implicitly from
> the fact that MediaPlayer.create() returns a MediaPlayer that has already
> been prepare()d, and the fact that you must call setDisplay() before calling
> prepare(). The latter is actually documented poorly, now that I look at it.
> It's mentioned in the doc for prepare(), but not in the doc for
> setDisplay(), and the "Valid and invalid states" section very misleadingly
> says that setDisplay() can be called in any state (which is technically
> true, though it won't have any effect in many of those states).

I was wondering. I had never heard that before, and I did read that
state description.
If I missed it I figure others might be making the same mistake.

--~--~---------~--~----~------------~-------~--~----~
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
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to