public class VideoView extends SurfaceViewRenderer implements VideoRenderer
VideoTrack
. This class is an extension of SurfaceView
, so it can be placed in your XML view hierarchy.VideoRenderer.Listener
Constructor and Description |
---|
VideoView(android.content.Context context) |
VideoView(android.content.Context context,
android.util.AttributeSet attrs) |
Modifier and Type | Method and Description |
---|---|
void |
applyZOrder(boolean overlaySurface)
Controls placement of the video render relative to other surface.
|
boolean |
getMirror()
Returns whether or not this view is mirroring video.
|
VideoScaleType |
getVideoScaleType()
Returns the current
VideoScaleType . |
protected void |
onAttachedToWindow() |
protected void |
onDetachedFromWindow() |
void |
renderFrame(I420Frame frame)
Provides the YUV frame in I420 format.
|
void |
setListener(VideoRenderer.Listener listener)
Sets listener of rendering events.
|
void |
setMirror(boolean mirror)
Sets whether or not the rendered video should be mirrored.
|
void |
setVideoScaleType(VideoScaleType videoScaleType)
Sets the current scale type to specified value and updates the video.
|
public VideoView(android.content.Context context)
public VideoView(android.content.Context context, android.util.AttributeSet attrs)
protected void onAttachedToWindow()
protected void onDetachedFromWindow()
public boolean getMirror()
public void setMirror(boolean mirror)
public VideoScaleType getVideoScaleType()
VideoScaleType
.public void setVideoScaleType(VideoScaleType videoScaleType)
Note: The scale type will only be applied to dimensions defined as ViewGroup.LayoutParams.WRAP_CONTENT
or a custom value. Setting a width or
height to ViewGroup.LayoutParams.MATCH_PARENT
results in the video being
scaled to fill the maximum value of the dimension.
public void setListener(VideoRenderer.Listener listener)
public void renderFrame(I420Frame frame)
VideoRenderer
renderFrame
in interface VideoRenderer
frame
- I420 YUV framepublic void applyZOrder(boolean overlaySurface)
overlaySurface
- if true, video renderer is placed on top of another video renderer in
the window (but still behind window itself).3.2.2