Overview

Jocloud provides reliable QoE (quality of experience) for real-time audio/video communications through a global real-time network.

ThunderBolt-WebRtc is a JavaScript library loaded through HTML web pages. It connects through browser APIs to operate audio and video controls. Its global network APIs combine flexibly to realize reliable real-time audio communication between webs or between web and mobile, or PC clients.

Video interaction and audio-only interaction share the same Web SDK.

Basic Functions

APIDescription
new WebRTCCreate a WebRTC object
initInitialize
isSupportedCheck whether the browser supports Jocloud Web SDKs
getSupportedCodecGet the supported code
isScreenShareSupportedDetermine whether screen sharing is supported
VERSIONVersion number
onAdd event bindings
offCancel event bindings

Room Management

APIDescription
joinRoomJoin a channel
leaveRoomLeave a channel
setAreaSet the user region
APIFunction
updateTokenUpdate a token
CallbackDescription
token_requestThe token expired, needs to be updated immediately
token_will_expireThe token will expire, needs to be updated
sdk_auth_resultReturn token authentication results

Publish

APIDescription
createStreamCreate audio/video streams
closeStreamClose audio/video streams
publishPublish audio/video streams
unpublishCancel audio/video stream publishing
setPublisherVolumeSet microphone volume
setVideoModeSwitch local video stream brackets
changeDeviceSwitch input devices
CallbackDescription
publish_auth_failFailure to pass the publishing authentication will cut off the publishing
audio_track_endAudio track ended, often encountered during mid-publishing microphone disconnection
video_track_endVideo track ended, often encountered during mid-publishing camera disconnection

Subscription

APIDescription
subscribeSubscribe to audio/video streams
unsubscribeUnsubscribe to audio/video streams
CallbackDescription
remote_stream_addDetect a remote media stream in the channel; you can then subscribe according to the service requirements.
remote_stream_removeWhen a remote media stream stops, the subscription is canceled according to service requirements.
remote_stream_updateA remote stream is updating. No need to process it.

Play Streams

APIDescription
playPlay the stream
stopPlayStop playing the stream
resumeResume playing the stream
isPlayingDetermine whether the stream is playing
setAudioVolumeSet the playing volume
setAudioOutputDeviceSelect the playing device
CallbackDescription
player_state_changeThe player status changes

Media Streams

APIDescription
hasAudioDetermine whether there is an audio
hasVideoDetermine whether there is a video
enableAudioEnable the audio
disableAudioDisable the audio
enableVideoEnable the video
disableVideoDisable the video
CallbackDescription
stream_reconnect_startMedia stream starts reconnecting
stream_reconnect_endMedia stream reconnected
first_audio_frame_decodeSubscribe to the first decoded audio frame
first_video_frame_decodeSubscribe to the first decoded video frame

Stream Pushing

APIDescription
addPublishOriginStreamUrlAdd the address of a source stream pushing to CDN
removePublishOriginStreamUrlRemove the address of a source stream pushing to CDN
addPublishTranscodingStreamUrlAdd the address of a mixed stream pushing to CDN
removePublishTranscodingStreamUrlRemove the address of a mixed stream pushing to CDN
setLiveTranscodingTaskSet a stream mixing task
removeLiveTranscodingTaskRemove a stream mixing task

Cross-Room Subscription

APIDescription
addSubscribeSubscribe across rooms
removeSubscribeCancel the cross-room subscription

Dual-Stream Video

APIDescription
createDualStreamCreate a dual-channel video stream
changeRemoteVideoStreamTypeSelect high/low quality streams

Audio Mixing

APIDescription
startAudioMixingEnable audio mixing
stopAudioMixingDisable audio mixing
pauseAudioMixingPause audio mixing
resumeAudioMixingResume audio mixing
setAudioMixingVolumeSet the audio mixing volume
getAudioMixingDurationGet the total duration of audio mixing
getAudioMixingTimeGet the current audio mixing time
setAudioMixingTimeSet the audio mixing time
stopAllAudioMixingDisable all audio mixing
pauseAllAudioMixingPause all audio mixing
resumeAllAudioMixingResume all audio mixing
CallbackDescription
audio_mixing_playedAudio mixing started
audio_mixing_finishedAudio mixing completed

Volume Prompts

APIDescription
getPublisherAudioLevelGet the current output stream volume
getSubscriberAudioLevelGet the current subscribed stream volume
enableAudioLevelReportEnable audio volume reporting
disableAudioLevelReportDisable audio volume reporting
CallbackDescription
active_speakerThe user in the channel with the loudest voice changes
audio_level_reportReport volume events regularly every 2 seconds

Device Management

APIDescription
getDevicesGet all audio/video devices
getAudioDevicesGet audio input devices such as microphones
getVideoDevicesGet video input devices such as cameras
getPlayoutDevicesGet playing devices
CallbackDescription
audio_input_changedThe audio input device added or removed
video_input_changedThe video input device added or removed
audio_output_changedThe audio output device added or removed

Network Connection

CallbackDescription
network_scoreReport the local user's uplink and downlink network quality scores every 2 seconds
connectedServer connection succeeded
reconnectReconnecting to the server

Statistics

APIDescription
getSystemStatsGet the system information
getSignalConnectionStateGet the connection status of the signaling channel
getMediaConnectionStateGet the connection status of the media channel
getSessionStatsGet the session-level connection statistics
getUplinkVideoStatsGet the uplink video stream statistics
getUplinkAudioStatsGet the uplink audio stream statistics
getDownlinkVideoStatsGet the downlink video stream statistics
getDownlinkAudioStatsGet the downlink audio stream statistics

Log

APIDescription
setLogLevelSet the log level
<