Set Local Audio And Video Properties
setLocalVideoMirrorMode
- A brief description - Set local video mirror mode
Default: TKVideoMirrorModeAuto, which means that the mirror mode is enabled when using the front camera, and disabled when using the rear camera.
- Interface Name
- (int)setLocalVideoMirrorMode(TKVideoMirrorMode mirrorMode);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
mode | Yes | TKVideoMirrorMode | Video mirror mode, enumerated values, see the definition in the “Extended Fields” section |
- Method Example
TKRoomManager.getInstance().setLocalVideoMirrorMode(TKVideoMirrorMode.TKVideoMirrorModeAuto);
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |
setVideoProfile
-
A brief description - Set local video resolution
-
Interface Name
- (int)setVideoProfile(VideoProfile videoProfile);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
profile | Yes | TKVideoProfile | Video resolution, see the definition in the “Extended Fields” section |
- Method Example
1 2 3 4 5 |
|
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |
selectCameraPosition
-
A brief description - Switch between front and rear cameras
-
Interface Name
- (int)selectCameraPosition(boolean front);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
front | Yes | boolean | true: Indicates the front camera, false: Indicates the rear camera |
- Method Example
TKRoomManager.getInstance().selectCameraPosition(true);
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |
setCameraOrientation
-
A brief description - Switch the direction of local camera capture (the SDK’s default method of obtaining screen orientation may not be accurate on some devices, so it is recommended that users obtain and set it themselves)
-
Interface Name
- (void)setCameraOrientation(TKRoomManagerImpl.TKVideoRotation rotation);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
rotation | Yes | TKVideoRotation | Rotation angle |
- Method Example
TKRoomManager.getInstance().setCameraOrientation(TKRoomManagerImpl.TKVideoRotation.RTCVideoRotation_180);
- Return Value Description
Type | Description |
---|---|
None | None |
enableLocalVideo
- A brief description - Enable/disable local camera
The camera is enabled by default.
- Interface Name
- (int)enableLocalVideo(boolean enable);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
enable | Yes | boolean | Whether to disable, true: Enable the camera, false: Disable the camera |
- Method Example
TKRoomManager.getInstance().enableLocalVideo(false);
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |
enableLocalAudio
- A brief description - Enable/disable local audio
Audio is enabled by default.
- Interface Name
- (int)enableLocalAudio(boolean enable);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
enable | Yes | boolean | Whether to disable, true: Enable audio, false: Disable audio |
- Method Example
TKRoomManager.getInstance().enableLocalAudio(true);
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |
useLoudSpeaker
- A brief description - Whether audio is played through speakers
By default, it is played through speakers, in speaker mode.
- Interface Name
- (int)useLoudSpeaker(boolean use);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
use | Yes | boolean | true: Speaker, false: Off |
- Method Example
TKRoomManager.getInstance().useLoudSpeaker(false);
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |
setRemoteAudioVolume
-
A brief description - Set the user’s voice volume
-
Interface Name
- (int)setRemoteAudioVolume(double volume, String peerId, int type);
- Parameters
Parameter Name | Required | Type | Description |
---|---|---|---|
volume | Yes | double | Volume level |
peerId | Yes | String | User ID |
type | Yes | int | Media type,1 video,2 MP3/MP4 media,3 screen,4 file media |
- Method Example
TKRoomManagerImpl.getInstance().setRemoteAudioVolume(20, "123", 2);
- Return Value Description
Type | Description |
---|---|
int | 0: Indicates successful invocation; Non-zero: Indicates invocation failure |