Overview

Jocloud offers various client SDKs, and has a flexible API combination. A global real-time communication network is connected through SDK, to provide real-time audio/video communication services with stable and reliable quality for developers.

The Jocloud SDK has a code ofThunderbolt, and a pure audio SDK for a mobile terminal has a code ofThunder.

Notes: Unless otherwise specified, all callback events in the document are monitored through theThunderEventHandlerinterface class.

Basic Method

MethodFunction
createEngineCreate and initialize a ThunderEngine instance object.
createWithLoopCreate and initialize a ThunderEngine instance object, and specifying a running thread of a callback function in a ThunderEventHandler class.
destroyEngineDestroy the ThunderEngine instance object.
getVersionGet SDK version information

Room Management

MethodFunction
setAreaSet user’s area
setSceneIdSet a scenario ID
setMediaModeSet media mode
setRoomModeSet room mode
joinRoomJoin a room
leaveRoomLeave a room
updateTokenUpdate Token
CallbackFunction
onJoinRoomSuccessCallback after room joining succeeds
onLeaveRoomCallback upon leaving a room
onSdkAuthResultCallback on SDK authentication result. For authentication details, refer to "User Authentication Description" on official website.
onUserBannedCallback on user banned
onUserJoinedCallback on user joining a current room
onUserOfflineCallback on user leaving a current room
onRoomStatsCallback on uplink/downlink traffic (periodic callback at an interval of 2 seconds)
onBizAuthResultCallback on service authentication results
onTokenWillExpireCallback on token to be expired
onTokenRequestedCallback on token expired

Audio Publishing

MethodFunction
setAudioConfigSet an audio mode
setAudioSourceTypeSet audio publishing mode
setMicVolumeSet microphone volume
stopLocalAudioStreamAudio Publishing (including enabling capture, encoding and stream publishing)
CallbackFunction
onFirstLocalAudioFrameSentCallback on first local audio frame sent successfully
onLocalAudioStatsStatistics callback for local audio streams

Audio Subscription

MethodFunction
stopAllRemoteAudioStreamsStop/Receive all audio data
stopRemoteAudioStreamStop/Receive audio data of specified users
setRemoteAudioStreamsVolumeSet a local playing volume of a certain remote user
CallbackFunction
onRemoteAudioStoppedCallback on enabling/disabling remote user’s audio stream
onRemoteAudioStatsOfUidStatistics callback for remote audio streams

Video Publishing

MethodFunction
setVideoEncoderConfigSet video encoding configuration
setLocalVideoCanvasSet the rendering canvas of a local video
enableLocalVideoCaptureEnable/Disable local video capture
startVideoPreviewStart video preview of local camera
stopVideoPreviewStop video preview of a local camera
setLocalCanvasScaleModeSet a scaling mode of a local canvas
setLocalVideoMirrorModeSet local video mirror mode
stopLocalVideoStreamStop/Start the sending of a local video (codes included)
CallbackFunction
onFirstLocalVideoFrameSentCallback on first local video frame sent successfully
onLocalVideoStatsCallback on local video stream statistics

Video Subscription

MethodFunction
stopAllRemoteVideoStreamsStop/Receive all video data
stopRemoteVideoStreamStop/Receive specified video data
setRemoteCanvasScaleModeSet a scaling mode of a remote canvas
setMultiVideoViewLayoutSet layout parameters of a rendering canvas of multi-user microphone connection
setRemoteVideoCanvasSet the rendering view of the remote video
setRemotePlayTypeSet the type of remote user’s rendering canvas
CallbackFunction
onRemoteVideoStoppedCallback on stopping/publishing user’s video stream
onRemoteVideoStatsOfUidStatistics callback for remote video streams
onRemoteVideoPlayCallback on displayed first remote video frame
onVideoSizeChangedCallback on changed resolution of a subscribed video

Network status

CallbackFunction
onNetworkQualityCallback on uplink and downlink network quality of a user
onNetworkTypeChangedCallback on network status change
onConnectionStatusCallback on server network connection status
onConnectionLostCallback on lost network connection with a server

Publishing detection

N/A

Video mixing and stream publishing

MethodFunction
setLiveTranscodingTaskAdd/update transcoding task
removeLiveTranscodingTaskRemove a transcoding task
addPublishTranscodingStreamUrlAdd a stream publishing address of a transcoding stream
removePublishTranscodingStreamUrlRemove a stream publishing address of a transcoding stream
addPublishOriginStreamUrlAdd the source stream publishing address
removePublishOriginStreamUrlRemove the source stream publishing address
enableMixVideoExtraInfoEnable video mixing with media extra information
syncMediaPlayingProgressSynchronize a play progress of external audio accompaniment or video accompaniment to synchronize the audio mixing or video mixing
CallbackFunction
onPublishStreamToCDNStatusCallback on CDN stream publishing result

Audio Recording

MethodFunction
startAudioSaverStart saving audio data in aac format
stopAudioSaverStop saving audio data in aac format

Cross-room Microphone Connection

MethodFunction
addSubscribeSubscribe stream of specified user across the room
removeSubscribeRemove the subscription of stream of specified user across the room

Camera Management

MethodFunction
switchFrontCameraSwitch front/rear camera
setVideoCaptureOrientationSet a publishing angle of camera (landscape/portrait)

Screen Sharing

N/A

Real-time Watermark

MethodFunction
setVideoWatermarkSet watermark of local video

Video Dual Stream

N/A

Audio Player

MethodFunction
createAudioFilePlayerCreate an instance object ThunderAudioFilePlayer of an audio file player
destroyAudioFilePlayerDestroy an instance objectThunderAudioFilePlayer of an audio file player
MethodFunction
openOpen an accompaniment file
closeClose an accompaniment file
playStart playing
StopStop playing
pausePause
resumeResume
seekJump to specified time for playing
getTotalPlayTimeMSGet total play time of a file
getCurrentPlayTimeMSGet current play time of a file
setPlayVolumeSet the playing volume of current file
setPlayerLocalVolumeSet the local playing volume of a file
setPlayerPublishVolumeSet the remote playing volume of a file
getPlayerLocalVolumeGet the local playing volume of a file
getPlayerPublishVolumeGet the remote playing volume of a file
getAudioTrackCountGet the number of audio tracks
selectAudioTrackSelect an audio track
setSemitoneSet a tone for audio playing
setLoopingSet a looping count
enablePublishWhether to use a currently played file as a live accompaniment
setPlayerNotifySet a play callback interface ThunderAudioFilePlayer.IThunderAudioFilePlayerCallback
enableVolumeIndicationEnable Callback on a file playing volume ThunderAudioFilePlayer.IThunderAudioFilePlayerCallback.onAudioFileVolume
setMixStandardSet whether the accompaniment is a standard stream for video mixing
isMixStandardQuery whether the accompaniment is a standard stream for video mixing
CallbackFunction
onAudioFilePlayErrorCallback on audio file callback error
onAudioFileVolumeCallback on audio file playing volume
onAudioFileSeekCompleteCallback on completion of fast forwarding to specified time
onAudioFilePlayingCallback on starting playing
onAudioFilePauseCallback on pausing playing
onAudioFileResumeCallback on resuming playing
onAudioFileStopCallback on playback being stopped by user
onAudioFilePlayEndCallback on ending playback

Voice Change and Reverb

MethodFunction
setVoiceChangerSet voice change mode
setSoundEffectSet sound effect mode
setEnableEqualizerEnable/Disable local voice equalizer
setEqGainsSet parameters of an equalizer
setEnableReverbEnable/Disable local sound reverberation
setReverbExParameterSet reverberation parameters for sound
setEnableCompressorEnable/Disable sound compressor
setCompressorParamSet parameters for sound compressor
setEnableLimiterEnable/Disable limiter
setLimiterParamSet limiter parameters

Voice Positioning

MethodFunction
enableVoicePositionEnable/Disable voice stereo of remote users
setRemoteUidVoicePositionSet space positions and volumes of voice stereo of remote users

Volume Prompt

MethodFunction
enableCaptureVolumeIndicationEnable/Disable capture volume callback
setAudioVolumeIndicationEnable/Disable speaker volume callback
CallbackFunction
onCaptureVolumeIndicationCallback on capture volume
onPlayVolumeIndicationCallback on speaker volume

Voice Routing

MethodFunction
isLoudspeakerEnabledQuery whether a loudspeaker is enabled at present
enableLoudspeakerEnable a loudspeaker
setLoudSpeakerVolumeSet loudspeaker volume

In-ear Monitor

MethodFunction
setEnableInEarMonitorEnable/Disable in-ear monitor

Audio Device Management

CallbackFunction
onAudioCaptureStatusCallback on changes in audio device capture status

Video Device Management

CallbackFunction
onVideoCaptureStatusNotification of change in camera capture status

Media extra information

MethodFunction
setMediaExtraInfoCallbackSet callback monitoringIThunderMediaExtraInfoCallback on media extra information
sendMediaExtraInfoSend media extra information
CallbackFunction
onSendMediaExtraInfoFailedStatusCallback on failure in sending secondary media information
onRecvMediaExtraInfoReceived media extra information
onRecvMixAudioInfoReceived extra information of mixed audio stream
onRecvMixVideoInfoReceived extra information of mixed video stream

Raw Audio Data

MethodFunction
enableAudioPlaySpectrumEnable/Disable data callback onAudioPlaySpectrumData of audio play spectrum
setAudioPlaySpectrumInfoSet callback information of audio play spectrum data
enableCapturePcmDataCallBackEnable/Disable callback onAudioCapturePcmData of captured audio data
setRecordingAudioFrameParametersSet a format for callback on captured raw data
setPlaybackAudioFrameParametersSet a format for callback on play data
registerAudioFrameObserverRegister an audio observer object IAudioFrameObserver
CallbackFunction
onAudioPlaySpectrumDataCallback on audio play spectrum data
onAudioCapturePcmDataCallback on audio capture data
CallbackFunction
onRecordAudioFrameCallback on raw audio capture data
onPlaybackAudioFrameCallback on raw audio play data
onPlaybackAudioFrameBeforeMixingCallback on raw data decoded by remote audio users

Raw Video Data

MethodFunction
registerVideoCaptureTextureObserverRegistering a video capture texture observer for IGPUProcess, such as beauty processing
registerVideoCaptureFrameObserverRegistering a video capture frame observer IVideoCaptureObserver
CallbackFunction
onInitAllowing users to use third-party special effects
onDestroyDestroying resources of special effects
onDrawRendering each frame
onOutputSizeChangedCallback on updating a texture size
CallbackFunction
onCaptureVideoFrameCallback on capture video frame

Custom Audio Capture

MethodFunction
setCustomAudioSourceSet parameters of external audio capture
pushCustomAudioFramePushing an external audio frame
setExternalAudioProcessorSet external audio processor

Custom Video Capture

MethodFunction
setCustomVideoSourceSet customized video source

Audio Self-rendering

MethodFunction
enableRenderPcmDataCallBackEnabling/disabling callback onAudioRenderPcmData of rendered audio data
CallbackFunction
onAudioRenderPcmDataCallback on audio rendering data

Video Self-rendering

MethodFunction
registerVideoDecodeFrameObserverRegistering a decoded YUV (I420) video data observer IVideoDecodeObserver
CallbackFunction
onVideoDecodeFrameCallback on decoded YUV (I420) video data

Custom Messages

MethodFunction
sendUserAppMsgDataSending custom broadcast messages to a developer
CallbackFunction
onRecvUserAppMsgDataCallback on custom broadcast messages received by a developer
onSendAppMsgDataFailedStatusCallback on failure in sending custom broadcast messages to a developer

Log Management

MethodFunction
setLogFilePathSetting directory for SDK to output log files
setLogLevelSetting log levels
setLogCallbackSetting log callback IThunderLogCallback
CallbackFunction
onThunderLogWithLevelCallback on log information

Other methods

MethodFunction
enableWebSdkCompatibilityEnable/Disable WebSDK compatibility
<