CloudHub Docs
Download Documents

RTS


CloudHubRTS Electron

getVersion

Gets the SDK version number

getVersion(): string

getStreamID

Gets a streamid

getStreamID(): string

getClientId

Get user id

getClientId(): string

startPush

Start streaming

startPush(urlPush: string)
parameterexplanation
urlPushThe address to push

stopPush

Stop streaming

stopPush()

isPushing

Is it pushing?

isPushing(): boolean

return

setVideoQuality

Set push video quality

setVideoQuality(width: number, height: number, fr: number): number
parameterexplanation
widthVideo width
heightVideo high
frVideo frame rate Value: 1,7,10,15,24,30

return

startCamera

Start camera capture

startCamera()
parameterexplanation
deviceIdCamera device id, default is''

return

stopPush

Stop camera capture

stopPush()
parameterexplanation
deviceIdCamera device id, default is''

return

startMicrophone

Turn on audio capture

startMicrophone()

return

stopMicrophone

Stop audio capture

stopMicrophone()

return

setAudioQuality

Set push video quality

setAudioQuality(quality = 1)
parameterexplanation
qualityAudio quality default 1

enableVolumeIndication

Set the audio quality of the local transmission

enableVolumeIndication(interval: number)
parameterexplanation
intervalSpecify the time interval for the volume alert:
<=0 : Disable the volume alert function.
>0 : Return the interval of the volume alert, the unit is milliseconds.

return

setupLocalVideo

Play local video

setupLocalVideo(view: Element)
parameterexplanation
viewPlay video window element

removeLocalVideo

Stop playing local video

removeLocalVideo()

getSourceId

Get push ID

getSourceId()

getUrl

Get URL address

getUrl()

美颜

setBeautyEffectOptions

Turn on or off the local beauty function, and set the beauty effect options

setBeautyEffectOptions(enable = false, options: object, deviceId = '')
parameterexplanation
enableWhether to enable beauty
optionsSet beauty options:
object.lighteningContrastLevel Contrast, used with lighteningLevel. The larger the value, the stronger the contrast between light and dark. Value range 0 1 2
object.lighteningLevel Brightness, can be used to achieve visual effects such as whitening. The value range is [0.0, 1.0], where 0.0 represents the original brightness, and the default value is 0.7
object.smoothnessLevel Ruddy degree, which can be used to achieve visual effects such as ruddy skin tone. The value range is [0.0, 1.0], where 0.0 represents the original redness, and the default value is 0.1
object.rednessLevel Smoothness, which can be used to achieve visual effects such as acne removal and skin resurfacing. The value range is [0.0, 1.0], where 0.0 represents the original smoothing level, and the default value is 0.5
deviceIdCamera id

return

setVideoEffectOptions

Turn on or off advanced beauty, and set beauty effect options

setVideoEffectOptions(enable = false, options: object, deviceId = '')
parameterexplanation
enableWhether to enable beauty
optionsSet beauty options:
object.sharpLevel sharpening, the value range is [0.0, 1.0], where 0.0 means the original effect, and the default value is 0.5. Can be used to achieve sharpening and other visual effects
object.thinFaceLevel Thin face, the value range is [0.0, 1.0], where 0.0 means the original effect, and the default value is 0.5. Can be used to achieve visual effects such as face-lifting
object.bigEyesLevel big eyes, the value range is [0.0, 1.0], where 0.0 means the original effect, and the default value is 0.5. Can be used to achieve visual effects such as big eyes
object.sticker Sticker 0-No 1-Princess Mask2-Black Cat Glasses3-Cartoon Boy4-Cartoon Girl5-Funny Baby6-Christmas Elk7-Happy Birthday 8-Sweet Cone 9-Lucky Cat 10-Cute Pig
object.portraitBackground virtual background 0-none 1-blue sky 2-lawn 3-white wall
deviceIdCamera id

return

startPlayMovie

Play local movies

startPlayMovie(mediaFile: string, loopback: boolean, cycle: boolean, paused = false)
parameterexplanation
mediaFileThe absolute path of the local movie
loopbackDo you just listen to yourself
cycleWhether to loop
pausedOptional, indicates whether to pause immediately after starting

stopPlayMovie

Stop playing local movie

stopPlayMovie(mediaFile: string)
parameterexplanation
mediaFileThe absolute path of the local movie

pauseMediaFile

Pause local movie

pauseMediaFile(mediaFile: string)
parameterexplanation
mediaFileThe absolute path of the local movie

getMovieInfo

Get basic information about local movies

getMovieInfo(mediaFile: string)
parameterexplanation
mediaFileThe absolute path of the local movie

resumeMediaFile

Continue playing local movies

resumeMediaFile(mediaFile: string)
parameterexplanation
mediaFileThe absolute path of the local movie

getMovieDuration

Get movie duration

 getMovieDuration(mediaFile: string)
parameterexplanation
mediaFileThe absolute path of the local movie

return

getMovieCurrentPosition

Get the progress of a local movie

getMovieCurrentPosition(mediaFile: string)
parameterexplanation
mediaFileThe absolute path of the local movie

return

setMoviePosition

Set local movie playback progress

setMoviePosition(mediaFile: string, pos: string)
parameterexplanation
mediaFileThe absolute path of the local movie
posSet progress

Desktop sharing

getScreenWindowsInfo

Get system window ID

getScreenWindowsInfo()

getScreenDisplaysInfo

Get screen ID

getScreenDisplaysInfo()

startScreenCaptureByDisplayId

Start screen sharing

startScreenCaptureByDisplayId(
        displayId: number,
        excludeWindow: number,
        framerate: number,
        bitrate: number,
        isCaptureCursor: boolean
    )
parameterexplanation
displayIdShared screen id
excludeWindowThe id of the window that is not shared, only one window can not be shared
framerateframeRate
bitratebitRate
isCaptureCursorWhether to capture the mouse

startScreenCaptureByWindowId

Share the screen via window information.

startScreenCaptureByWindowId(
        windowId: number,
        excludeWindow = 0,
        framerate = 5,
        bitrate = 1200,
        isCaptureCursor = false
    ) 
parameterexplanation
displayIdShared window Id
excludeWindowThe id of the window that is not shared, only one window can not be shared
framerateframeRate
bitratebitRate
isCaptureCursorWhether to capture the mouse

stopScreenCapture

Stop screen sharing

stopScreenCapture() 

startSpeakerCaptureWhileSharing

Share desktop and turn on desktop sound

startSpeakerCaptureWhileSharing()

stopSpeakerCaptureWhileSharing

Share desktop, turn off desktop sound

stopSpeakerCaptureWhileSharing()

getDeviceManager

Get device management object

getDeviceManager()

enableDeepLearningDenoise

Enable or disable AI noise reduction mode.

rtcEngine.enableDeepLearningDenoise ( enabled ) ;

Parameters

ParametersDescription
enabledWhether to enable AI noise reduction mode:
true:(Default) Enabled.
false: Shut down.

return