Agora RTC Objective-C API Reference Refactor

Properties
AgoraRtcVideoCanvas Class Reference

Inherits <NSObject>.

## Properties
NSUInteger | uid
NSUInteger | subviewUid
VIEW_CLASS *_Nullable | view
AgoraVideoRenderMode | renderMode
AgoraVideoMirrorMode | mirrorMode
AgoraVideoViewSetupMode | setupMode
AgoraVideoSourceType | sourceType
int | mediaPlayerId
CGRect | cropArea
UInt32 | backgroundColor
BOOL | enableAlphaMask
AgoraVideoModulePosition | position

## Property Documentation

## ◆ uid

- (NSUInteger) uid
| read write nonatomic assign

User ID that publishes the video source.

## ◆ subviewUid

- (NSUInteger) subviewUid
| read write nonatomic assign

The video display window.

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

## ◆ view

- (VIEW_CLASS* _Nullable) view
| read write nonatomic strong

The video display window. In one `AgoraRtcVideoCanvas`, you can only choose to set either `view` or `surfaceTexture`. If both are set, only the settings in `view` take effect.

## ◆ renderMode

- (AgoraVideoRenderMode) renderMode
| read write nonatomic assign

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

## ◆ mirrorMode

- (AgoraVideoMirrorMode) mirrorMode
| read write nonatomic assign

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

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

- (AgoraVideoViewSetupMode) setupMode
| read write nonatomic assign

Setting mode of the view. See `AgoraVideoViewSetupMode`.

## ◆ sourceType

- (AgoraVideoSourceType) sourceType
| read write nonatomic assign

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

## ◆ mediaPlayerId

- (int) mediaPlayerId
| read write nonatomic assign

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

## ◆ cropArea

- (CGRect) cropArea
| read write nonatomic assign

(Optional) Display area of the video frame, see `CGRect`. `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.

## ◆ backgroundColor

- (UInt32) backgroundColor
| read write nonatomic assign

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

## ◆ enableAlphaMask

- (BOOL) enableAlphaMask
| read write nonatomic assign

(Optional) Whether to enable alpha mask rendering:

- `YES`: Enable alpha mask rendering.
- `NO`: (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

- (AgoraVideoModulePosition) position
| read write nonatomic assign

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