Overview of TKRoomManager.h
TKRoomManager.h is the main interface class file of the SDK, which defines the primary interfaces related to room calls. The main class is TKRoomManager. Below are the properties and methods defined in this class.
TKRoomManager Class
Property Name |
Property Description |
localUser |
Local user object, a read-only property. After calling the joinRoom interface, the localUser object will be initialized |
- Initialization and Registration Settings
Interface Name |
Interface Function |
instance |
Instantiate the SDK singleton object |
destory |
Destroy the SDK object |
setLogLevel |
Set the SDK log level for printing |
initWithAppKey |
Initialize the SDK |
registerRoomManagerDelegate |
Set the room signaling callback delegate |
iregisterMediaDelegate |
Set the callback delegate for obtaining audio and video data |
- Entering and Exiting Rooms and Room Information
Interface Name |
Interface Function |
joinRoom |
Enter a normal room, which needs to be created in the background before entering |
joinRoomEx |
Enter an instant room, which does not need to be created in the background |
leaveRoom |
Leave the room |
getRoomProperty |
Get room-related properties |
getRoomUserWithUId |
Get the user object |
getServerList |
Get the server list |
getStreamStats |
Get the upstream audio and video statistics data of the user |
- Publish and Play Audio and Video
Interface Name |
Interface Function |
publishVideo |
Publish your own video |
unPublishVideo |
Stop publishing your own video |
publishAudio |
Publish your own audio |
unPublishAudio |
Stop publishing your own audio |
playVideo |
Play video |
playAudio |
Play audio |
unPlayVideo |
Stop playing video |
unPlayAudio |
Stop playing audio |
- Signaling and Modifying Properties
Interface Name |
Interface Function |
sendMessage |
Send chat messages |
pubMsg |
Publish custom signaling messages |
delMsg |
Cancel the published custom signaling messages |
evictUser |
Kick a user out of the room |
switchOnlyAudioRoom |
Whether to switch the room to a pure audio room |
changeCurrentServer |
Switch the currently connected server |
changeUserProperty |
Modify user properties |
- Set local audio and video properties
Interface Name |
Interface Function |
setLocalVideoMirrorMode |
Set the local video mirroring mode |
setVideoProfile |
Set my video capture and publishing resolution |
selectCameraPosition |
Switch my front and rear cameras |
setVideoOrientation |
Set my video capture orientation |
enableLocalVideo |
Whether to disable the local camera |
enableLocalAudio |
Whether to disable the local microphone |
useLoudSpeaker |
Whether the audio is played out loud |
setRemoteAudioVolume |
Set the user's audio volume |
- Share and Play Media Streams
Interface Name |
Interface Function |
startShareMediaFile |
Publish and share media stream files |
stopShareMediaFile |
Cancel sharing media stream files |
playMediaFile |
Play the shared media stream |
unPlayMediaFile |
Stop playing the shared media stream |
pauseMediaFile |
Pause playing the shared media stream |
seekMediaFile |
Seek the shared media stream |
- Play desktop sharing and movie file streams
Interface Name |
Interface Function |
playScreen |
Play desktop sharing audio and video streams |
unPlayScreen |
Stop playing desktop sharing audio and video streams |
playFile |
Play the shared movie file stream |
unPlayFile |
Stop playing the shared movie file stream |
- Server Recording and Local Recording
Interface Name |
Interface Function |
startServerRecord |
Start server recording of the course |
stopServerRecord |
Stop the server recording of the course |
pauseServerRecord |
Pause the server recording of the course |
resumeServerRecord |
Resume the server recording of the course |
startAudioRecord |
Start local audio recording |
pauseAudioRecord |
Pause local audio recording |
stopAudioRecord |
Stop local audio recording |
Interface Name |
Interface Function |
enableDualStream |
Whether to enable local dual-stream mode |
setSmallStreamParameter |
Set the video resolution of the sub-stream (only effective when dual-stream mode is enabled) |
setRemoteDefaultVideoStreamType |
Set the default subscription type for remote audio and video streams (only effective when dual-stream mode is enabled) |
setRemoteVideoStreamType |
Set the remote video stream type and video capture device ID (only effective when dual-stream mode is enabled) |
- Play local audio and video files
Interface Name |
Interface Function |
startPlayAudioFile |
Play local audio files (audio files will be played in a streaming mix mode) |
stopPlayAudioFile |
Stop playing local audio files |
pauseAudioFile |
Pause playing local audio files |
resumeAudioFile |
Resume playing local audio files |
setAudioFileVolume |
Set the volume for playing local audio files |
startPlayMediaFile |
Play local media files |
stopPlayMediaFile |
Stop playing local media files |
pausePlayMedia |
Pause playing local media files |
resumePlayMedia |
Resume playing local media files |
seekPlayMedia |
Seek to a position in the local media file |
setPlayMediaVolume |
Set the volume for playing local media files |
Interface Name |
Interface Function |
getRoomUserWithPeerId |
Get a user with a specified ID in a large-scale room |
getRoomUserNumberWithRole |
Get the number of people in the room in a large-scale classroom |
getRoomUsersWithRole |
Get the room user information (user list) in a large-scale classroom |
batchChangeUserPropertyByIds |
Batch modify the attributes of users with specified IDs |
changeUserPropertyByRole |
Modify the attributes of users with specified roles |
getUsersByProperty |
Get the user list based on user attributes |
- Get the device and user management class object
Interface Name |
Interface Function |
getDeviceManager |
Get the device management class object, which is used for device-related operations. For details, refer to TKDeviceManager.h in the TKMediaEngine.framework |
getUserManager |
Get the user management class object |