Agora Java API Reference for Android
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
io.agora.rtc2.video.VideoCanvas Class Reference

Public Member Functions

 VideoCanvas (View view)
 
 VideoCanvas (View view, int renderMode, int uid)
 

Public Attributes

View view
 
int uid
 
int renderMode
 
int mirrorMode
 
int setupMode = VIEW_SETUP_MODE_REPLACE
 
int sourceType
 
int mediaPlayerId
 
Rect rect
 
int backgroundColor
 

Static Public Attributes

static final int RENDER_MODE_HIDDEN = 1
 
static final int RENDER_MODE_FIT = 2
 
static final int RENDER_MODE_ADAPTIVE = 3
 
static final int VIEW_SETUP_MODE_REPLACE = 0
 
static final int VIEW_SETUP_MODE_ADD = 1
 
static final int VIEW_SETUP_MODE_REMOVE = 2
 

Detailed Description

The VideoCanvas class.

Member Data Documentation

◆ RENDER_MODE_HIDDEN

final int io.agora.rtc2.video.VideoCanvas.RENDER_MODE_HIDDEN = 1
static

1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.

◆ RENDER_MODE_FIT

final int io.agora.rtc2.video.VideoCanvas.RENDER_MODE_FIT = 2
static

2: 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

final int io.agora.rtc2.video.VideoCanvas.RENDER_MODE_ADAPTIVE = 3
static

3: This mode is deprecated and Agora does not recommend using it.

◆ view

View io.agora.rtc2.video.VideoCanvas.view

Video display window. Must be SurfaceView or TextureView.

◆ uid

int io.agora.rtc2.video.VideoCanvas.uid

The user id of local video.

◆ renderMode

int io.agora.rtc2.video.VideoCanvas.renderMode

The video render mode:

  • RENDER_MODE_HIDDEN(1): (Default)Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.
  • RENDER_MODE_FIT(2): 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): This mode is deprecated and Agora does not recommend using it.

◆ mirrorMode

int io.agora.rtc2.video.VideoCanvas.mirrorMode

The video mirror mode:

  • VIDEO_MIRROR_MODE_AUTO(0): (Default) The mirror mode determined by the SDK. If you use the front camera, the SDK enables the mirror mode; if you use the rear camera, the SDK disables the mirror mode.
  • VIDEO_MIRROR_MODE_ENABLED(1): Enable the mirror mode.
  • VIDEO_MIRROR_MODE_DISABLED(2): Disable the mirror mode.

◆ setupMode

int io.agora.rtc2.video.VideoCanvas.setupMode = VIEW_SETUP_MODE_REPLACE

The mode of setting up video view. The default value is VIEW_SETUP_MODE_REPLAC.

◆ sourceType

int io.agora.rtc2.video.VideoCanvas.sourceType

The video source type. The default value is VIDEO_SOURCE_CAMERA_PRIMARY.

◆ mediaPlayerId

int io.agora.rtc2.video.VideoCanvas.mediaPlayerId

The media player id of AgoraMediaPlayer. It should set this parameter when the sourceType is VIDEO_SOURCE_MEDIA_PLAYER to show the video that AgoraMediaPlayer is playing. You can get this value by calling the method getMediaPlayerId().

◆ rect

Rect io.agora.rtc2.video.VideoCanvas.rect

If you want to display a certain part of a video frame, you can set this value to crop the video frame to show. The default value is empty(that is, if it has zero width or height), which means no cropping.

◆ backgroundColor

int io.agora.rtc2.video.VideoCanvas.backgroundColor

A RGBA value indicates background color of the render view. Defaults to 0x00000000.