Video and graphics on the same view

All your problems with Audio, Video and Images.

Video and graphics on the same view

Postby playnext » Fri Aug 20, 2010 8:40 pm

Hi,

Please explain how could be resolved the problem:
I tried to write the code which draws graphics using canvas on the same view where video is playing.
I use SurfaceView (or VideoView) assigning it to MediaPlayer object.
There is a separate thread where SurfaceHolder.lockCanvas is called to retrieve Canvas object. This object is put as parameter to overridden method SurfaceView.onDraw then some graphics is drawn there but video disappeared. It also disappeared if the method SurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS) was not called before. If it is called the lockCanvas returns null but video is OK in this case (There is some information about such behavior in documentation).
The question is - how is to draw graphics over playing video on the SurfaceView object?
playnext
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Aug 20, 2010 8:14 pm

Top

Re: Video and graphics on the same view

Postby blundell » Fri Aug 27, 2010 12:16 pm

Use a Framelayou with a surface view and another view, then draw on the second view :-)
User avatar
blundell
Master Developer
Master Developer
 
Posts: 1610
Joined: Tue Nov 18, 2008 12:58 pm
Location: UK

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Exabot [Bot] and 8 guests