[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-15 Thread Marco Nelissen
On Sat, Feb 14, 2009 at 9:48 PM, Brendan raven...@gmail.com wrote: Wow, thank you for helping me through this. That was the little last little bit I needed. I finally got the video playing successfully by waiting until surfaceCreated to try calling prepare. Though I have to admit that it

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Marco Nelissen
Several things potentially wrong with your code: - you're using MediaPlayer.create(), which calls prepare() for you. IIRC, setDisplay() needs to be called *before* prepare(), so you won't be able to use any of the MediaPlayer.create convenience methods. - the way you create and use the

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Marco Nelissen
On Sat, Feb 14, 2009 at 1:32 PM, Marco Nelissen marc...@android.com wrote: Several things potentially wrong with your code: - you're using MediaPlayer.create(), which calls prepare() for you. IIRC, setDisplay() needs to be called *before* prepare(), so you won't be able to use any of the

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Brendan
Wow that sounds really convenient. Since the signature of the MediaPlayer.create() that takes a SurfaceHolder requires the second argument to be a URI and not a resource id, I tried creating a URI for the resource by doing this: Uri uri = Uri.parse(android.resource://com.example.www/ +

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Marco Nelissen
On Sat, Feb 14, 2009 at 3:01 PM, Brendan raven...@gmail.com wrote: Wow that sounds really convenient. Since the signature of the MediaPlayer.create() that takes a SurfaceHolder requires the second argument to be a URI and not a resource id, I tried creating a URI for the resource by doing

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Brendan
Thanks for all your help! I've been trying out your original idea, but I still seem to be having issues. I have moved the SurfaceView to main.xml, it looks like this: ?xml version=1.0 encoding=utf-8? LinearLayout xmlns:android=http://schemas.android.com/apk/res/ android

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Marco Nelissen
I think you have to use the SurfaceHolder callbacks to find out when the surface has actually been created, and *then* call setDisplay/prepare/start On Sat, Feb 14, 2009 at 4:28 PM, Brendan raven...@gmail.com wrote: Thanks for all your help! I've been trying out your original idea, but I

[android-developers] Re: MediaPlayer plays sound but screen is black

2009-02-14 Thread Brendan
Wow, thank you for helping me through this. That was the little last little bit I needed. I finally got the video playing successfully by waiting until surfaceCreated to try calling prepare. Though I have to admit that it feels like a lot of code to just to play a video. Thanks again, I hope