Package io.agora.rtc2.video
Class VideoCanvas
java.lang.Object
io.agora.rtc2.video.VideoCanvas
-
Field Summary
FieldsModifier and TypeFieldDescriptionintThe background color of the video canvas in RGBA format.boolean(Optional) Whether to enable alpha mask rendering: - `true`: Enable alpha mask rendering.intThe ID of the media player.int- VIDEO_MIRROR_MODE_AUTO (0): The SDK determines whether to enable the mirror mode.The observation position of the video frame in the video link.Rect(Optional) Display area for the video frame.static final int3: This mode is deprecated and Agora does not recommend using it.static final int2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit).static final int1: Uniformly scale the video until it fills the visible boundaries (cropped).int- RENDER_MODE_HIDDEN (1): Hidden mode.intSetting mode of the view.intThe type of the video source.intThe ID of the user who publishes a specific sub-video stream within the mixed video stream.SurfaceTextureA container that provides video images.intUser ID that publishes the video source.ViewThe video display window.static final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionVideoCanvas(View view) VideoCanvas(View view, int renderMode, int uid) VideoCanvas(View view, int renderMode, int uid, int subviewUid) -
Method Summary
-
Field Details
-
uid
public int uidUser ID that publishes the video source. -
subviewUid
public int subviewUidThe ID of the user who publishes a specific sub-video stream within the mixed video stream. -
RENDER_MODE_HIDDEN
public static final int RENDER_MODE_HIDDEN1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.- See Also:
-
RENDER_MODE_FIT
public static final int RENDER_MODE_FIT2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black.- See Also:
-
RENDER_MODE_ADAPTIVE
public static final int RENDER_MODE_ADAPTIVE3: This mode is deprecated and Agora does not recommend using it.- See Also:
-
VIEW_SETUP_MODE_REPLACE
public static final int VIEW_SETUP_MODE_REPLACE- See Also:
-
VIEW_SETUP_MODE_ADD
public static final int VIEW_SETUP_MODE_ADD- See Also:
-
VIEW_SETUP_MODE_REMOVE
public static final int VIEW_SETUP_MODE_REMOVE- See Also:
-
view
public View viewThe video display window. It must be one `SurfaceView` or `TextureView` object. -
surfaceTexture
public SurfaceTexture surfaceTextureA container that provides video images. When you use this member, you need to implement texture drawing in OPENGL yourself. See `SurfaceTexture`. -
renderMode
public int renderMode- RENDER_MODE_HIDDEN (1): Hidden mode. Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents. - RENDER_MODE_FIT (2): Fit mode. Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to the disparity in the aspect ratio are filled with black. - RENDER_MODE_ADAPTIVE (3): Adaptive mode. Deprecated: This enumerator is deprecated and not recommended for use. -
mirrorMode
public int mirrorMode- VIDEO_MIRROR_MODE_AUTO (0): The SDK determines whether to enable the mirror mode. If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default. - VIDEO_MIRROR_MODE_ENABLED (1): Enable the mirroring mode of the local view. - VIDEO_MIRROR_MODE_DISABLED (2): Disable the mirroring mode of the local view. -
setupMode
public int setupModeSetting mode of the view. - VIEW_SETUP_MODE_REPLACE (0): (Default) Replaces a view. - VIEW_SETUP_MODE_ADD (1): Adds a view. - VIEW_SETUP_MODE_REMOVE (2): Deletes a view. -
sourceType
public int sourceTypeThe type of the video source. See `VideoSourceType`. -
mediaPlayerId
public int mediaPlayerIdThe ID of the media player. You can get the Device ID by calling `getMediaPlayerId`. -
rect
public Rect rect(Optional) Display area for the video frame. See `Rect`. `width` and `height` represent the video pixel width and height of the area. The default value is null (width or height is 0), which means that the actual resolution of the video frame is displayed. -
enableAlphaMask
public boolean enableAlphaMask(Optional) Whether to enable alpha mask rendering: - `true`: Enable alpha mask rendering. - `false`: (Default) Disable alpha mask rendering. Alpha mask rendering can create images with transparent effects and extract portraits from videos. When used in combination with other methods, you can implement effects such as portrait-in-picture and watermarking. -
backgroundColor
public int backgroundColorThe background color of the video canvas in RGBA format. The default value is 0x00000000, which represents black. -
position
The observation position of the video frame in the video link. See `VideoModulePosition`.
-
-
Constructor Details
-
VideoCanvas
public VideoCanvas(View view) -
VideoCanvas
public VideoCanvas(View view, int renderMode, int uid) -
VideoCanvas
public VideoCanvas(View view, int renderMode, int uid, int subviewUid)
-