CloudHubRTS Electron
- Overview
- RtsEngine
- RtsUpStream
- RtsUpStreamEventHandler
- RtsDownStream
- RtsDownStreamEventHandler
- RtsMixingUpstream
- RtsMixingUpstreamEventHandler
- RtsServerStreamMixing
- RtsServerStreamMixingEventHandler
- RtsDevicesManager
- Update log
Push streaming audio and video related
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)
parameter | explanation |
---|---|
urlPush | The address to push |
stopPush
Stop streaming
stopPush()
isPushing
Is it pushing?
isPushing(): boolean
return
- true
- false
setVideoQuality
Set push video quality
setVideoQuality(width: number, height: number, fr: number): number
parameter | explanation |
---|---|
width | Video width |
height | Video high |
fr | Video frame rate Value: 1,7,10,15,24,30 |
return
- 0 success
- -1 failure
startCamera
Start camera capture
startCamera()
parameter | explanation |
---|---|
deviceId | Camera device id, default is'' |
return
- 0 success
- -1 failure
stopPush
Stop camera capture
stopPush()
parameter | explanation |
---|---|
deviceId | Camera device id, default is'' |
return
- 0 success
- -1 failure
startMicrophone
Turn on audio capture
startMicrophone()
return
- 0 success
- -1 failure
stopMicrophone
Stop audio capture
stopMicrophone()
return
- 0 success
- -1 failure
setAudioQuality
Set push video quality
setAudioQuality(quality = 1)
parameter | explanation |
---|---|
quality | Audio quality default 1 |
enableVolumeIndication
Set the audio quality of the local transmission
enableVolumeIndication(interval: number)
parameter | explanation |
---|---|
interval | Specify 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
- 0 success
- non0 failure
setupLocalVideo
Play local video
setupLocalVideo(view: Element)
parameter | explanation |
---|---|
view | Play 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 = '')
parameter | explanation |
---|---|
enable | Whether to enable beauty |
options | Set 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 |
deviceId | Camera id |
return
- 0 success
- non0 failure
setVideoEffectOptions
Turn on or off advanced beauty, and set beauty effect options
setVideoEffectOptions(enable = false, options: object, deviceId = '')
parameter | explanation |
---|---|
enable | Whether to enable beauty |
options | Set 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 |
deviceId | Camera id |
return
- 0 success
- non0 failure
Video file related
startPlayMovie
Play local movies
startPlayMovie(mediaFile: string, loopback: boolean, cycle: boolean, paused = false)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
loopback | Do you just listen to yourself |
cycle | Whether to loop |
paused | Optional, indicates whether to pause immediately after starting |
stopPlayMovie
Stop playing local movie
stopPlayMovie(mediaFile: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
pauseMediaFile
Pause local movie
pauseMediaFile(mediaFile: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
getMovieInfo
Get basic information about local movies
getMovieInfo(mediaFile: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
resumeMediaFile
Continue playing local movies
resumeMediaFile(mediaFile: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
getMovieDuration
Get movie duration
getMovieDuration(mediaFile: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
return
- A number
getMovieCurrentPosition
Get the progress of a local movie
getMovieCurrentPosition(mediaFile: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
return
- Returns the current playing time of the media
setMoviePosition
Set local movie playback progress
setMoviePosition(mediaFile: string, pos: string)
parameter | explanation |
---|---|
mediaFile | The absolute path of the local movie |
pos | Set 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
)
parameter | explanation |
---|---|
displayId | Shared screen id |
excludeWindow | The id of the window that is not shared, only one window can not be shared |
framerate | frameRate |
bitrate | bitRate |
isCaptureCursor | Whether to capture the mouse |
startScreenCaptureByWindowId
Share the screen via window information.
startScreenCaptureByWindowId(
windowId: number,
excludeWindow = 0,
framerate = 5,
bitrate = 1200,
isCaptureCursor = false
)
parameter | explanation |
---|---|
displayId | Shared window Id |
excludeWindow | The id of the window that is not shared, only one window can not be shared |
framerate | frameRate |
bitrate | bitRate |
isCaptureCursor | Whether 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
Parameters | Description |
---|---|
enabled | Whether to enable AI noise reduction mode: true:(Default) Enabled. false: Shut down. |
return
- 0: Success
- Not 0:Failure.