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

## Detailed Description

Properties of the video canvas object.

## Property Documentation

## ◆ uid

- (NSUInteger) uid
| read write nonatomic assign

The user id of local video.

## ◆ subviewUid

- (NSUInteger) subviewUid
| read write nonatomic assign

The uid of video stream composing the video stream from transcoder which will be drawn on this video canvas.

## ◆ view

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

The video display view. The SDK does not maintain the lifecycle of the view.

The view can be safely released after calling [leaveChannel]([AgoraRtcEngineKit leaveChannel:]) with a returned value. The SDK keeps a cache of the view value, so calling [setupLocalVideo]([AgoraRtcEngineKit setupLocalVideo:]) to set the view value to nil can clear the cache before switching or releasing the view.

## ◆ renderMode

- (AgoraVideoRenderMode) renderMode
| read write nonatomic assign

The video render mode. See AgoraVideoRenderMode. The default value is AgoraVideoRenderModeHidden.

## ◆ mirrorMode

- (AgoraVideoMirrorMode) mirrorMode
| read write nonatomic assign

The video mirror mode. See AgoraVideoMirrorMode. The default value is AgoraVideoMirrorModeAuto.

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

The mode of setting up video view. See AgoraVideoViewSetupMode. The default value is AgoraVideoViewSetupReplace.

## ◆ sourceType

- (AgoraVideoSourceType) sourceType
| read write nonatomic assign

The video source type. See AgoraVideoSourceType The default value is AgoraVideoSourceTypeCamera.

## ◆ mediaPlayerId

- (int) mediaPlayerId
| read write nonatomic assign

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

## ◆ cropArea

- (CGRect) cropArea
| read write nonatomic assign

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

- (UInt32) backgroundColor
| read write nonatomic assign

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

## ◆ enableAlphaMask

- (BOOL) enableAlphaMask
| read write nonatomic assign

Whether to apply alpha mask to the video frame if exsit: YES: Apply alpha mask to video frame. NO: (Default) Do not apply alpha mask to video frame.

## ◆ position

- (AgoraVideoModulePosition) position
| read write nonatomic assign

The video frame position in pipeline. See AgoraVideoModulePosition. The default value is AgoraVideoModulePositionPostCapture.