VideoCanvas

Attributes of the video canvas object.

public class VideoCanvas
    {

        public view_t view;
        public uint uid;
        public uint subviewUid;
        public uint backgroundColor;
        public RENDER_MODE_TYPE renderMode;
        public VIDEO_MIRROR_MODE_TYPE mirrorMode;
        public VIDEO_VIEW_SETUP_MODE setupMode;
        public VIDEO_SOURCE_TYPE sourceType;
        public int mediaPlayerId;
        public Rectangle cropArea;
        public bool enableAlphaMask;
        public VIDEO_MODULE_POSITION position; 
    };

Attributes

uid
User ID that publishes the video source.
For Android and iOS platforms, when the video source is a mixed video stream ( VIDEO_SOURCE_TRANSCODED), this parameter represents the ID of the user who publishes the mixed video stream.
subviewUid
The ID of the user who publishes a specific sub-video stream within the mixed video stream.
view
The video display window.
Attention: In one VideoCanvas, you can only choose to set either view or surfaceTexture. If both are set, only the settings in view take effect.
renderMode
The rendering mode of the video. See RENDER_MODE_TYPE.
mirrorMode

The mirror mode of the view. See VIDEO_MIRROR_MODE_TYPE.

Attention:
  • For the mirror mode of the local video view: 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.
  • For the remote user: The mirror mode is disabled by default.
uid
The user ID.
sourceType
The type of the video source. See VIDEO_SOURCE_TYPE.
setupMode
Setting mode of the view. See VIDEO_VIEW_SETUP_MODE.
mediaPlayerId
The ID of the media player. You can get the Device ID by calling GetId.
This parameter is required when sourceType is VIDEO_SOURCE_MEDIA_PLAYER.
cropArea
(Optional) Display area of the video frame, see Rectangle. 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.
backgroundColor
The background color of the video canvas in RGBA format. The default value is 0x00000000, which represents completely transparent black.
enableAlphaMask
(Optional) Whether the receiver enables alpha mask rendering:
  • true: The receiver enables alpha mask rendering.
  • false: (Default) The receiver disables 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.

Attention:
  • The receiver can render alpha channel information only when the sender enables alpha transmission.
  • To enable alpha transmission, technical support.
position
The observation position of the video frame in the video link. See VIDEO_MODULE_POSITION.