VideoCanvas

Properties 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;
    };

Properties

uid
For Android and iOS platforms, when the video source is a composite video stream (VIDEO_SOURCE_TRANSCODED), this parameter represents the user ID that publishes the composite video stream.
subviewUid
The user ID that publishes a specific sub-video stream of the composite stream.
view
The video display window.
Note: In a VideoCanvas, you can only set either view or surfaceTexture. If both are set, only the configuration in view takes effect.
renderMode
Video rendering mode. See RENDER_MODE_TYPE.
mirrorMode
View mirroring mode. See VIDEO_MIRROR_MODE_TYPE.
Note:
  • Local view mirroring mode: If you use the front camera, local view mirroring is enabled by default; if you use the rear camera, it is disabled by default.
  • Remote user view mirroring mode: Mirroring is disabled by default for remote users.
sourceType
Type of video source. See VIDEO_SOURCE_TYPE.
setupMode
View setup mode. See VIDEO_VIEW_SETUP_MODE.
mediaPlayerId
Media player ID. You can obtain it via GetId.
cropArea
(Optional) Display area of the video frame. See Rectangle. width and height indicate the pixel width and height of the area. The default is null (width or height is 0), which means the actual resolution of the video frame is displayed.
backgroundColor
Background color of the video canvas in RGBA format. The default value is 0x00000000, which represents black.
enableAlphaMask
Note:
  • The receiver can render alpha channel information only when the sender enables the alpha transmission feature.
  • To enable the alpha transmission feature, please contact technical support.
(Optional) Whether to enable alpha mask rendering:
  • true: Enable alpha mask rendering.
  • false: (Default) Disable alpha mask rendering.
Alpha mask rendering can create transparent images and extract portraits from videos. When used with other methods, it enables effects like portrait picture-in-picture and watermarking.
position
The position of the video frame in the video pipeline. See VIDEO_MODULE_POSITION.