Overview

Jocloud offers various client SDKs, and has a flexible API combination. A global real-time communication network is connected trough 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.

  • ThunderEngine interface class provides all the methods that can be called by applications.
  • ThunderEventDelegate interface class enables callbacks to your application.

Basic Method

MethodFunction
createEngineCreate a ThunderEngine instance and initialize
destroyEngineDestroy a ThunderEngine instance
setThunderEventDelegateSet SDK callback event delegate
getVersionGet SDK version information

Room Management

MethodFunction
setAreaSet user’s area
setSceneIdSet scenario ID
setMediaModeSet media mode
setRoomModeSet room mode
joinRoomJoin a room
leaveRoomLeave a room
updateTokenUpdate token
CallbackFunction
onJoinRoomSuccessCallback when the local user joins a room
onLeaveRoomWithStatsCallback upon leaving a room
sdkAuthResultSDK authentication results notification. For details about authentication, refer to User Authentication Instructions on the official website
onUserBannedCallback on user banned
onUserJoinedCallback on remote user joining room
onUserOfflineCallback on remote user leaving current room
onRoomStatsCallback on uplink/downlink traffic (periodic callback at an interval of 2s)
bizAuthResultCallback on service authentication results
onTokenWillExpireCallback on token to be expired
thunderEngineTokenRequestCallback on expired authentication

Audio Publishing

MethodFunction
setAudioConfigSet Audio Profiles
setMicVolumeSet microphone volume
stopLocalAudioStreamDisable/Enable local audio (including audio capture, encoding and upload)
setAudioSourceTypeSet publishing mode
CallbackFunction
onFirstLocalAudioFrameSentCallback on the first local audio frame sent
onLocalAudioStatsLocal audio statistics

Audio Subscription

MethodFunction
stopAllRemoteAudioStreamsStop/Resume receiving all remote audio streams
stopRemoteAudioStreamStop/Resume receiving audio stream of a specified user
setPlayVolumeSet local playing volume of a user
CallbackFunction
onRemoteAudioStoppedCallback on stopping/starting remote user audio stream
onRemoteAudioStatsOfUidCallback on remote audio stream information during the call

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 local view display mode
stopLocalVideoStreamEnable/Disable local video sending
CallbackFunction
onFirstLocalVideoFrameSentCallback on the first local video frame sent
onLocalVideoStatsCallback on local video statistics

Video Subscription

MethodFunction
stopAllRemoteVideoStreamsStop/Resume receiving all remote video streams
stopRemoteVideoStreamStop/Resume receiving video stream of a specified user
setRemoteCanvasScaleModeSet the scale mode of the remote video stream on the canvas
setRemoteVideoCanvasSet the rendering view of the remote video
setRemotePlayTypeSets the type of remote user's render view
setMultiVideoViewLayoutSet the layout parameters of the multi videos on the view
CallbackFunction
onRemoteVideoStoppedCallback when the remote user's video stream starts or stops
onRemoteVideoStatsOfUidReport statistics of remote user video stream
onRemoteVideoPlayCallback when displaying the first frame of remote video
onVideoSizeChangedOfUidCallback when the resolution of local or remote video changes

Network status

CallbackFunction
onNetworkQualityReport the uplink and downlink network quality of each user
onNetworkTypeChangedCallback when the network type changes
onConnectionStatusReport the connection status with the server
thunderEngineConnectionLostCallback when losing connection with server

Publishing detection

N/A

Video mixing and stream publishing

MethodFunction
setLiveTranscodingTaskAdd or update transcoding task
removeLiveTranscodingTaskRemove a transcoding task
addPublishTranscodingStreamUrlAdd a push address of transcoding stream
removePublishTranscodingStreamUrlRemove the push address of the transcoding stream
addPublishOriginStreamUrlAdd a push address of source stream
removePublishOriginStreamUrlRemove the push address of source stream
enableMixVideoExtraInfoEnable video mixing with media extra information
CallbackFunction
onPublishStreamToCDNStatusWithUrlReport the result of pushing stream to the CDN

Audio Recording

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

Cross-room Microphone Connection

MethodFunction
addSubscribeSubscribe stream of specified user across the room
removeSubscribeCancel cross-room subscription of specified users

Camera Management

MethodFunction
switchFrontCameraSwitch to front/rear camera
setVideoCaptureOrientationSet portrait/landscape, default is portrait. Available for publishing before preview.
setLocalVideoMirrorModeSet camera mirroring. Available for publishing before preview, valid for front camera only

Screen Sharing

N/A

Real-time Watermark

MethodFunction
setVideoWatermarkAdd local video watermark

Video Dual Stream

N/A

Audio Player

MethodFunction
createAudioFilePlayerCreate file player ThunderAudioFilePlayer object
destroyAudioFilePlayerDestroy file player ThunderAudioFilePlayer object
MethodFunction
openOpen audio file, formats supported: mp3, aac, wav
closeClose audio file
playStart playing
StopStop playing
pausePause playing
resumeContinue to play
seekSkipping to specified play time
getTotalPlayTimeMSGet the total play time of files
getCurrentPlayTimeMSGet the time which has been played
setPlayerLocalVolumeAdjust volume of music file in mixed video being played locally. Please call this method in room
setPlayerPublishVolumeAdjust volume of music file in mixed video being played remotely. Please call this method in room
getPlayerLocalVolumeGet the local playing volume of the file
getPlayerPublishVolumeGet the remote playing volume of the file
setLoopingSet times of loop playbacks
setPlayerDelegateSet a player callback delegate
enableSpectrumEnable/Disable spectrum
enableVolumeIndicationCallback on turning on/off volume
setMixStandardSet whether the accompaniment is a standard stream for video mixing
isMixStandardQuery whether the accompaniment is a standard stream for video mixing
getCurrentSpectrumObtain spectrum information; value range [0-1]
CallbackFunction
onAudioFileVolumeCallback when playing volume
onAudioFilePlayEndCallback when end playing
onAudioFilePlayErrorCallback when audio file playing occur error
onAudioFilePlayingCallback when start playing
onAudioFilePauseCallback when pause playing
onAudioFileResumeCallback when resume playing
onAudioFileStopCallback when stop playing
onAudioFileSeekCompleteCallback when the audio file seeking is completed
onAudioFileStateChangeReport the status of the playing audio file

Sound change in reverb

MethodFunction
setVoiceChangerSet voice change mode
setSoundEffectSet different sound effects
setEnableReverbEnable/Disable reverb
setReverbParamSet reverb parameters
setEnableEqualizerEnable/Disable equalizer
setEqGainsSet equalizer parameters
setEnableCompressorEnable/Disable compressor
setCompressorParamSet compressor parameters
setEnableLimiterEnable/Disable pressure limiter
setLimiterParamSet pressure limiter parameters

Voice Positioning

MethodFunction
enableVoicePositionEnable/Disable voice stereo of remote users
setRemoteUidVoicePositionSet spatial location and volume of remote user's voice

Volume Prompt

MethodFunction
enableCaptureVolumeIndicationCallback on turning on/off microphone volume
setAudioVolumeIndicationCallback on turning on/off user volume
CallbackFunction
onCaptureVolumeIndicationReport the cpature volume
onPlayVolumeIndicationReport which users are speaking and the speakers' volume

Voice Routing

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

In-ear Monitor

MethodFunction
setEnableInEarMonitorEnable/Disable ear monitor

Audio Device Management

CallbackFunction
onAudioCaptureStatusReport the status of the audio capture device

Video Device Management

CallbackFunction
onVideoCaptureStatusReport the status of the video capture device

Media extra information

MethodFunction
setMediaExtraInfoDelegateSet callback delegate of media extra information ThunderMediaExtraInfoDelegate
sendMediaExtraInfoSend media extra information (during audio/video streaming)
CallbackFunction
onSendMediaExtraInfoFailedStatusCallback when failure in sending media extra information
onRecvMediaExtraInfoCallback when received media extra information
onRecvMixAudioInfoCallback when received extra information of mixed audio stream
onRecvMixVideoInfoCallback when received extra information of mixed video stream

Raw Audio Data

MethodFunction
enableAudioPlaySpectrumEnable/Disable data callback on audio play spectrum
setAudioPlaySpectrumInfoSet audio playback spectrum parameters
enableCapturePcmDataCallBackEnable/Disable data callback on audio capture
syncMediaPlayingProgressSynchronize play progress of external accompaniment video for mixed video synchronization. Audio accompaniment and video accompaniment cannot be supported at the same time.
setRecordingAudioFrameParametersSet the mode for using raw audio recording data during callback onRecordAudioFrame
setPlaybackAudioFrameParametersSet the mode for using raw audio playback data during callback onPlaybackAudioFrame
CallbackFunction
onAudioPlaySpectrumDataCallback on audio play spectrum data
CallbackFunction
onRecordAudioFrameCallback on raw audio capture data
onPlaybackAudioFrameCallback on raw audio play data
onPlaybackAudioFrameBeforeMixingCallback of original data decoded by remote user can differentiate users through different uids

Raw Video Data

MethodFunction
registerVideoCaptureFrameObserverSet the interface for callback on local video preprocessing
registerVideoDecodeFrameObserverCustomize decoding picture rendering
CallbackFunction
needThunderVideoCaptureFrameDataTypeDeclare to SDK data in which format is to be used
onVideoCaptureFrameReceive a frame of data from capture for processing and return processed data
onVideoCaptureFrameReturn original texture parameters and target texture parameters
CallbackFunction
onVideoDecodeFrameCustom rendering of a decoded image is to cut out the decoded image of SDK for custom rendering of services

Custom Audio Capture

MethodFunction
enableCustomAudioSourceEnable external audio capture
pushCustomAudioRawDataPush external audio stream
pushCustomAudioSampleBufferPushing an external audio frame
disableCustomAudioSourceDisable external audio capture
CallbackFunction
audioCaptureStartAudio capture starts
audioCaptureDataCallback on audio capture data
audioCaptureStopAudio capture stops
audioRenderStartAudio rendering starts
audioRenderDataCallback on audio rendering data
audioRenderStopAudio rendering stops

Custom Video Capture

MethodFunction
setCustomVideoSourceSet external video capture source
CallbackFunction
onInitializeInitialize video source
bufferTypeObtain Buffer type
onStartStart video source
onStopStop video source
onDisposeDispose video source
CallbackFunction
consumePixelBufferInterface for pushing raw video data
consumeRawDataInterface for pushing raw video data
consumeCMSampleBufferInterface for pushing raw video data

Audio Self-rendering

MethodFunction
enableRenderPcmDataCallBackEnable/Disable callback on audio rending data
CallbackFunction
onAudioRenderPcmDataCallback audio rendering data

Video Self-rendering

MethodFunction
registerVideoDecodeFrameObserverSet decoding data callback for video stream of a certain vid
CallbackFunction
onVideoDecodeFrameReceive decoded frame data from decoder

Custom Messages

MethodFunction
sendUserAppMsgDataSending developer's custom broadcast messages
CallbackFunction
onRecvUserAppMsgDataCallback when received developer's custom broadcast messages
onSendAppMsgDataFailedStatusCallback on failures in sending custom broadcast message of service

Log Management

MethodFunction
setLogFilePathSet directory for SDK to output log files. A directory with write permissions must be specified.
setLogLevelSet log levels
setLogCallbackSet log callback. Once log callback is set, setLogFilePath is invalid
CallbackFunction
onThunderRtcLogWithLevelCallback on log information

Other methods

MethodFunction
enableWebSdkCompatibilityEnable/Disable WebSDK compatibility
<