VideoCanvas

Properties of the video canvas object.

export class VideoCanvas {
  view?: any
  uid?: number;
  subviewUid?: number;
  backgroundColor?: number;
  renderMode?: RenderModeType
  mirrorMode?: VideoMirrorModeType
  setupMode?: VideoViewSetupMode;
  sourceType?: VideoSourceType
  mediaPlayerId?: number;
  cropArea?: Rectangle;
  enableAlphaMask?: boolean;
  position?: VideoModulePosition;
}

Properties

uid
User ID of the published video source.
subviewUid
Reserved parameter.
view
Video display window.
renderMode
Video rendering mode. See RenderModeType.
mirrorMode
View mirroring mode. See VideoMirrorModeType.
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: Disabled by default.
sourceType
Type of video source. See VideoSourceType.
setupMode
View setup mode. See VideoViewSetupMode.
mediaPlayerId
Media player ID. You can get it via getMediaPlayerId.
cropArea
(Optional) Display area of the video frame. See Rectangle. width and height represent the pixel width and height of the area. The default is an empty value (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. Default 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 video. When used with other methods, it can achieve effects such as picture-in-picture portraits or watermarking.
position
Position of the video frame in the video pipeline. See VideoModulePosition.