Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to draw circle,rectangle manually on android videoplayer

Tags:

android

I just wanna draw circle,rectangle or something manually on video player(while video playing) in android.Is it possible?If any code samples are much better.

Thanks.

like image 783
sanjay Avatar asked Jun 29 '12 07:06

sanjay


1 Answers

there is already an answer to ur question:

See here

Quoted from the post:

SurfaceView probably does not work like a regular View in this regard.

Instead, do the following:

  1. Put your SurfaceView inside of a FrameLayout or RelativeLayout in your layout XML file, since both of those allow stacking of widgets on the Z-axis
  2. Move your drawing logic into a separate custom View class
  3. Add an instance of the custom View class to the layout XML file as a child of the FrameLayout or RelativeLayout, but have it appear after the SurfaceView

This will cause your custom View class to appear to float above the SurfaceView.

There is also a sample project to your need

See here

like image 61
John the Traveler Avatar answered Oct 20 '22 06:10

John the Traveler