Custom VideoView
Purpose
Video streams shall be decoded and displayed using the Android VideoView class. It is necessary to display additional graphical and textual information. Therefore the VideoView class shall be extended.
Overview
The new class - PanView - shall consist of three main building blocks:
The main area to display the video stream. The functionality is identical to the underlying class.
A rectangular drawing area, limited by a line with attributes ovOuterColor and ovOuterStroke, which is defined by top, left, bottom and right coordinates. This area lies within the bounds of the VideoView and serves to draw rectangles, lines.. as it is possible on a Canvas. Specifically the methods
drawRect, drawCircle and drawColor using a Paint shall be available.
A layout with widgets (read from a XML-layout), that can be positioned freely (in one of the four corners) as a group inside the boundaries of the VideoView, based on custom attributes.
Central video dispaly and the two variable areas for drawing and additional widgets.
Details
The following functional requirements shall be fulfilled:
The PanView shall extend the VideoView class.
A drawing area shall be available inside the boundaries of the video display.
The area shall be defined by "top", "right", "bottom", "left".
The area shall be set by reading custom attributes from the layout XML.
A border shall be drawn around the area, taking into account the stroke of the line (i.e. the inner area needs to be used for drawing operations).
The PanView class shall offer methods to draw rectangles, circles, lines and bitmaps.
The drawing area shall be normalized to the interval [0 ... 1], all drawing commands shall only accept this value range.
A method shall be available to inflate a RelativeLayout and to display it in one of the four corners, defined by the attributes "bnXPos" and "btnYPos"
For the buttons an "OnClickListener" and "OnLongClickListener" shall be implemented inside the PanView class (NOT in the activity).
For the drawing area an "OnTouchlistener" shall be implemented, delivering touch events only for the drawing area and calculating touch coordinates in the interval [0 ... 1].
Hint: it may be necessary to work with a SurfaceTexture, as trying to lock the canvas leads to an exception because of SURFACE_TYPE_PUSH_BUFFERS in VideoView class).
Styleables
The extended VideoView shall be configurable by using styleables , described in "".
The follwoing properties shall be editable, using the listed tags: