VideoSurface
This class contains Unity native methods related to video rendering.
SetEnable
Sets whether to enable the video rendering.
public void SetEnable(bool enable) { Enable = enable; }
Parameters
- enable
- Whether to enable the video rendering:
true
: (Default) Enable the video rendering.false
: Disable the video rendering.
SetForUser
Sets the local or remote video display.
public void SetForUser(uint uid = 0, string channelId = "", VIDEO_SOURCE_TYPE source_type = VIDEO_SOURCE_TYPE.VIDEO_SOURCE_CAMERA_PRIMARY) { Uid = uid; ChannelId = channelId; SourceType = source_type; }
Details
Attention:
- Ensure that you call this method in the main thread.
- Ensure that you call this method before binding VideoSurface.cs.
Parameters
- uid
- The ID of remote users, obtained through OnUserJoined. The default value is 0, which means you can see the local video.
- channelId
- The ID of the channel.
- source_type
- The type of the video source. See VIDEO_SOURCE_TYPE.
OnTextureSizeModify
This callback is triggered when the width and height of Texture are changed.
public event OnTextureSizeModifyHandler OnTextureSizeModify;
When the width and height of Texture are changed, the SDK triggers this callback.