Log in or register to post comments

An other quetion about operating view to display above the GLSrufaceView

November 5, 2010 - 1:18am #1

Hello sir, I meet an other quetion about operating view to displaying above the GLSurfaceView.
I do just as CliffWoo, he using a videoview instead of the teapot in the ImageTargets.
I initialize the videoView as belowe :

// Now add the GL surface view. It is important
// that the OpenGL ES surface view gets added
// BEFORE the camera is started and video
// background is configured.
addContentView(mGlView, new LayoutParams(
                            LayoutParams.FILL_PARENT,
                            LayoutParams.FILL_PARENT));


overlayView = View.inflate(this, R.layout.myoverlay, null);
                            addContentView(overlayView, new LayoutParams(
                                                        LayoutParams.FILL_PARENT,
                                                        LayoutParams.FILL_PARENT));
                            mVideoView = (VideoView) overlayView.findViewById(R.id.mVideoView);
                            overlayView.setVisibility(View.INVISIBLE);   

When ImageTargetsRenderer detects the aim image, the Handel send message to the Activity to show the VideoView.
But In my Nexus one, I just Can hear the sound in the video, but can't see the picture and the VideoView. So I try to press the power button in the head of Nexus one to lock the screen for serverl seceonds, When I unlock the screen, I can see the picture in the video and the videoview.
Now I need your help to sovle the problem, How can I get the Picture on the screen at once, when the renderer has detected the aim. Many thanks ~!

Re: An other quetion about operating view to display above the G

May 12, 2011 - 5:35am #8

Thank you very much.

the mVideoView.setZOrderOnTop(true);

solved my problem after 2days.

again, thank you

Re: An other quetion about operating view to display above the G

November 10, 2010 - 5:14am #7

R.layout doesn't seem to be recognised when I try this code.

I probably need to import something but I can't see what.

EDIT: Worked it out. For anyone else you have to add a main.xml fill to the layout folder inside the res folder.

EDIT: Scratch that, it's not working again. Don't know what's going on. It's like the program is just not finding it even though I can see as clear as day that it is there.

EDIT: Again it's just the project not refreshing and re-building. Working again :)

Re: An other quetion about operating view to display above the G

November 7, 2010 - 7:53am #6

So that others can benefit, if you wish to overlay an Android VideoView on top of the QCAR views you will probably need to set the following property:

mVideoView.setZOrderOnTop(true);

This will ensure that the video view remains on top of all other views.

- Kim

Re: An other quetion about operating view to display above the G

November 6, 2010 - 7:24pm #5

Thanks Kim,I fix the problem in your solution on N1~!!

Re: An other quetion about operating view to display above the G

November 6, 2010 - 2:50am #4

I have sent the code to your mail. thanks for your help ~!:)

Re: An other quetion about operating view to display above the G

November 5, 2010 - 7:51pm #3

OK,I will send it soon

Re: An other quetion about operating view to display above the G

November 5, 2010 - 10:31am #2

I'm not sure I can help debug this without seeing the code. Would it be possible to zip up your project and send it to

? If you'd rather not include the video (or if it's too big) simply remove it and I'll substitute a sample video on my end.

Thanks!

- Kim

Log in or register to post comments