FuncList | DESC |
Create TRTCCloud instance (singleton mode) | |
Terminate TRTCCloud instance (singleton mode) | |
Add TRTC event callback | |
Remove TRTC event callback | |
Set the queue that drives the TRTCCloudDelegate event callback | |
Enter room | |
Exit room | |
Switch role | |
Switch role(support permission credential) | |
Switch room | |
Request cross-room call | |
Exit cross-room call | |
Set subscription mode (which must be set before room entry for it to take effect) | |
Create room subinstance (for concurrent multi-room listen/watch) | |
Terminate room subinstance | |
| |
Publish a stream | |
Modify publishing parameters | |
Stop publishing | |
Enable the preview image of local camera (mobile) | |
Enable the preview image of local camera (desktop) | |
Update the preview image of local camera | |
Stop camera preview | |
Pause/Resume publishing local video stream | |
Set placeholder image during local video pause | |
Subscribe to remote user's video stream and bind video rendering control | |
Update remote user's video rendering control | |
Stop subscribing to remote user's video stream and release rendering control | |
Stop subscribing to all remote users' video streams and release all rendering resources | |
Pause/Resume subscribing to remote user's video stream | |
Pause/Resume subscribing to all remote users' video streams | |
Set the encoding parameters of video encoder | |
Set network quality control parameters | |
Set the rendering parameters of local video image | |
Set the rendering mode of remote video image | |
Enable dual-channel encoding mode with big and small images | |
Switch the big/small image of specified remote user | |
Screencapture video | |
Sets perspective correction coordinate points. | |
Set the adaptation mode of gravity sensing (version 11.7 and above) | |
Enable local audio capturing and publishing | |
Stop local audio capturing and publishing | |
Pause/Resume publishing local audio stream | |
Pause/Resume playing back remote audio stream | |
Pause/Resume playing back all remote users' audio streams | |
Set audio route | |
Set the audio playback volume of remote user | |
Set the capturing volume of local audio | |
Get the capturing volume of local audio | |
Set the playback volume of remote audio | |
Get the playback volume of remote audio | |
Enable volume reminder | |
Start audio recording | |
Stop audio recording | |
Start local media recording | |
Stop local media recording | |
Set the parallel strategy of remote audio streams | |
Enable 3D spatial effect | |
Update self position and orientation for 3D spatial effect | |
Update the specified remote user's position for 3D spatial effect | |
Set the maximum 3D spatial attenuation range for userId's audio stream | |
Get device management class (TXDeviceManager) | |
Get beauty filter management class (TXBeautyManager) | |
Add watermark | |
Get sound effect management class (TXAudioEffectManager) | |
Enable system audio capturing(iOS not supported) | |
Stop system audio capturing(iOS not supported) | |
Set the volume of system audio capturing | |
Start in-app screen sharing (for iOS 13.0 and above only) | |
Start system-level screen sharing (for iOS 11.0 and above only) | |
Start screen sharing | |
Stop screen sharing | |
Pause screen sharing | |
Resume screen sharing | |
Enumerate shareable screens and windows (for macOS only) | |
Select the screen or window to share (for macOS only) | |
Set the video encoding parameters of screen sharing (i.e., substream) (for desktop and mobile systems) | |
Set the audio mixing volume of screen sharing (for desktop systems only) | |
Add specified windows to the exclusion list of screen sharing (for desktop systems only) | |
Remove specified windows from the exclusion list of screen sharing (for desktop systems only) | |
Remove all windows from the exclusion list of screen sharing (for desktop systems only) | |
Add specified windows to the inclusion list of screen sharing (for desktop systems only) | |
Remove specified windows from the inclusion list of screen sharing (for desktop systems only) | |
Remove all windows from the inclusion list of screen sharing (for desktop systems only) | |
Enable/Disable custom video capturing mode | |
Deliver captured video frames to SDK | |
Enable custom audio capturing mode | |
Deliver captured audio data to SDK | |
Enable/Disable custom audio track | |
Mix custom audio track into SDK | |
Set the publish volume and playback volume of mixed custom audio track | |
Generate custom capturing timestamp | |
Set video data callback for third-party beauty filters | |
Set the callback of custom rendering for local video | |
Set the callback of custom rendering for remote video | |
Set custom audio data callback | |
Set the callback format of audio frames captured by local mic | |
Set the callback format of preprocessed local audio frames | |
Set the callback format of audio frames to be played back by system | |
Enabling custom audio playback | |
Getting playable audio data | |
Use UDP channel to send custom message to all users in room | |
Use SEI channel to send custom message to all users in room | |
Start network speed test (used before room entry) | |
Stop network speed test | |
Get SDK version information | |
Set log output level | |
Enable/Disable console log printing | |
Enable/Disable local log compression | |
Set local log storage path | |
Set log callback | |
Display dashboard | |
Set dashboard margin | |
Call experimental APIs | |
Enable or disable private encryption of media streams |
Param | DESC |
context | It is only applicable to the Android platform. The SDK internally converts it into the ApplicationContext of Android to call the Android system API. |
delete ITRTCCloud*
, a compilation error will occur. Please use destroyTRTCCloud
to release the object pointer. getTRTCShareInstance()
API. getTRTCShareInstance(void *context)
API.- (void)addDelegate: |
delegateQueue
, the SDK will use MainQueue
as the queue for driving TRTCCloudDelegate event callbacks by default. delegateQueue
attribute, all callback functions in TRTCCloudDelegate will be driven by MainQueue
. delegateQueue
, please do not manipulate the UI in the TRTCCloudDelegate callback function; otherwise, thread safety issues will occur.- (void)enterRoom: | |
appScene: |
result
parameter will be a positive number ( result
> 0), indicating the time in milliseconds (ms) between function call and room entry. result
parameter will be a negative number ( result
< 0), indicating the TXLiteAVError for room entry failure.Param | DESC |
param | Room entry parameter, which is used to specify the user's identity, role, authentication credentials, and other information. For more information, please see TRTCParams. |
scene | Application scenario, which is used to specify the use case. The same TRTCAppScene should be configured for all users in the same room. |
scene
is specified as TRTCAppSceneLIVE or TRTCAppSceneVoiceChatRoom, you must use the role
field in TRTCParams to specify the role of the current user in the room. scene
should be configured for all users in the same room. onExitRoom()
callback in TRTCCloudDelegate to notify you. onExitRoom()
callback, so as to avoid the problem of the camera or mic being occupied.-(void)switchRole: |
anchor
and audience
. role
field in TRTCParams during room entry to specify the user role in advance or use the switchRole
API to switch roles after room entry.Param | DESC |
role | Role, which is anchor by default: TRTCRoleAnchor: anchor, who can publish their audio/video streams. Up to 50 anchors are allowed to publish streams at the same time in one room. TRTCRoleAudience: audience, who cannot publish their audio/video streams, but can only watch streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room supports an audience of up to 100,000 concurrent online users. |
scene
you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.-(void)switchRole: | |
privateMapKey: | (NSString*)privateMapKey |
anchor
and audience
. role
field in TRTCParams during room entry to specify the user role in advance or use the switchRole
API to switch roles after room entry.Param | DESC |
privateMapKey | Permission credential used for permission control. If you want only users with the specified userId values to enter a room or push streams, you need to use privateMapKey to restrict the permission. We recommend you use this parameter only if you have high security requirements. For more information, please see Enabling Advanced Permission Control. |
role | Role, which is anchor by default: TRTCRoleAnchor: anchor, who can publish their audio/video streams. Up to 50 anchors are allowed to publish streams at the same time in one room. TRTCRoleAudience: audience, who cannot publish their audio/video streams, but can only watch streams of anchors in the room. If they want to publish their streams, they need to switch to the "anchor" role first through switchRole. One room supports an audience of up to 100,000 concurrent online users. |
scene
you specify in enterRoom is TRTCAppSceneVideoCall or TRTCAppSceneAudioCall, please do not call this API.- (void)switchRoom: |
audience
, calling this API is equivalent to exitRoom
(current room) + enterRoom
(new room). anchor
, the API will retain the current audio/video publishing status while switching the room; therefore, during the room switch, camera preview and sound capturing will not be interrupted. switchRoom
can get better smoothness and use less code than exitRoom + enterRoom
. onSwitchRoom(errCode, errMsg)
in TRTCCloudDelegate.Param | DESC |
config |
config
parameter contains both roomId
and strRoomId
parameters. You should pay special attention as detailed below when specifying these two parameters: strRoomId
, then set roomId
to 0. If both are specified, roomId
will be used. strRoomId
or roomId
at the same time. They cannot be mixed; otherwise, there will be many unexpected bugs.- (void)connectOtherRoom: | (NSString *)param |
connectOtherRoom()
to successfully call anchor B in room "102": onRemoteUserEnterRoom(B)
and onUserVideoAvailable(B,YES)
event callbacks of anchor B; that is, all users in room "101" can subscribe to the audio/video streams of anchor B. onRemoteUserEnterRoom(A)
and onUserVideoAvailable(A,YES)
event callbacks of anchor A; that is, all users in room "102" can subscribe to the audio/video streams of anchor A.NSMutableDictionaryjsonDict = [[NSMutableDictionary alloc] init];[jsonDict setObject:@(102) forKey:@"roomId"];[jsonDict setObject:@"userB" forKey:@"userId"];NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:NSJSONWritingPrettyPrinted error:nil];NSString* jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];[trtc connectOtherRoom:jsonString];
roomId
in JSON with strRoomId
, such as {"strRoomId": "102", "userId": "userB"}NSMutableDictionaryjsonDict = [[NSMutableDictionary alloc] init];[jsonDict setObject:@"102" forKey:@"strRoomId"];[jsonDict setObject:@"userB" forKey:@"userId"];NSData* jsonData = [NSJSONSerialization dataWithJSONObject:jsonDict options:NSJSONWritingPrettyPrinted error:nil];NSString* jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];[trtc connectOtherRoom:jsonString];
Param | DESC |
param | You need to pass in a string parameter in JSON format: roomId represents the room ID in numeric format, strRoomId represents the room ID in string format, and userId represents the user ID of the target anchor. |
- (void)setDefaultStreamRecvMode: | (BOOL)autoRecvAudio |
video: | (BOOL)autoRecvVideo |
startRemoteView
API).Param | DESC |
autoRecvAudio | YES: automatic subscription to audio; NO: manual subscription to audio by calling muteRemoteAudio(NO) . Default value: YES |
autoRecvVideo | YES: automatic subscription to video; NO: manual subscription to video by calling startRemoteView . Default value: YES |
TRTCCloud
was originally designed to work in the singleton mode, which limited the ability to watch concurrently in multiple rooms. TRTCCloud
instances, so that you can enter multiple different rooms at the same time to listen/watch audio/video streams. TRTCCloud
instances will be limited.//In the small room that needs interaction, enter the room as an anchor and push audio and video streamsTRTCCloud *mainCloud = [TRTCCloud sharedInstance];TRTCParams *mainParams = [[TRTCParams alloc] init];//Fill your paramsmainParams.role = TRTCRoleAnchor;[mainCloud enterRoom:mainParams appScene:TRTCAppSceneLIVE)];//...[mainCloud startLocalPreview:YES view:videoView];[mainCloud startLocalAudio:TRTCAudioQualityDefault];//In the large room that only needs to watch, enter the room as an audience and pull audio and video streamsTRTCCloud *subCloud = [mainCloud createSubCloud];TRTCParams *subParams = [[TRTCParams alloc] init];//Fill your paramssubParams.role = TRTCRoleAudience;[subCloud enterRoom:subParams appScene:TRTCAppSceneLIVE)];//...[subCloud startRemoteView:userId streamType:TRTCVideoStreamTypeBig view:videoView];//...//Exit from new room and release it.[subCloud exitRoom];[mainCloud destroySubCloud:subCloud];
roomId
values by using the same userId
. userId
to enter the same room with a specified roomId
. TRTCCloud
instances at the same time, and can also call APIs related to local audio/video in the sub instance. But need to pay attention to: TRTCCloud
subinstance- (void)destroySubCloud: |
Param | DESC |
subCloud | |
- (void)startPublishMediaStream: | |
encoderParam: | |
mixingConfig: |
Param | DESC |
config | The On-Cloud MixTranscoding settings. This parameter is invalid in the relay-to-CDN mode. It is required if you transcode and publish the stream to a CDN or to a TRTC room. For details, see TRTCStreamMixingConfig. |
params | The encoding settings. This parameter is required if you transcode and publish the stream to a CDN or to a TRTC room. If you relay to a CDN without transcoding, to improve the relaying stability and playback compatibility, we also recommend you set this parameter. For details, see TRTCStreamEncoderParam. |
target | The publishing destination. You can relay the stream to a CDN (after transcoding or without transcoding) or transcode and publish the stream to a TRTC room. For details, see TRTCPublishTarget. |
target
. You will be charged only once for transcoding even if you relay to multiple CDNs.- (void)updatePublishMediaStream: | (NSString *)taskId |
publishTarget: | |
encoderParam: | |
mixingConfig: |
Param | DESC |
config | The On-Cloud MixTranscoding settings. This parameter is invalid in the relay-to-CDN mode. It is required if you transcode and publish the stream to a CDN or to a TRTC room. For details, see TRTCStreamMixingConfig. |
params | The encoding settings. This parameter is required if you transcode and publish the stream to a CDN or to a TRTC room. If you relay to a CDN without transcoding, to improve the relaying stability and playback compatibility, we recommend you set this parameter. For details, see TRTCStreamEncoderParam. |
target | The publishing destination. You can relay the stream to a CDN (after transcoding or without transcoding) or transcode and publish the stream to a TRTC room. For details, see TRTCPublishTarget. |
taskId |
- (void)stopPublishMediaStream: | (NSString *)taskId |
Param | DESC |
taskId |
taskId
is left empty, the TRTC backend will end all tasks you started through startPublishMediaStream. You can leave it empty if you have started only one task or want to stop all publishing tasks started by you.- (void)startLocalPreview: | (BOOL)frontCamera |
view: | (nullable TXView *)view |
enterRoom
, the SDK will only enable the camera and wait until enterRoom
is called before starting push. enterRoom
, the SDK will enable the camera and automatically start pushing the video stream. onCameraDidReady
callback in TRTCCloudDelegate.Param | DESC |
frontCamera | YES: front camera; NO: rear camera |
view | Control that carries the video image |
BeautyManager
before going live, you can: startLocalPreview
before calling enterRoom
startLocalPreview
and muteLocalVideo(YES)
after calling enterRoom
- (void)startLocalPreview: | (nullable TXView *)view |
setCurrentCameraDevice
can be called first to select whether to use the macOS device's built-in camera or an external camera. enterRoom
, the SDK will only enable the camera and wait until enterRoom
is called before starting push. enterRoom
, the SDK will enable the camera and automatically start pushing the video stream. onCameraDidReady
callback in TRTCCloudDelegate.Param | DESC |
view | Control that carries the video image |
BeautyManager
before going live, you can: startLocalPreview
before calling enterRoom
startLocalPreview
and muteLocalVideo(YES)
after calling enterRoom
- (void)updateLocalView: | (nullable TXView *)view |
- (void)muteLocalVideo: | |
mute: | (BOOL)mute |
startLocalPreview/stopLocalPreview
when TRTCVideoStreamTypeBig is specified, but has higher performance and response speed. startLocalPreview/stopLocalPreview
APIs need to enable/disable the camera, which are hardware device-related operations, so they are very time-consuming. muteLocalVideo
only needs to pause or allow the data stream at the software level, so it is more efficient and more suitable for scenarios where frequent enabling/disabling are needed. onUserVideoAvailable(userId, NO)
callback notification. onUserVideoAvailable(userId, YES)
callback notification.Param | DESC |
mute | YES: pause; NO: resume |
streamType | Specify for which video stream to pause (or resume). Only TRTCVideoStreamTypeBig and TRTCVideoStreamTypeSub are supported |
- (void)setVideoMuteImage: | (nullable TXImage *)image |
fps: | (NSInteger)fps |
muteLocalVideo(YES)
to pause the local video image, you can set a placeholder image by calling this API. Then, other users in the room will see this image instead of a black screen.Param | DESC |
fps | Frame rate of the placeholder image. Minimum value: 5. Maximum value: 10. Default value: 5 |
image | Placeholder image. A null value means that no more video stream data will be sent after muteLocalVideo . The default value is null. |
- (void)startRemoteView: | (NSString *)userId |
streamType: | |
view: | (nullable TXView *)view |
userId
and render it to the rendering control specified by the view
parameter. You can set the display mode of the video image through setRemoteRenderParams. userId
of a user who has a video stream in the room, you can directly call startRemoteView
to subscribe to the user's video image. enterRoom
.Param | DESC |
streamType | Video stream type of the userId specified for watching: HD big image: TRTCVideoStreamTypeBig Smooth small image: TRTCVideoStreamTypeSmall (the remote user should enable dual-channel encoding through enableEncSmallVideoStream for this parameter to take effect) Substream image (usually used for screen sharing): TRTCVideoStreamTypeSub |
userId | ID of the specified remote user |
view | Rendering control that carries the video image |
userId
at the same time, but does not support watching the big image and small image at the same time. userId
enables dual-channel encoding through enableEncSmallVideoStream can the user's small image be viewed. userId
does not exist, the SDK will switch to the big image of the user by default.- (void)updateRemoteView: | (nullable TXView *)view |
streamType: | |
forUser: | (NSString *)userId |
Param | DESC |
streamType | Type of the stream for which to set the preview window (only TRTCVideoStreamTypeBig and TRTCVideoStreamTypeSub are supported) |
userId | ID of the specified remote user |
view | Control that carries the video image |
- (void)stopRemoteView: | (NSString *)userId |
streamType: |
Param | DESC |
streamType | Video stream type of the userId specified for watching: HD big image: TRTCVideoStreamTypeBig Smooth small image: TRTCVideoStreamTypeSmall Substream image (usually used for screen sharing): TRTCVideoStreamTypeSub |
userId | ID of the specified remote user |
- (void)muteRemoteVideoStream: | (NSString*)userId |
streamType: | |
mute: | (BOOL)mute |
Param | DESC |
mute | Whether to pause receiving |
streamType | Specify for which video stream to pause (or resume): HD big image: TRTCVideoStreamTypeBig Smooth small image: TRTCVideoStreamTypeSmall Substream image (usually used for screen sharing): TRTCVideoStreamTypeSub |
userId | ID of the specified remote user |
- (void)muteAllRemoteVideoStreams: | (BOOL)mute |
Param | DESC |
mute | Whether to pause receiving |
- (void)setVideoEncoderParam: |
Param | DESC |
param | It is used to set relevant parameters for the video encoder. For more information, please see TRTCVideoEncParam. |
- (void)setNetworkQosParam: |
Param | DESC |
param | It is used to set relevant parameters for network quality control. For details, please refer to TRTCNetworkQosParam. |
- (void)setLocalRenderParams: |
Param | DESC |
params |
- (void)setRemoteRenderParams: | (NSString *)userId |
streamType: | |
params: |
Param | DESC |
params | |
streamType | It can be set to the primary stream image (TRTCVideoStreamTypeBig) or substream image (TRTCVideoStreamTypeSub). |
userId | ID of the specified remote user |
- (int)enableEncSmallVideoStream: | (BOOL)enable |
withQuality: |
Param | DESC |
enable | Whether to enable small image encoding. Default value: NO |
smallVideoEncParam | Video parameters of small image stream |
- (void)setRemoteVideoStreamType: | (NSString*)userId |
type: |
Param | DESC |
streamType | Video stream type, i.e., big image or small image. Default value: big image |
userId | ID of the specified remote user |
- (void)snapshotVideo: | (nullable NSString *)userId |
type: | |
sourceType: |
Param | DESC |
sourceType | Video image source, which can be the video stream image (TRTCSnapshotSourceTypeStream, generally in higher definition) 、the video rendering image (TRTCSnapshotSourceTypeView) or the capture picture (TRTCSnapshotSourceTypeCapture).The captured picture screenshot will be clearer. |
streamType | Video stream type, which can be the primary stream image (TRTCVideoStreamTypeBig, generally for camera) or substream image (TRTCVideoStreamTypeSub, generally for screen sharing) |
userId | User ID. A null value indicates to screencapture the local video. |
- (void)setPerspectiveCorrectionWithUser: | (nullable NSString *)userId |
srcPoints: | (nullable NSArray *)srcPoints |
dstPoints: | (nullable NSArray *)dstPoints |
Param | DESC |
dstPoints | The coordinates of the four vertices of the target corrected area should be passed in the order of top-left, bottom-left, top-right, bottom-right. All coordinates need to be normalized to the [0,1] range based on the render view width and height, or null to stop perspective correction of the corresponding stream. |
srcPoints | The coordinates of the four vertices of the original stream image area should be passed in the order of top-left, bottom-left, top-right, bottom-right. All coordinates need to be normalized to the [0,1] range based on the render view width and height, or null to stop perspective correction of the corresponding stream. |
userId | userId which corresponding to the target stream. If null value is specified, it indicates that the function is applied to the local stream. |
- (void)setGravitySensorAdaptiveMode: |
Param | DESC |
mode | Gravity sensing mode, see TRTCGravitySensorAdaptiveMode_Disable、TRTCGravitySensorAdaptiveMode_FillByCenterCrop and TRTCGravitySensorAdaptiveMode_FitWithBlackBorder for details, default value: TRTCGravitySensorAdaptiveMode_Disable. |
- (void)startLocalAudio: |
Param | DESC |
quality | Sound quality TRTCAudioQualitySpeech - Smooth: sample rate: 16 kHz; mono channel; audio bitrate: 16 Kbps. This is suitable for audio call scenarios, such as online meeting and audio call. TRTCAudioQualityDefault - Default: sample rate: 48 kHz; mono channel; audio bitrate: 50 Kbps. This is the default sound quality of the SDK and recommended if there are no special requirements. TRTCAudioQualityMusic - HD: sample rate: 48 kHz; dual channel + full band; audio bitrate: 128 Kbps. This is suitable for scenarios where Hi-Fi music transfer is required, such as online karaoke and music live streaming. |
- (void)muteLocalAudio: | (BOOL)mute |
muteLocalAudio(YES)
does not release the mic permission; instead, it continues to send mute packets with extremely low bitrate. muteLocalAudio
instead of stopLocalAudio
is recommended in scenarios where the requirement for recording file quality is high.Param | DESC |
mute | YES: mute; NO: unmute |
- (void)muteRemoteAudio: | (NSString *)userId |
mute: | (BOOL)mute |
Param | DESC |
mute | YES: mute; NO: unmute |
userId | ID of the specified remote user |
NO
after room exit (exitRoom).- (void)muteAllRemoteAudio: | (BOOL)mute |
Param | DESC |
mute | YES: mute; NO: unmute |
NO
after room exit (exitRoom).- (void)setAudioRoute: |
Param | DESC |
route | Audio route, i.e., whether the audio is output by speaker or receiver. Default value: TRTCAudioModeSpeakerphone |
- (void)setRemoteAudioVolume: | (NSString *)userId |
volume: | (int)volume |
setRemoteAudioVolume(userId, 0)
.Param | DESC |
userId | ID of the specified remote user |
volume | Volume. 100 is the original volume. Value range: [0,150]. Default value: 100 |
- (void)setAudioCaptureVolume: | (NSInteger)volume |
Param | DESC |
volume | Volume. 100 is the original volume. Value range: [0,150]. Default value: 100 |
- (void)setAudioPlayoutVolume: | (NSInteger)volume |
Param | DESC |
volume | Volume. 100 is the original volume. Value range: [0,150]. Default value: 100 |
- (void)enableAudioVolumeEvaluation: | (BOOL)enable |
withParams: |
Param | DESC |
enable | Whether to enable the volume prompt. It’s disabled by default. |
params |
startLocalAudio
.- (int)startAudioRecording: |
stopAudioRecording
before room exit, it will be automatically stopped after room exit.Param | DESC |
param |
- (void)startLocalRecording: |
Param | DESC |
params |
- (void)setRemoteAudioParallelParams: | (TRTCAudioParallelParams*)params |
Param | DESC |
params | Audio parallel parameter. For more information, please see TRTCAudioParallelParams |
- (void)enable3DSpatialAudioEffect: | (BOOL)enabled |
Param | DESC |
enabled | Whether to enable 3D spatial effect. It’s disabled by default. |
Param | DESC |
axisForward | The unit vector of the forward axis of user coordinate system. The three values represent the forward, right and up coordinate values in turn. |
axisRight | The unit vector of the right axis of user coordinate system. The three values represent the forward, right and up coordinate values in turn. |
axisUp | The unit vector of the up axis of user coordinate system. The three values represent the forward, right and up coordinate values in turn. |
position | The coordinate of self in the world coordinate system. The three values represent the forward, right and up coordinate values in turn. |
- (void)updateRemote3DSpatialPosition: | (NSString *)userId |
Param | DESC |
position | The coordinate of self in the world coordinate system. The three values represent the forward, right and up coordinate values in turn. |
userId | ID of the specified remote user. |
- (void)set3DSpatialReceivingRange: | (NSString *)userId |
range: | (NSInteger)range |
Param | DESC |
range | Maximum attenuation range of the audio stream. |
userId | ID of the specified user. |
- (void)setWatermark: | (nullable TXImage*)image |
streamType: | |
rect: | (CGRect)rect |
rect
parameter, which is a quadruple in the format of (x, y, width, height). rect
parameter is set to (0.1, 0.1, 0.2, 0.0),Param | DESC |
image | Watermark image, which must be a PNG image with transparent background |
rect | Unified coordinates of the watermark relative to the encoded resolution. Value range of x , y , width , and height : 0–1. |
streamType | Specify for which image to set the watermark. For more information, please see TRTCVideoStreamType. |
streamType
set to different values. TXAudioEffectManager
is a sound effect management API, through which you can implement the following features: isShortFile
parameter to YES
). Resources
directory of your app bundle.- (void)setSystemAudioLoopbackVolume: | (uint32_t)volume |
Param | DESC |
volume | Set volume. Value range: [0, 150]. Default value: 100 |
- (void)startScreenCaptureInApp: | |
encParam: |
Param | DESC |
encParams | Video encoding parameters for screen sharing. We recommend you use the above configuration.If you set encParams to nil , the SDK will use the video encoding parameters you set before calling the startScreenCapture API. |
streamType | Channel used for screen sharing, which can be the primary stream (TRTCVideoStreamTypeBig) or substream (TRTCVideoStreamTypeSub). |
- (void)startScreenCaptureByReplaykit: | |
encParam: | |
appGroup: | (NSString *)appGroup |
Param | DESC |
appGroup | Specify the Application Group Identifier shared by your application and the screen sharing process. You can specify this parameter as nil , but we recommend you set it as instructed in the documentation for higher reliability. |
encParams | Video encoding parameters for screen sharing. We recommend you use the above configuration. If you set encParams to nil , the SDK will use the video encoding parameters you set before calling the startScreenCapture API. |
streamType | Channel used for screen sharing, which can be the primary stream (TRTCVideoStreamTypeBig) or substream (TRTCVideoStreamTypeSub). |
- (void)startScreenCapture: | (nullable NSView *)view |
streamType: | |
encParam: |
Param | DESC |
encParam | Image encoding parameters used for screen sharing, which can be set to empty, indicating to let the SDK choose the optimal encoding parameters (such as resolution and bitrate). |
streamType | Channel used for screen sharing, which can be the primary stream (TRTCVideoStreamTypeBig) or substream (TRTCVideoStreamTypeSub). |
view | Parent control of the rendering control, which can be set to a null value, indicating not to display the preview of the shared screen. |
onError(ERR_SERVER_CENTER_ANOTHER_USER_PUSH_SUB_VIDEO)
callback from TRTCCloudDelegate.- (NSArray<TRTCScreenCaptureSourceInfo*>*)getScreenCaptureSourcesWithThumbnailSize: | (CGSize)thumbnailSize |
iconSize: | (CGSize)iconSize |
Param | DESC |
iconSize | Specify the icon size of the window to be obtained. |
thumbnailSize | Specify the thumbnail size of the window to be obtained. The thumbnail can be drawn on the window selection UI. |
- (void)selectScreenCaptureTarget: | (TRTCScreenCaptureSourceInfo *)screenSource |
rect: | (CGRect)rect |
capturesCursor: | (BOOL)capturesCursor |
highlight: | (BOOL)highlight |
getScreenCaptureSources
, you can call this API to select the target screen or window you want to share.Param | DESC |
capturesCursor | Whether to capture mouse cursor |
highlight | Whether to highlight the window being shared |
rect | Specify the area to be captured (set this parameter to CGRectZero : when the sharing target is a window, the entire window will be shared, and when the sharing target is the desktop, the entire desktop will be shared) |
screenSource | Specify sharing source |
- (void)setSubStreamEncoderParam: |
Param | DESC |
param |
- (void)setSubStreamMixVolume: | (NSInteger)volume |
Param | DESC |
volume | Set audio mixing volume. Value range: 0–100 |
- (void)addExcludedShareWindow: | (NSInteger)windowID |
Param | DESC |
window | Window not to be shared |
type
in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeScreen; that is, the feature of excluding specified windows works only when the entire screen is shared. sourceId
member in TRTCScreenCaptureSourceInfo.- (void)removeExcludedShareWindow: | (NSInteger)windowID |
Param | DESC |
windowID | |
- (void)addIncludedShareWindow: | (NSInteger)windowID |
type
in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow; that is, the feature of additionally including specified windows works only when a window is shared.Param | DESC |
windowID | Window to be shared (which is a window handle HWND on Windows) |
- (void)removeIncludedShareWindow: | (NSInteger)windowID |
type
in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow.Param | DESC |
windowID | Window to be shared (window ID on macOS or HWND on Windows) |
type
in TRTCScreenCaptureSourceInfo is specified as TRTCScreenCaptureSourceTypeWindow.- (void)enableCustomVideoCapture: | |
enable: | (BOOL)enable |
Param | DESC |
enable | Whether to enable. Default value: NO |
streamType | Specify video stream type (TRTCVideoStreamTypeBig: HD big image; TRTCVideoStreamTypeSub: substream image). |
- (void)sendCustomVideoData: | |
frame: |
bufferType
is NSData
. bufferType
is NSData
. bufferType
is NSData
.Param | DESC |
frame | Video data, which can be in PixelBuffer NV12, BGRA, or I420 format. |
streamType | Specify video stream type (TRTCVideoStreamTypeBig: HD big image; TRTCVideoStreamTypeSub: substream image). |
timestamp
value of a video frame immediately after capturing it, so as to achieve the best audio/video sync effect.- (void)enableCustomAudioCapture: | (BOOL)enable |
Param | DESC |
enable | Whether to enable. Default value: NO |
- (void)sendCustomAudioData: |
TRTCAudioFrameFormatPCM
.Param | DESC |
frame | Audio data |
- (void)enableMixExternalAudioFrame: | (BOOL)enablePublish |
playout: | (BOOL)enablePlayout |
Param | DESC |
enablePlayout | Whether the mixed audio track should be played back locally. Default value: NO |
enablePublish | Whether the mixed audio track should be played back remotely. Default value: NO |
enablePublish
and enablePlayout
as NO
, the custom audio track will be completely closed.- (int)mixExternalAudioFrame: |