Public Callback Function | Function Name |
---|---|
void | onVideoDecodeFrame:pts:uid: |
Public Callback Function | Function Name |
---|---|
ThunderVideoCaptureFrameDataType | needThunderVideoCaptureFrameDataType: |
CVPixelBufferRef _Nullable | onVideoCaptureFrame:PixelBuffer: |
BOOL | onVideoCaptureFrame:PixelBuffer:SourceTextureID:DestinationTextureID:TextureFormat:TextureTarget:TextureWidth:TextureHeight: |
Public Callback Function | Function Name |
---|---|
void | onSendMediaExtraInfoFailedStatus: |
void | onRecvMediaExtraInfo:ofUid: |
void | onRecvMixAudioInfo:ofUid: |
void | onRecvMixVideoInfo:ofUid: |
Public Callback Function | Function Name |
---|---|
void | onAudioFilePlayEnd: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFilePlayError:errorCode: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFilePlaying: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFilePause: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFileResume: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFileStop: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFileSeekComplete:milliseconds: (This callback is deprecated from V2.8.0,it is recommended to call onAudioFileStateChange:event:errorCode:) |
void | onAudioFileVolume:volume:currentMs:totalMs: |
void | onAudioFileStateChange:event:errorCode: |
Public Callback Function | Function Name |
---|---|
virtual bool | onRecordAudioFrame(AudioFrame& audioFrame) = 0 |
virtual bool | onPlaybackAudioFrame(AudioFrame& audioFrame) = 0 |
virtual bool | onPlaybackAudioFrameBeforeMixing(char* uid, AudioFrame& audioFrame) = 0 |
virtual bool | onMixedAudioFrame(AudioFrame& audioFrame) |
Public Callback Function | Function Name |
---|---|
void | onThunderRtcLogWithLevel:message: |
Public Callback Function | Function Name |
---|---|
BOOL | onInitialize:(nullable id<ThunderVideoFrameConsumer>)protocol |
ThunderVideoBufferType | bufferType |
void | onStart |
void | onStop |
void | onDispose |
Public Callback Function | Function Name |
---|---|
void | audioCaptureStart |
void | audioCaptureData:data:len:sampleRate:channelCount:bitPerSample: |
void | audioCaptureStop |
void | audioRenderStart |
void | audioRenderData:data:len:sampleRate:channelCount:bitPerSample: |
void | audioRenderStop |
- (void)onThunderRtcLogWithLevel:(ThunderRtcLogLevel)level message:(nonnull NSString*)msg;
Processing log callback.
Parameter | Description |
---|---|
level | See level details in [ThunderRtcLogLevel].(#ThunderRtcLogLevel). |
msg | Log |
- (void)thunderEngine:(ThunderEngine* _Nonnull)engine
onJoinRoomSuccess:(nonnull NSString*)room
withUid:(nonnull NSString*)uid
elapsed:(NSInteger)elapsed;
Callback of joining a room.
Parameter | Description |
---|---|
room | Room name |
uid | User ID |
elapsed | Time elapsed (ms) from calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine sdkAuthResult:(ThunderRtcSdkAuthResult)sdkAuthResult;
Callback of SDK authentication results.
Parameter | Description |
---|---|
sdkAuthResult | See authentication result details in ThunderRtcSdkAuthResult |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine bPublish:(BOOL)bPublish bizAuthResult:(NSInteger)bizAuthResult;
Callback of business authentication results.
Notes:
When business authentication is required, Jocloud will forward the authentication request to the business authentication server, and after passing through, return the authentication results.
Parameter | Description |
---|---|
bPublish | YES: publishing authentication NO: playing authentication |
bizAuthResult | Authentication results: results of passing through business authentication; 0: success; |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onPlayVolumeIndication:(NSArray<ThunderRtcAudioVolumeInfo *> * _Nonnull)speakers
totalVolume:(NSInteger)totalVolume;
Callback of speaking volume.
Notes:
Notifications for who is speaking in the room and their volume.
Parameter | Description |
---|---|
speakers | Speaker (array). Each speaker includes follwing information: "Uid"- Speaker ID. "volume"-speaker's volume. "Pts"-Playing timestamp |
totalVolume | Total volume, range: [0-100] |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onAudioPlaySpectrumData:(nullable NSData*)data;
Callback of audio spectrum data.
Notes:
- Return playing audio's spectrum data to the user.
Parameter | Description |
---|---|
Date | Spectrum data |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onRecvUserAppMsgData:(nonnull NSData*)msgData
uid:(nonnull NSString*)uid;
Callback of service-customized broadcast messages.
Notes:
Return pass-through messages and the sender's ID to message recipients.
Parameter | Description |
---|---|
msgData | Pass-through message received |
uid | Sender ID |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onSendAppMsgDataFailedStatus:(NSUInteger)status;
Callback of failure to send service-customized broadcast message.
Notes:
Return the reason that a service-customized broadcast message failed to send. By current stipulations, pass-through frequency is 2x/s and the data sent must be <= 200 bytes.
Parameter | Description |
---|---|
status | Failure status: 1: Sending frequency too high 2: Sent data too large 3: Publishing failed |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onRemoteAudioStopped:(BOOL)stopped byUid:(nonnull NSString*)uid;
Notification for remote user audio stream status.
Parameter | Description |
---|---|
stopped | Callback of remote user audio stream status |
uid | Remote user ID |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onRemoteVideoStopped:(BOOL)stopped byUid:(nonnull NSString*)uid;
Notification for remote user video stream status.
Parameter | Description |
---|---|
stopped | Callback of remote user video stream status |
uid | Remote user ID |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine
onRemoteVideoPlay:(nonnull NSString *)uid
size:(CGSize)size
elapsed:(NSInteger)elapsed;
Callback of the first frame of remote video displayed.
Notes:
Used to calculate the video speed.
Parameter | Description |
---|---|
uid | User ID |
size | Video size (width and height). See details in CGSize |
elapsed | Time elapsed (ms) from calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine
onVideoSizeChangedOfUid:(nonnull NSString*)uid
size:(CGSize)size
rotation:(NSInteger)rotation;
Callback of changes to local or remote video resolution.
Parameter | Description |
---|---|
uid | User ID |
size | Video size (width and height). See details in CGSize |
rotation | Rotation degree [0,360] |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onVideoCaptureStatus:(ThunderVideoCaptureStatus)status;
Notification for camera capture status changes.
Notes:
- After enabling camera capture, receive this notification for changes in its status.
Parameter | Description |
---|---|
status | See camera capture status details in ThunderVideoCaptureStatus. |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onConnectionStatus:(ThunderConnectionStatus)status;
Callback of server network connection status.
Parameter | Description |
---|---|
status | SDK-server network connection status. See details in ThunderConnectionStatus. |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onRoomStats:(nonnull RoomStats*)stats;
Notifications for upstream/downstream traffic
Notes:
- Notifications for upstream/downstream traffic are periodic at two-second intervals.
Parameter | Description |
---|---|
stats | Upstream/downstream traffic statistics. See details in RoomStats. |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onFirstLocalAudioFrameSent:(NSInteger)elapsed;
Callback of the first frame of local audio sent.
Parameter | Description |
---|---|
elapsed | Time elapsed (ms) from calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onFirstLocalVideoFrameSent:(NSInteger)elapsed;
Callback of the first frame of local video sent.
Parameter | Description |
---|---|
elapsed | Time elapsed (ms) from calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine
onPublishStreamToCDNStatusWithUrl:(NSString *_Nonnull)url
errorCode:(ThunderPublishCDNErrorCode)errorCode;
Callback of stream pushing to CDN results
Notes:
- After setting publishing or a transcoding task, this callback will trigger upon calling addPublishOriginStreamUrl to set the source stream for CDN pushing, or upon calling addPublishTranscodingStreamUrl to set mixed video streams pushing to CDN.
- Notify whether CDN stream pushing is successful. If publishing fails, errorCode will give the specific reason.
- Trigger when stream pushing status changes; in the absence of changes, it triggers once every 10 seconds.
Parameter | Description |
---|---|
url | Stream pushing target URL |
errorCode | Stream pushing error code. See details in ThunderPublishCDNErrorCode. |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onNetworkTypeChanged:(NSInteger)type;
Callback of network type changes.
Parameter | Description |
---|---|
type | THUNDER_NETWORK_TYPE_UNKNOWN(0): Unknown connection type THUNDER_NETWORK_TYPE_DISCONNECTED(1): Network disconnected THUNDER_NETWORK_TYPE_CABLE(2): Wired network THUNDER_NETWORK_TYPE_WIFI(3): Wi-Fi (hotspot included) THUNDER_NETWORK_TYPE_MOBILE(4): Mobile network, 2G, 3G and 4G are not identified THUNDER_NETWORK_TYPE_MOBILE_2G(5): 2G mobile network THUNDER_NETWORK_TYPE_MOBILE_3G(6): 3G mobile network THUNDER_NETWORK_TYPE_MOBILE_4G(7): 4G mobile network |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onLocalVideoStats:(ThunderRtcLocalVideoStats * _Nonnull)stats;
Local video statistics notifications.
Notes:
- Provides statistics on local device video stream output. Timing: 1. immediate callback upon calling the publishing API; 2. immediate callback of mid-publishing bracket changes; 3. periodically at two-second intervals
Parameter | Description |
---|---|
stats | Local video statistics. See details in ThunderRtcLocalVideoStats |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onLocalAudioStats:(ThunderRtcLocalAudioStats * _Nonnull)stats;
Local audio statistics notifications.
Notes:
- Provide statistics on local device audio stream output. Timing: periodically at two-second intervals
Parameter | Description |
---|---|
stats | Local audio statistics. See details in ThunderRtcLocalAudioStats. |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onAudioCaptureStatus:(NSInteger)status;
Notification of changes to audio device capture status.
Notes:
- After enabling audio capture, receive notification when there are changes to audio capture device status
Parameter | Description |
---|---|
status | Audio device status. See details in ThunderAudioDeviceStatus. |
- (void)thunderEngineConnectionLost:(ThunderEngine *_Nonnull)engine;
Callback of server network disconnection.
Notes:
- After calling joinRoom, regardless of whether joining is successful or not, if the server cannot be connected within 10 seconds, the SDK will trigger this callback. Until the application proactively calls leaveRoom, the SDK will automatically try to reconnect.
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onTokenWillExpire:(nonnull NSString*)token;
Callback of imminent token expiration.
Notes:
- The SDK will return this callback 30 seconds before the token expires.
Parameter | Description |
---|---|
token | Expiring token |
- (void)thunderEngineTokenRequest:(ThunderEngine * _Nonnull)engine;
Callback of token expired.
Notes:
- The SDK will return this callback when the token expires.
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onUserBanned:(BOOL)status;
Callback of changes to a user's banned status.
Parameter | Description |
---|---|
status | Banned status (YES-banned NO-not banned) |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onUserJoined:(nonnull NSString*)uid elapsed:(NSInteger)elapsed;
Callback of a remote user joining the current room.
Notes:
- This API became obsolete with V2.8.0.
- Effective in an audio-only mode.
Parameter | Description |
---|---|
uid | Remote user ID |
elapsed | Delay (ms) from calling joinRoom to triggering callback |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onUserOffline:(nonnull NSString*)uid
reason:(ThunderLiveRtcUserOfflineReason)reason;
Callback of a remote user exiting the current room.
Notes:
- This API became obsolete with V2.8.0.
- Effective in an audio-only mode.
Parameter | Description | |
---|---|---|
uid | Remote user ID | |
reason | Reason for going offline. See details in ThunderLiveRtcUserOfflineReason | . |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onNetworkQuality:(nonnull NSString*)uid
txQuality:(ThunderLiveRtcNetworkQuality)txQuality
rxQuality:(ThunderLiveRtcNetworkQuality)rxQuality;
Reports on user uplink/downlink network quality.
Parameter | Description |
---|---|
uid | User ID for the corresponding network quality report. When setting to 0, the local user's network quality is returned |
txQuality | Uplink network quality. See details in ThunderLiveRtcNetworkQuality |
rxQuality | Downlink network quality. See details in ThunderLiveRtcNetworkQuality |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onRemoteVideoStatsOfUid:(nonnull NSString*)uid
stats:(ThunderRtcRemoteVideoStats* _Nonnull)stats;
Callback of E2E video stream status during remote user calls.
Notes:
- Provide the E2E video stream status during remote user calls. Trigger periodically at two-second intervals for each remote user/anchor—that is, when there are multiple remote users/anchors, callback will trigger that many times every two seconds.
Parameter | Description |
---|---|
uid | Remote user/anchor ID |
stats | Remote video statistics. See details in ThunderRtcRemoteVideoStats |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onRemoteAudioStatsOfUid:(nonnull NSString*)uid
stats:(ThunderRtcRemoteAudioStats* _Nonnull)stats;
Callback of E2E audio stream status during remote user calls.
Notes:
- Provide E2E audio stream status during remote user calls. Trigger periodically at two-second intervals for each remote user/anchor—that is, when there are multiple remote users/anchors, callback will trigger that many times every two seconds.
Parameter | Description |
---|---|
uid | Remote user/anchor ID |
stats | Remote audio statistics. See details in ThunderRtcRemoteAudioStats |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onRemoteAudioPlay:(nonnull NSString *)uid elapsed:(NSInteger)elapsed
Callback of the first frame of remote video played.
Parameter | Description |
---|---|
uid | Remote user/anchor ID |
elapsed | Time elapsed (ms) from calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onLocalAudioStatusChanged:(ThunderLocalAudioStreamStatus)status
errorReason:(ThunderLocalAudioStreamErrorReason)errorReason;
Callback of local audio status changes.
Parameter | Description |
---|---|
status | Local audio status. See details in ThunderLocalAudioStreamStatus. |
errorReason | Error code. See details in ThunderLocalAudioStreamErrorReason. |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onLocalVideoStatusChanged:(ThunderLocalVideoStreamStatus)status
error:(ThunderLocalVideoStreamErrorReason)error;
Callback of local video status changes.
Parameter | Description |
---|---|
status | Local video status. See details in ThunderLocalVideoStreamStatus. |
error | Error code. See details in ThunderLocalVideoStreamErrorReason. |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onRemoteAudioStateChangedOfUid:(nonnull NSString*)uid
state:(ThunderRemoteAudioState)state
reason:(ThunderRemoteAudioReason)reason
elapsed:(NSInteger)elapsed;
Callback of remote audio stream status changes. Return the updated audio status and reason for the status change.
Parameter | Description |
---|---|
uid | Remote user/anchor ID |
state | Remote user audio status. See details in ThunderRemoteAudioState. |
reason | Reason for audio status change. See details in ThunderRemoteAudioReason. |
elapsed | Time elapsed (ms) from the calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onRemoteVideoStateChangedOfUid:(nonnull NSString*)uid
state:(ThunderRemoteVideoState)state
reason:(ThunderRemoteVideoReason)reason
elapsed:(NSInteger)elapsed;
Callback of remote video stream status changes. Return the updated video status and reason for the status change.
Parameter | Description |
---|---|
uid | Remote user/anchor ID (anchor ID) |
state | Remote user video status. See details in ThunderRemoteVideoState. |
reason | Reason for video status change. See details in ThunderRemoteVideoReason. |
elapsed | Time elapsed (ms) from calling joinRoom to callback event |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine onDeviceStats:(ThunderRtcLocalDeviceStats * _Nonnull)stats;
Callback of CPU or memory usage status; periodic return at two-second intervals upon joining a room.
Parameter | Description |
---|---|
stats | CPU or memory usage status. See details in ThunderRtcLocalDeviceStats. |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onAudioRouteChanged:(ThunderAudioOutputRouting)routing;
Called when the audio routing changes.
Parameter | Description |
---|---|
routing | The current audio routing, see details in ThunderAudioOutputRouting |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onHowlingDetectResult:(BOOL)bHowling;
Called for reporting howling detection status.
Note:
- The callback is received only when the enableHowlingDetector is enabled.
- The callback is called when the howling detection status changes.
Parameter | Description |
---|---|
bHowling | Howling detection status: "true"-detected, "false"-not detected |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onEchoDetectResult:(BOOL)bEcho;
Callback of echo detection results.
Note:
- The callback is received when the enableEchoDetector is enabled and the microphone is on.
- The callback is called when the echo detection status changes.
- The callback will be recevied when the enableEchoDetector is enabled and the microphone status changes.
- This callback will be received once from enableEchoDetector(false) to enableEchoDetector(true) when the microphone is on.
Parameter | Description |
---|---|
bEcho | Detection result: "true"-detected, "false"-not detected |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onCameraFocusAreaChanged:(CGRect)focusArea;
Called when the focus area changes.
Note:
- The callback is triggered after callling setCameraExposurePosition to change the exposure position.
Parameter | Description |
---|---|
focusArea | Focus area, range: [0,1] |
- (void)thunderEngine:(ThunderEngine *_Nonnull)engine onCameraExposureAreaChanged:(CGRect)exposureArea;
Called when the exposure area changes.
Note:
- The callback is triggered after callling setCameraExposurePosition to change the exposure position.
Parameter | Description |
---|---|
exposureArea | Exposure area,range: [0,1] |
- (void) onVideoDecodeFrame:(CVPixelBufferRef)pixelBuf pts:(uint64_t)pts uid:(NSString*)uid;
Custom rendering of decoded images, meaning removal of SDK decoded image for service-customized rendering.
Notes:
- There may be multiple video streams in the room. Set ThunderDecodeFrameObserver protocol for video streams with different IDs accordingly.
Parameter | Description |
---|---|
pixelBuf | buf pointer of current frame |
pts | Time shown in current frame (pts) |
uid | Other party's ID |
- (ThunderVideoCaptureFrameDataType)needThunderVideoCaptureFrameDataType;
ThunderVideoCaptureFrameObserver has a defined set of APIs through which the developer can set video pre-processing tasks. Result parameters are returned to the SDK for continued encoding.
Declare the data format to the SDK by the following two methods.
For video capture callback data types, see ThunderVideoCaptureFrameDataType.
- (CVPixelBufferRef _Nullable)onVideoCaptureFrame:(EAGLContext *_Nonnull)glContext
PixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuf;
ThunderVideoCaptureFrameObserver has a defined set of APIs through which the developer can set video pre-processing tasks. Result parameters are returned to the SDK for continued encoding.
Receive a frame of capture data for processing and return the processed data.
Notes:
- The SDK returns the original PixelBuffer to the developer via API. After developer processing, the result is returned to SDK in form of a return value for further operations.
Parameter | Description |
---|---|
glContext | EAGLContext |
pixelBuf | buf pointer of the current frame |
- (BOOL)onVideoCaptureFrame:(EAGLContext *_Nonnull)context
PixelBuffer:(CVPixelBufferRef _Nonnull)pixelBuffer
SourceTextureID:(unsigned int)srcTextureID
DestinationTextureID:(unsigned int)dstTextureID
TextureFormat:(int)textureFormat
TextureTarget:(int)textureTarget
TextureWidth:(int)width
TextureHeight:(int)height;
ThunderVideoCaptureFrameObserver has a defined set of interfaces through which the developer can set video pre-processing tasks. Result parameters are returned to the SDK for continued encoding.
Receive a frame of capture data or processing and return the processed data. Process data by OpenGL texture ID.
Notes:
- The SDK converts pixelBuffer into srcTextureID and dstTextureID via API for return to the developer. The developer can process the texture and render the final result in dstTextureID. The SDK will use dstTextureID data in subsequent tasks.
Parameter | Description |
---|---|
context | EAGLContext |
pixelBuffer | Original image pixelBuffer |
srcTextureID | Source texture ID |
dstTextureID | Destination texture ID |
textureFormat | Texture format |
textureTarget | Texture target |
width | Texture width |
height | Texture height |
- (void)thunderEngine:(ThunderEngine* _Nonnull)engine onLeaveRoomWithStats:(ThunderRtcRoomStats* _Nonnull)stats;
Callback of exiting the room.
Notes:
- You will receive this callback if exiting the room normally by calling leaveRoom.
Parameter | Description |
---|---|
stats | Room exit status; reserved parameter, unrealized |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onCaptureVolumeIndication:(NSInteger)totalVolume
cpt:(NSUInteger)cpt
micVolume:(NSInteger)micVolume;
Callback of capture volume.
Notes:
- Set callback with enableCaptureVolumeIndication.
Parameter | Description |
---|---|
totalVolume | Total volume of audio capture (including microphone capture and file playing) [0-100] |
cpt | Capture timestamp (ms) |
micVolume | Volume of microphone capture [0-100] |
- (void)thunderEngine:(ThunderEngine * _Nonnull)engine
onRecvUserAppMsgData:(nonnull NSData*)msgData
uid:(nonnull NSString*)uid;
Callback of service-customized broadcast messages.
Notes:
- Return the pass-through message received and the ID of the message's sender.
Parameter | Description |
---|---|
msgData | Received pass-through message |
uid | Sender ID |
- (void)onSendMediaExtraInfoFailedStatus:(NSUInteger)status;
Callback of failure to send Supplemental Enhancement Information (SEI).
Notes:
- For error codes, see ThunderSendMediaExtraInfoFailedStatus.
- (void)onRecvMediaExtraInfo:(nonnull NSData*)data ofUid:(nonnull NSString*)uid;
Callback of SEI received.
Parameter | Description |
---|---|
date | SEI |
uid | User ID |
- (void)onRecvMixAudioInfo:(nonnull NSArray<ThunderMixAudioInfo*>*)infos ofUid:(nonnull NSString*)uid;
Callback of received mixed audio stream SEI.
Parameter | Description |
---|---|
infos | Mixed audio stream information, indicating the contributing source streams. See details in ThunderMixAudioInfo. |
uid | Mixed audio stream ID |
- (void)onRecvMixVideoInfo:(nonnull NSArray<ThunderMixVideoInfo*>*)infos ofUid:(nonnull NSString*)uid;
Callback of received mixed video stream SEI.
Parameter | Description |
---|---|
uid | Mixed video stream ID |
infos | Mixed video stream information, indicating the contributing source streams. See details in ThunderMixAudioInfo. |
virtual void Thunder::IAudioFrameObserver::onRecordAudioFrame(AudioFrame& audioFrame);
Callback of raw audio capture data.
Notes:
- This API adopts the C++ method. After calling registerAudioFrameObserver and registering an IAudioFrameObserver, receive this callback when capture is enabled.
Parameter | Type | Description |
---|---|---|
audioFrame | OUT | Raw audio data. See details in AudioFrame. |
virtual void Thunder::IAudioFrameObserver::onPlaybackAudioFrame(AudioFrame& audioFrame);
Callback of raw audio playing data.
Notes:
- This interface adopts the C++ method. After calling registerAudioFrameObserver and registering an IAudioFrameObserver, receive this callback when raw audio is played.
Parameter | Type | Description |
---|---|---|
audioFrame | OUT | Raw audio data. See details in AudioFrame. |
virtual void Thunder::IAudioFrameObserver::onPlaybackAudioFrameBeforeMixing(char* uid, AudioFrame& audioFrame);
Callback of remote user-decoded raw audio data. Users are differentiated by ID.
Notes:
- This interface adopts the C++ method. After calling registerAudioFrameObserver and registering an IAudioFrameObserver, receive this callback when remote audio data is played.
Parameter | Type | Description |
---|---|---|
uid | OUT | Remote user ID |
audioFrame | OUT | Raw audio data. See details in AudioFrame. |
virtual void Thunder::IAudioFrameObserver::onMixedAudioFrame(AudioFrame& audioFrame);
Callback of the audio data mixed with the captured data and the playback data.
Parameter | Type | Description |
---|---|---|
audioFrame | IN | Audio raw data, see details in AudioFrame |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:.
- (void)onAudioFilePlayEnd:(nonnull ThunderAudioFilePlayer*)player;
Audio playing complete.
Parameter | Description |
---|---|
player | Pointer of file playing object |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:.
- (void)onAudioFilePlayError:(nonnull ThunderAudioFilePlayer*)player errorCode:(int)errorCode;
Audio file playing error
Parameter | Description |
---|---|
player | Pointer of file playing object |
errorCode | errorCode = 0: File opening succeeded errorCode = -1: Error parsing file format errorCode = -2: Error decoding file format errorCode = -3: Unsupported file format errorCode = -4: File path does not exist |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:.
- (void)onAudioFilePlaying:(nonnull ThunderAudioFilePlayer*)player;
Audio file started playing.
Parameter | Description |
---|---|
player | Pointer of file playing object |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:.
- (void)onAudioFilePause:(nonnull ThunderAudioFilePlayer*)player;
Audio file playing paused.
Parameter | Description |
---|---|
player | Pointer of file playing object |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:.
- (void)onAudioFileResume:(nonnull ThunderAudioFilePlayer*)player;
Audio file playing resumed.
Parameter | Description |
---|---|
player | Pointer of file playing object |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:
- (void)onAudioFileStop:(nonnull ThunderAudioFilePlayer*)player;
Callback of playing stopped by user.
Parameter | Description |
---|---|
player | Pointer of file playing object |
Caution:
- This callback became obsolete with V2.8.0. Instead call onAudioFileStateChange:event:errorCode:
- (void)onAudioFileSeekComplete:(nonnull ThunderAudioFilePlayer*)player milliseconds:(int)milliseconds;
Skipping to a specified playing location is completed.
Parameter | Description |
---|---|
player | Pointer of file playing object |
milliseconds | Actual fast forwarding progress |
- (void)onAudioFileVolume:(nonnull ThunderAudioFilePlayer*)player
volume:(uint32_t)volume
currentMs:(uint32_t)currentMs
totalMs:(uint32_t)totalMs;
Audio playing volume.
Parameter | Description |
---|---|
player | Pointer of file playing object |
volume | Playing volume |
currentMs | Current playing progress |
totalMs | Total duration |
- (void)onAudioFileStateChange:(nonnull ThunderAudioFilePlayer*)player event:(ThunderAudioFilePlayerEvent)event errorCode:(ThunderAudioFilePLayerErrorCode)errorCode;
Callback of player status changes.
Parameter | Description |
---|---|
player | Pointer of file playing object |
event | Player event. See details in ThunderAudioFilePlayerEvent. |
errorCode | Error code. See details in ThunderAudioFilePLayerErrorCode. |
- (BOOL)onInitialize:(nullable id<ThunderVideoFrameConsumer>)protocol;
Initialize video source.
Engine calls this method when initializing a video source. The developer can prepare in the method by enabling the camera, initializing the video source, and telling Engine (via return value) whether a customized video source is ready. When initializing a video source, the developer needs to specify a Buffer type (bufferType), and only transmit video frame data in the corresponding format. Also during initialization, Engine will send the developer a ThunderVideoFrameConsumer object. The developer needs to save this object and use it to input the video frame to Engine, once the video source is enabled.
Parameter | Description |
---|---|
protocol | External video frame operation object. See details in ThunderVideoFrameConsumer. |
- (ThunderVideoBufferType)bufferType;
Get Buffer type.
During initialization, Engine calls this method to consult the Buffer type for the given video source. The developer can only and must specify just one Buffer type to the media engine via return value.
- (void)onStart;
Enable video source.
During initialization, Engine calls this method to consult the Buffer type for the given video source. The developer can only and must specify just one Buffer type to the media engine via return value.
- (void)onStop;
Disable video source.
The developer can stop collecting video by this method. When the video source is stopped, the media engine notifies the developer by this callback that the frame input switch of ThunderVideoFrameConsumer is about to close and any subsequent video frame input will be discarded.
- (void)onDispose;
Destroy video source.
When Engine notifies the developer that the video source is to be invalidated, the developer may then shut down the video source device in this method. Engine will destroy the ThunderVideoFrameConsumer object and the developer should ensure it is not used again following this callback.
- (void)audioCaptureStart;
Audio capture started.
- (void)audioCaptureData:(void*_Nonnull)data
len:(uint32_t)len
sampleRate:(uint32_t)sampleRate
channelCount:(uint32_t)channelCount
bitPerSample:(uint32_t)bitPerSample;
Callback of audio capture data.
Parameter | Description |
---|---|
Date | Audio data |
len | Audio duration |
sampleRate | Audio sampling rate |
channelCount | Number of channels |
bitPerSample | Bit width of sampling point |
- (void)audioCaptureStop;
Audio capture stopped.
- (void)audioRenderStart;
Audio rendering started.
-(void)audioRenderData:(void*_Nonnull)data
len:(uint32_t)len
sampleRate:(uint32_t)sampleRate
channelCount:(uint32_t)channelCount
bitPerSample:(uint32_t)bitPerSample;
Callback of audio rendering data.
Parameter | Description |
---|---|
Date | Audio data |
len | Audio duration |
sampleRate | Audio sampling rate |
channelCount | Number of channels |
bitPerSample | Bit width of sampling point |
- (void)audioRenderStop;
Audio rendering stopped.
struct IAudioFrameObserver::AudioFrame;
Audio data information.
Parameter | Description |
---|---|
type | Audio frame type. See details in AUDIO_FRAME_TYPE. |
samples | Number of samples in this frame |
bytesPerSample | Bytes per sample: PCM (16 digits) contains two bytes |
channels | The number of channels (data are interleaved if stereo); 1: single channel, 2: dual channel |
samplesPerSec | Sampling rate |
buffer | data buffer |
renderTimeMs | Not used |
avsync_type | Not used |
enum AUDIO_FRAME_TYPE;
Audio/video data frame type.
Enumeration Value | Description |
---|---|
FRAME_TYPE_PCM16(0) | PCM 16bit little endian |
typedef NS_ENUM(NSInteger, ThunderRtcScenarioMode);
Set scenario mode
Enumeration Value | Description |
---|---|
THUNDER_SCENARIO_MODE_DEFAULT(0) | =1 by default |
THUNDER_SCENARIO_MODE_STABLE_FIRST(1) | Smoothness priority: stable, recommended for education |
THUNDER_SCENARIO_MODE_QUALITY_FIRST(2) | Tone quality priority: recommended for shows with little or no co-hosting |
typedef NS_ENUM(NSInteger, ThunderRtcLogLevel);
Set log level.
Enumeration Value | Description |
---|---|
THUNDER_LOG_LEVEL_TRACE(0) | TRACE |
THUNDER_LOG_LEVEL_DEBUG(1) | DEBUG |
THUNDER_LOG_LEVEL_INFO(2) | INFO |
THUNDER_LOG_LEVEL_WARN(3) | WARN |
THUNDER_LOG_LEVEL_ERROR(4) | ERROR |
typedef NS_ENUM(NSInteger, ThunderRtcSdkAuthResult);
Authentication results
Enumeration Value | Description |
---|---|
THUNDER_SDK_AUTHRES_SUCCUSS(0) | Authentication succeeded |
THUNDER_SDK_AUTHRES_ERR_SERVER_INTERNAL(10000) | Internal server error, try again |
THUNDER_SDK_AUTHRES_ERR_NO_TOKEN(10001) | No token, call [ThunderAPI updateToken:] |
THUNDER_SDK_AUTHRES_ERR_TOKEN_ERR(10002) | Token authentication failed (incorrect digital signature); appSecret may be incorrect |
THUNDER_SDK_AUTHRES_ERR_APPID(10003) | Application ID in token is inconsistent with the application ID used in authentication |
THUNDER_SDK_AUTHRES_ERR_UID(10004) | User ID in token is inconsistent with the user ID used in authentication |
THUNDER_SDK_AUTHRES_ERR_TOKEN_EXPIRE(10005) | Token expired |
THUNDER_SDK_AUTHRES_ERR_NO_APP(10006) | The application does not exist, and is not registered in the management background |
THUNDER_SDK_AUTHRES_ERR_TOKEN_WILL_EXPIRE(10007) | Token will expire |
THUNDER_SDK_AUTHRES_ERR_BAND(10008) | The user is banned |
typedef NS_ENUM(NSUInteger, ThunderLiveRtcUserOfflineReason);
Reasons for user going offline
Enumeration Value | Description |
---|---|
THUNDER_SDK_USER_OFF_LINE_REASON_QUIT(1) | The user actively went offline |
THUNDER_SDK_USER_OFF_LINE_REASON_DROPPED(2) | Timeout, no data received for a long time |
THUNDER_SDK_USER_OFF_LINE_REASON_BECOME_AUDIENCE(3) | User status switched from anchor to audience (live streaming mode) |
typedef NS_ENUM(NSUInteger, ThunderLiveRtcNetworkQuality);
Network quality
Enumeration Value | Description |
---|---|
THUNDER_SDK_NETWORK_QUALITY_UNKNOWN(0) | Unknown quality |
THUNDER_SDK_NETWORK_QUALITY_EXCELLENT(1) | Excellent network quality |
THUNDER_SDK_NETWORK_QUALITY_GOOD(2) | Good network quality |
THUNDER_SDK_NETWORK_QUALITY_POOR(3) | Poor network quality; communication is not affected but the user can sense the deficiency |
THUNDER_SDK_NETWORK_QUALITY_BAD(4) | Bad network quality; communication is hindered but possible |
THUNDER_SDK_NETWORK_QUALITY_VBAD(5) | Very bad network quality; communication is essentially impossible |
THUNDER_SDK_NETWORK_QUALITY_DOWN(6) | Disconnected; communication is impossible |
typedef NS_ENUM(NSUInteger, ThunderSendMediaExtraInfoFailedStatus);
Status of failure in sending SEI
Enumeration Value | Description |
---|---|
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_DATA_EMPTY(1) | SEI is null |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_DATA_TOO_LARGE(2) | Data oversized. Each time, size should not exceed 200 bytes for audio-only publishing, or 2048 bytes if there is video |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_FREQUENCY_TOO_HIGHT(3) | Overly frequent; sending cannot exceed 100 ms/time |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NOT_IN_ANCHOR_SYSTEM(4) | Not an anchor system |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NO_JOIN_MEDIA(5) | Not in a channel |
THUNDER_SEND_MEDIA_EXTRA_INFO_FAILED_NO_PUBLISH_SUCCESS(6) | Publishing failed |
typedef NS_ENUM(NSInteger, ThunderVideoCaptureStatus);
Callback of video capture status
Enumeration Value | Description |
---|---|
THUNDER_VIDEO_CAPTURE_STATUS_SUCEESS(0) | Capture enabled. ios is currently undetectable. To unify with Android, add this value |
THUNDER_VIDEO_CAPTURE_STATUS_AUTHORIZED(1) | User authorization |
THUNDER_VIDEO_CAPTURE_STATUS_NOT_DETERMINED(2) | The user has not given permission |
THUNDER_VIDEO_CAPTURE_STATUS_RESTRICTED(3) | Occupied |
THUNDER_VIDEO_CAPTURE_STATUS_DENIED(4) | The user has denied permission |
THUNDER_VIDEO_CAPTURE_STATUS_DENIED(5) | Camera disabled |
typedef NS_ENUM(NSInteger, ThunderVideoCaptureFrameDataType);
Type of video capture data called back
Enumeration Value | Description |
---|---|
THUNDER_VIDEO_CAPTURE_DATATYPE_PIXELBUFFER(0) | SDK will return pixelbuffer camera data |
THUNDER_VIDEO_CAPTURE_DATATYPE_TEXTURE(1) | SDK will return texture ID data |
typedef NS_ENUM(NSInteger, ThunderLocalAudioStreamStatus);
Local audio stream statuses
Enumeration Value | Description |
---|---|
THUNDER_LOCAL_AUDIO_STREAM_STATUS_STOPPED(0) | Default initialization status |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_CAPTURING(1) | Recording device successfully enabled |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_ENCODING(2) | First frame of local audio successfully coded |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_SENDING(3) | First frame of local audio successfully sent |
THUNDER_LOCAL_AUDIO_STREAM_STATUS_FAILED(4) | Enabling local audio failed |
typedef NS_ENUM(NSInteger, ThunderLocalAudioStreamErrorReason);
Reasons for local audio failure
Enumeration Value | Description |
---|---|
THUNDER_LOCAL_AUDIO_STREAM_ERROR_OK(0) | Normal |
THUNDER_LOCAL_AUDIO_STREAM_ERROR_UNKNOWN(1) | Unknown |
THUNDER_LOCAL_AUDIO_STREAM_ERROR_CAPTURE_FAILURE(2) | Local audio capture failed |
THUNDER_LOCAL_AUDIO_STREAM_ERROR_ENCODE_FAILURE(3) | Local audio encoding failed |
typedef NS_ENUM(NSInteger, ThunderLocalVideoStreamStatus);
Local video stream statuses
Enumeration Value | Description |
---|---|
THUNDER_LOCAL_VIDEO_STREAM_STATUS_STOPPED(0) | Default initialization status |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_CAPTURING(1) | Recording device successfully enabled |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_PREVIEWING(2) | Local video preview succeeded |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_ENCODING(3) | First frame of local video successfully encoded |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_SENDING(4) | First frame of local video successfully sent |
THUNDER_LOCAL_VIDEO_STREAM_STATUS_FAILED(5) | Enabling local video failed |
typedef NS_ENUM(NSInteger, ThunderLocalVideoStreamErrorReason);
Reasons for remote video failure
Enumeration Value | Description |
---|---|
THUNDER_LOCAL_VIDEO_STREAM_ERROR_OK(0) | Normal |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_FAILURE(1) | Unknown |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_DEVICE_DENIED(2) | Need device permission |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_DEVICE_RESTRICTED(3) | The capture device is in use |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_CAPTURE_FAILURE(4) | Local video capture failed. Check whether the device is working properly |
THUNDER_LOCAL_VIDEO_STREAM_ERROR_ENCODE_FAILURE(5) | Local video encoding failed |
typedef NS_ENUM(NSInteger, ThunderRemoteAudioState);
Remote audio stream statuses
Enumeration Value | Description |
---|---|
THUNDER_REMOTE_AUDIO_STATE_STOPPED(0) | Default initialization status, reported under these conditions: THUNDER_REMOTE_AUDIO_REASON_LOCAL_STOPPED(4) or THUNDER_REMOTE_AUDIO_REASON_REMOTE_STOPPED(6) |
THUNDER_REMOTE_AUDIO_STATE_STARTING(1) | Local user has accepted the first remote audio stream package |
THUNDER_REMOTE_AUDIO_STATE_DECODING(2) | Decoding, playing is normal |
THUNDER_REMOTE_AUDIO_STATE_FROZEN(3) | Remote audio is frozen, reported under the condition of THUNDER_REMOTE_AUDIO_REASON_NETWORK_CONGESTION(2) |
THUNDER_REMOTE_AUDIO_STATE_FAILED(4) | (unrealized) Playing remote audio failed, reported under the condition of THUNDER_REMOTE_AUDIO_REASON_INTERNAL(1) |
typedef NS_ENUM(NSInteger, ThunderRemoteAudioReason);
Reasons for remote audio stream status changes
Enumeration Value | Description |
---|---|
THUNDER_REMOTE_AUDIO_REASON_OK(0) | Normal |
THUNDER_REMOTE_AUDIO_REASON_INTERNAL(1) | Internal reason |
THUNDER_REMOTE_AUDIO_REASON_NETWORK_CONGESTION(2) | Network blocked |
THUNDER_REMOTE_AUDIO_REASON_NETWORK_RECOVERY(3) | Network recovered |
THUNDER_REMOTE_AUDIO_REASON_LOCAL_STOPPED(4) | Local user stopped receiving remote audio or disabled the audio module |
THUNDER_REMOTE_AUDIO_REASON_LOCAL_STARTED(5) | Local user resumed receiving remote audio or enabled the audio module |
THUNDER_REMOTE_AUDIO_REASON_REMOTE_STOPPED(6) | Remote user stopped sending audio or disabled the audio module |
THUNDER_REMOTE_AUDIO_REASON_REMOTE_STARTED(7) | Remote user resumed sending remote audio or enabled the audio module |
THUNDER_REMOTE_AUDIO_REASON_PLAY_DEVICE_START_FAILED(8) | Enabling the audio player failed |
THUNDER_REMOTE_AUDIO_REASON_FORMAT_NOT_SUPPORT(9) | Decoding failure as the audio coding standard is not supported |
typedef NS_ENUM(NSInteger, ThunderRemoteVideoState);
Remote video stream statuses
Enumeration Value | Description |
---|---|
THUNDER_REMOTE_VIDEO_STATE_STOPPED(0) | Default initialization status, reported under these conditions: THUNDER_REMOTE_VIDEO_REASON_LOCAL_STOPPED(4) or THUNDER_REMOTE_VIDEO_REASON_REMOTE_STOPPED(6) |
THUNDER_REMOTE_VIDEO_STATE_STARTING(1) | Local user has accepted the first remote video package |
THUNDER_REMOTE_VIDEO_STATE_DECODING(2) | Remote video is being decoded |
THUNDER_REMOTE_VIDEO_STATE_RENDERING(3) | Remote video is being rendered |
THUNDER_REMOTE_VIDEO_STATE_FROZEN(4) | Remote video is frozen, reported under the condition of THUNDER_REMOTE_VIDEO_REASON_NETWORK_CONGESTION(2) |
typedef NS_ENUM(NSInteger, ThunderRemoteVideoReason);
Reasons for remote video stream status changes
Enumeration Value | Description |
---|---|
THUNDER_REMOTE_VIDEO_REASON_OK(0) | Normal |
THUNDER_REMOTE_VIDEO_REASON_INTERNAL(1) | Internal reason |
THUNDER_REMOTE_VIDEO_REASON_NETWORK_CONGESTION(2) | Network blocked |
THUNDER_REMOTE_VIDEO_REASON_NETWORK_RECOVERY(3) | Network recovered |
THUNDER_REMOTE_VIDEO_REASON_LOCAL_STOPPED(4) | Local user stopped receiving remote video or disabled the video module |
THUNDER_REMOTE_VIDEO_REASON_LOCAL_STARTED(5) | Local user resumed receiving remote video or enabled the video module |
THUNDER_REMOTE_VIDEO_REASON_REMOTE_STOPPED(6) | Remote user stopped sending video or disabled the video module |
THUNDER_REMOTE_VIDEO_REASON_REMOTE_STARTED(7) | Remote user resumed sending remote video or enabled the video module |
typedef NS_ENUM(NSInteger, ThunderAudioOutputRouting);
The type of the current audio routing.
Enumeration Value | Description |
---|---|
HUNDER_AUDIO_OUTPUT_ROUTING_DEFAULT(-1) | Default |
THUNDER_AUDIO_OUTPUT_ROUTING_HEADSET(0) | Headset |
THUNDER_AUDIO_OUTPUT_ROUTING_EARPIECE(1) | Earpiece |
THUNDER_AUDIO_OUTPUT_ROUTING_HEADSETNOMIC(2) | Headset without microphone |
THUNDER_AUDIO_OUTPUT_ROUTING_SPEAKERPHONE(3) | Speakerphone |
THUNDER_AUDIO_OUTPUT_ROUTING_LOUDSPEAKER(4) | Loudspeaker |
THUNDER_AUDIO_OUTPUT_ROUTING_HEADSETBLUETOOTH(5) | Bluetooth headset |
struct CGSize {
CGFloat width;
CGFloat height;
};
Parameter | Description |
---|---|
width | Width |
height | Height |
__attribute__((visibility("default"))) @interface RoomStats : NSObject
@property(nonatomic, assign) uint32_t totalDuration; // Total call duration (s)
@property(nonatomic, assign) uint32_t txBitrate; // Link sending bit rate (bps)
@property(nonatomic, assign) uint32_t rxBitrate; // Link receiving bit rate (bps)
@property(nonatomic, assign) uint32_t txBytes; // Total bytes sent
@property(nonatomic, assign) uint32_t rxBytes; // Total bytes received
@property(nonatomic, assign) uint32_t txAudioBytes; // Total audio bytes sent
@property(nonatomic, assign) uint32_t rxAudioBytes; // Total audio bytes received
@property(nonatomic, assign) uint32_t txVideoBytes; // Total video bytes sent
@property(nonatomic, assign) uint32_t rxVideoBytes; // Total video bytes received
@property(nonatomic, assign) uint32_t txAudioBitrate; // Audio packet sending bit rate (bps)
@property(nonatomic, assign) uint32_t rxAudioBitrate; // Audio packet receiving bit rate (bps)
@property(nonatomic, assign) uint32_t txVideoBitrate; // Video packet sending bit rate (bps)
@property(nonatomic, assign) uint32_t rxVideoBitrate; // Video packet receiving bit rate (bps)
@property(nonatomic, assign) uint32_t lastmileDelay; // Local client-to-edge server delay (ms)
@end
Upstream/downstream traffic information
typedef NS_ENUM(NSInteger, ThunderPublishCDNErrorCode);
Publish stream to external server result status code.
Enumeration Value | Description |
---|---|
THUNDER_PUBLISH_CDN_ERR_SUCCESS(0) | Stream pushing succeeded |
THUNDER_PUBLISH_CDN_ERR_TOCDN_FAILED(1) | Pushing streams to external server (CDN) failed. 1. Check whether the URL is correct. 2. Check whether the token in the URL is valid (generally, CDN stream pushing requires a token; if not, you can ignore it). |
THUNDER_PUBLISH_CDN_ERR_THUNDERSERVER_FAILED(2) | Pushing streams to the internal thunder server failed. 1. Check the anchor's uplink network. 2. Contact us to troubleshoot internal transmission problems. |
THUNDER_PUBLISH_CDN_ERR_THUNDERSERVER_STOP(3) | Stop pushing streams |
__attribute__((visibility("default"))) @interface ThunderRtcLocalVideoStats : NSObject
@property (assign, nonatomic) NSUInteger sendBitrate; // Actual sending bit rate (kbps)
@property (assign, nonatomic) NSUInteger sendFrameRate; // Actual sending frame rate (fps)
@property (assign, nonatomic) NSUInteger encoderOutputFrameRate;// Local encoder output frame rate(fps)
@property (assign, nonatomic) NSUInteger renderOutputFrameRate;// Local renderer frame rate (fps)
@property (assign, nonatomic) NSUInteger targetBitrate;// Current encoder target encoding bit rate (kbps)
@property (assign, nonatomic) NSUInteger targetFrameRate;// Current encoder target encoding frame rate (fps)
// Self-adaptive local video quality since last statistics (based on target frame rate and target bit rate)
@property (assign, nonatomic) ThunderVideoQualityAdaptIndication qualityAdaptIndication;
@property (assign, nonatomic) NSUInteger encodedBitrate;// Video encoding bit rate (Kbps)
@property (assign, nonatomic) NSUInteger encodedFrameWidth;// Encoded video width (px)
@property (assign, nonatomic) NSUInteger encodedFrameHeight;// Encoded video height (px)
@property (assign, nonatomic) NSUInteger encodedFrameCount;// Video frames sent; cumulative
@property (assign, nonatomic) ThunderVideoEncodedType encodedType;// Encoding mode
@property (assign, nonatomic) ThunderVideoCodecType codecType;// Video encoding type
@property (assign, nonatomic) NSUInteger configBitRate; //Configured bit rate (kbps)
@property (assign, nonatomic) NSUInteger configFrameRate;// Configured frame rate
@property (assign, nonatomic) NSUInteger configWidth;// Configured video height
@property (assign, nonatomic) NSUInteger configHeight;// Configured video width
@end
Statistics of local video
__attribute__((visibility("default"))) @interface ThunderRtcLocalAudioStats : NSObject
@property (assign, nonatomic) NSUInteger encodedBitrate; // Encoding rate (kbps)
@property (assign, nonatomic) NSUInteger numChannels;// Number of channels
@property (assign, nonatomic) NSUInteger sendSampleRate;// Sampling rate (Hz)
@property (assign, nonatomic) NSUInteger sendBitrate;// Sending bit rate (average value in kbps)
@property (assign, nonatomic) NSUInteger enableVad;// Whether to enbale VAD when sending audio: 0-no, disable, 1-yes, enable
@end
Statistics of local audio
typedef NS_ENUM(NSInteger, ThunderAudioDeviceStatus);
Audio device capture statuses
Enumeration Value | Description |
---|---|
THUNDER_AUDIO_DEVICE_STATUS_INIT_CAPTURE_SUCCESS(0) | Callback of successful initialization of audio capture device |
THUNDER_AUDIO_DEVICE_STATUS_INIT_CAPTURE_ERROR_OR_NO_PERMISSION(1) | Callback of failed initialization of audio capture device. May be caused by no permission |
THUNDER_AUDIO_DEVICE_STATUS_RELEASE_CAPTURE_SUCCESS(2) | Callback of successful release of audio capture device |
__attribute__((visibility("default"))) @interface ThunderRtcRemoteVideoStats : NSObject
@property (assign, nonatomic) NSUInteger delay; // Delay between pushing and playing remote video stream
@property (assign, nonatomic) NSUInteger width; // Width of remote video stream
@property (assign, nonatomic) NSUInteger height; // Height of remote video stream
@property (assign, nonatomic) NSUInteger totalDelay; // Total audio delay from host to audience (ms)
@property (assign, nonatomic) NSUInteger receivedBitrate; // Receiving bit rate (kbps)
@property (assign, nonatomic) NSUInteger decoderOutputFrameRate; // Remote video decoder output frame rate (fps)
@property (assign, nonatomic) NSUInteger rendererOutputFrameRate; // Remote video renderer output frame rate (fps)
@property (assign, nonatomic) NSUInteger packetLossRate; // PRemote video packet loss rate (%) after anti-packet loss measures
@property (assign, nonatomic) NSUInteger rxStreamType; // Video stream types, including high and low quality streams
@property (assign, nonatomic) NSUInteger totalFrozenTime; // Cumulative time (ms) from a remote user first publishing to the first instance of video freezing
@property (assign, nonatomic) NSUInteger frozenRate; // The cumulative duration of video freezing since a remote user started publishing as a percentage (%) of the total video duration
@end
Statistics of remote video
__attribute__((visibility("default"))) @interface ThunderRtcRemoteAudioStats : NSObject
@property (assign, nonatomic) NSUInteger quality; // Remote user audio stream quality. 0: Unknown; 1: Excellent; 2: Good; 3: Poor, communication is not affected but the user can sense the deficiency; 4: Bad, communication is hindered but possible; 5: Very Bad, communication is essentially impossible; 6: Disconnected, communication is impossible
@property (assign, nonatomic) NSUInteger networkTransportDelay; // Network delay from audio sending end to receiving end
@property (assign, nonatomic) NSUInteger jitterBufferDelay; // Receiving-end delay due to network jitter buffer
@property (assign, nonatomic) NSUInteger totalDelay; // Total delay from host audio capture to audience audio playing (ms)
@property (assign, nonatomic) NSUInteger frameLossRate; // Remote audio stream frame loss rate (%)
@property (assign, nonatomic) NSUInteger numChannels; // Number of channels
@property (assign, nonatomic) NSUInteger receivedSampleRate; // Remote audio sampling rate (Hz)
@property (assign, nonatomic) NSUInteger receivedBitrate; // Average bit rate for remote audio within the statistical period
@property (assign, nonatomic) NSUInteger totalFrozenTime; // Cumulative time (ms) from a remote user joining a channel until audio freezing occurs
@property (assign, nonatomic) NSUInteger frozenRate; // The cumulative duration of audio freezing after a remote user joined a channel as a percentage (%) of the total audio duration
@end
Remote audio statistics
__attribute__((visibility("default")))@interface ThunderMixAudioInfo : NSObject
@property(copy, nonatomic) NSString* _Nonnull uid;
@property(assign, nonatomic) int volume; // [0,100]
@end
Mixed video stream information
__attribute__((visibility("default"))) @interface ThunderMixVideoInfo : NSObject
@property(copy, nonatomic) NSString* _Nonnull uid; // User ID
@property(assign, nonatomic) CGSize size; // Original width and height of user's video
@property(assign, nonatomic) CGRect crop; // Clipped region from source video for use in video mixing
@property(assign, nonatomic) CGRect layout; // User video location on video mixing canvas
@property(assign, nonatomic) int zOrder; // Layer number of this user's video frame in video mixing. Values are integers from [0, 100],
// and the minimum value is 0, indicating the bottommost level
@property(assign, nonatomic) float alpha; // User's video frame transparency in video mixing. Value range: [0.0, 1.0].
// 0.0 indicates complete transparency; 1.0 indicates complete opacity
@end
Mixed video streams source information
typedef NS_ENUM(NSInteger, ThunderVideoBufferType);
Buffer type
Enumeration Value | Description |
---|---|
THUNDER_VIDEOBUFFER_TYPE_PIXELBUFFER(1) | Buffer using Pixel Buffer |
THUNDER_VIDEOBUFFER_TYPE_RAWDATA(2) | Buffer using Raw Data |
__attribute__((visibility("default"))) @interface ThunderRtcLocalDeviceStats : NSObject
@property (assign, nonatomic) CGFloat cpuTotalUsage; // Current system CPU usage (%)
@property (assign, nonatomic) CGFloat cpuAppUsage; // CPU usage of the current application (%)
@property (assign, nonatomic) CGFloat memoryAppUsage; // Memory usage of the current application (%)
@property (assign, nonatomic) CGFloat memoryTotalUsage; // Current system memory usage (%)
@end
CPU/memory usage status
typedef NS_ENUM(NSInteger, ThunderAudioFilePlayerEvent);
Local files playing status
Enumeration Value | Description |
---|---|
AUDIO_PLAY_EVENT_OPEN(1) | File opened |
AUDIO_PLAY_EVENT_PLAY(2) | Playing started |
AUDIO_PLAY_EVENT_STOP(3) | Playing stopped |
AUDIO_PLAY_EVENT_PAUSE(4) | Paused |
AUDIO_PLAY_EVENT_RESUME(5) | Playing resumed |
AUDIO_PLAY_EVENT_END(6) | Playing completed |
AUDIO_PLAY_EVENT_SEEK_COMPLETE(7) | Fast forwarding |
typedef NS_ENUM(NSInteger, ThunderAudioFilePLayerErrorCode);
Error codes about local file playback
Enumeration Value | Description |
---|---|
AUDIO_PLAYER_OPEN_FILE_PATH_ERROR(-4) | Incorrect file path |
AUDIO_PLAYER_OPEN_FILE_FORMAT_NOT_SUPPORT(-3) | Incorrect file format |
AUDIO_PLAYER_OPEN_FILE_DECODER_FAILED(-2) | Decoding file format failed |
AUDIO_PLAYER_CREATE_FILE_DECODER_FAILED(-1) | Parsing file format failed |
AUDIO_PLAYER_STATUS_SUCCESS(0) | Succeeded |