Agora Java API Reference for Android

Public Member Functions | Public Attributes | List of all members
agora::rtc::VideoCanvas Struct Reference

Attributes of the video canvas object. More...

`#include <AgoraBase.h>`

## Public Member Functions
| VideoCanvas (view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt)
| VideoCanvas (view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u)
| VideoCanvas (view_t v, media::base::RENDER_MODE_TYPE m, VIDEO_MIRROR_MODE_TYPE mt, uid_t u, uid_t subu)

## Public Attributes
uid_t | uid
uid_t | subviewUid
view_t | view
uint32_t | backgroundColor
media::base::RENDER_MODE_TYPE | renderMode
VIDEO_MIRROR_MODE_TYPE | mirrorMode
VIDEO_VIEW_SETUP_MODE | setupMode
VIDEO_SOURCE_TYPE | sourceType
int | mediaPlayerId
Rectangle | cropArea
bool | enableAlphaMask
media::base::VIDEO_MODULE_POSITION | position

## Detailed Description

Attributes of the video canvas object.

## Member Data Documentation

## ◆ uid

uid_t agora::rtc::VideoCanvas::uid

User ID that publishes the video source.

## ◆ subviewUid

uid_t agora::rtc::VideoCanvas::subviewUid

The ID of the user who publishes a specific sub-video stream within the mixed video stream.

## ◆ view

view_t agora::rtc::VideoCanvas::view

The video display window.

Note
  In one `VideoCanvas`, you can only choose to set either `view` or `surfaceTexture`. If both are set, only the settings in `view` take effect.

## ◆ backgroundColor

uint32_t agora::rtc::VideoCanvas::backgroundColor

The background color of the video canvas in RGBA format. The default value is 0x00000000, which represents black.

## ◆ renderMode

media::base::RENDER_MODE_TYPE agora::rtc::VideoCanvas::renderMode

The rendering mode of the video. See `RENDER_MODE_TYPE`.

## ◆ mirrorMode

VIDEO_MIRROR_MODE_TYPE agora::rtc::VideoCanvas::mirrorMode

The mirror mode of the view. See `VIDEO_MIRROR_MODE_TYPE`.

Note
  - 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.

## ◆ setupMode

VIDEO_VIEW_SETUP_MODE agora::rtc::VideoCanvas::setupMode

Setting mode of the view. See `VIDEO_VIEW_SETUP_MODE`.

## ◆ sourceType

VIDEO_SOURCE_TYPE agora::rtc::VideoCanvas::sourceType

The type of the video source. See `VIDEO_SOURCE_TYPE`.

## ◆ mediaPlayerId

int agora::rtc::VideoCanvas::mediaPlayerId

The ID of the media player. You can get the Device ID by calling `getMediaPlayerId`.

## ◆ cropArea

Rectangle agora::rtc::VideoCanvas::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.

## ◆ enableAlphaMask

bool agora::rtc::VideoCanvas::enableAlphaMask

(Optional) Whether to enable alpha mask rendering:

- `true`: Enable alpha mask rendering.
- `false`: (Default) Disable 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.
  Note
- The receiver can render alpha channel information only when the sender enables alpha transmission.
- To enable alpha transmission, `technical support`.

## ◆ position

media::base::VIDEO_MODULE_POSITION agora::rtc::VideoCanvas::position

The observation position of the video frame in the video link. See `VIDEO_MODULE_POSITION`.