跳转至
400-881-9892

文档中心

官方文档,可查阅产品介绍、快速入门、用户指南、开发指南、API参考、SDK参考、帮助等信息。

文档中心 互动课堂

Set local audio and video properties

setLocalVideoMirrorMode
  • Brief description

Set the local video mirror mode

Default: TKVideoMirrorModeAuto, which means that mirror mode is enabled when using the front camera, and disabled when using the rear camera.

  • Interface name

- (int)setLocalVideoMirrorMode:(TKVideoMirrorMode)mode;

  • Parameter
Parameter Name Required Type Description
mode Yes TKVideoMirrorMode The video mirror mode, which is an enumeration value. For detailed definitions, refer to the TKRoomDefine.h
  • Method Example

[_roomMgr setLocalVideoMirrorMode:TKVideoMirrorModeAuto];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

setVideoProfile

  • Brief description

Set the local video resolution

  • Interface name

- (int)setVideoProfile:(TKVideoProfile *)profile;

  • Parameter
Parameter Name Required Type Description
profile Yes TKVideoProfile Video resolution, for detailed definitions, refer to TKRoomDefine.h
  • Method Example
1
2
3
4
5
    TKVideoProfile *videoProfile = [[TKVideoProfile alloc] init];
    videoProfile.width = 640;
    videoProfile.height = 480;
    videoProfile.maxfps = 15;
    [_roomMgr setVideoProfile:videoProfile];
  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

selectCameraPosition

  • Brief description

Switch between front and rear cameras

  • Interface name

- (int)selectCameraPosition:(BOOL)isFront;

  • Parameter
Parameter Name Required Type Description
isFront Yes BOOL YES: Indicates the front camera. NO: Indicates the rear camera.
  • Method Example

[_roomMgr  selectCameraPosition:YES];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

setVideoOrientation

  • Brief description

Set the video capture orientation

If not set, the default capture orientation follows the device's orientation.

  • Interface name

- (int)setVideoOrientation:(UIDeviceOrientation)orientation;

  • Parameter
Parameter Name Required Type Description
orientation Yes UIDeviceOrientation Need to set the device orientation
  • Method Example

[_roomMgr setVideoOrientation:UIDeviceOrientationPortrait];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

enableLocalVideo

  • Brief description

Enable/Disable the local camera

By default, the camera is enabled

  • Interface name

- (int)enableLocalVideo:(BOOL)enable;

  • Parameter
Parameter Name Required Type Description
enable Yes BOOL Disable or not: YES: Enable the camera. NO: Disable the camera.
  • Method Example

[_roomMgr  enableLocalVideo:YES];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

enableLocalAudio

  • Brief description

Enable/Disable the local audio

By default, the audio is enabled.

  • Interface name

- (int)enableLocalAudio:(BOOL)enable;

  • Parameter
Parameter Name Required Type Description
enable Yes BOOL Disable or not, YES: Enable audio, NO: Disable audio
  • Method Example

[_roomMgr  enableLocalAudio:YES];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

useLoudSpeaker

  • Brief description

Whether the audio is played through the speaker

By default, the audio is played through the speaker in loudspeaker mode.

  • Interface name

- (int)useLoudSpeaker:(BOOL)use;

  • Parameter
Parameter Name Required Type Description
use Yes BOOL YES: Loudspeaker NO: Mute
  • Method Example

[_roomMgr useLoudSpeaker:YES];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

setRemoteAudioVolume

  • Brief description

Set the user's audio volume

  • Interface name

- (int)setRemoteAudioVolume:(CGFloat)volume peerId:(NSString *)peerId type:(TKMediaType)type;

  • Parameter
Parameter Name Required Type Description
volume Yes CGFloat Volume level
peerId Yes NSString User ID
type Yes TKMediaType Media type, for detailed definitions, refer to TKRoomDefine.h under TKMediaType
  • Method Example

[_roomMgr setRemoteAudioVolume:1.0 peerId:@"adc123456" type:TKMediaSourceType_mic];

  • Return Value Description
Type Description
int 0: Indicates that the call was successful. Non-zero: Indicates that the call failed

Notes

For more return error codes, please refer to the error code descriptions in TKRoomErrorCode