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
For Android and iOS platforms, when the video source is a transcoded video stream (VideoSourceTranscoded), this parameter indicates the user ID of the publisher of the transcoded video stream.
Note: The local user's uid defaults to 0. If you want to use a custom uid to render the local view, you also need to pass sourceType.
subviewUid
User ID of the publisher of a sub-video stream in the transcoded video.
view
Video display window.
Note: In a single VideoCanvas, only one of view or surfaceTexture can be set. If both are set, only the view setting takes effect.
renderMode
Video render mode. See RenderModeType.
mirrorMode
View mirror mode. See VideoMirrorModeType.
Note:
  • Local view mirror mode: If you use the front camera, local view mirror mode is enabled by default; if you use the rear camera, it is disabled by default.
  • Remote user view mirror mode: Disabled by default.
sourceType
Type of video source. See VideoSourceType.
setupMode
View setup mode. See VideoViewSetupMode.
mediaPlayerId
Media player ID. Obtainable via getMediaPlayerId.
cropArea
(Optional) Display area of the video frame. See Rectangle. width and height indicate the pixel width and height of the video in this area. Default is empty (width or height is 0), meaning the video frame is displayed at its actual resolution.
backgroundColor
Background color of the video canvas in RGBA format. Default is 0x00000000, which represents black.
position
Position of the video frame in the video pipeline. See VideoModulePosition.