Adjusts the volume of a music file.
The method is used to adjust the volume of mixing audio for local playback. You can call the method when you are in a room.
The volume of the mixing audio that is published. Valid values: 0 to 100. The default value of 100 indicates the original volume.
Sets the resolution.
The media stream type.
Clears the recorded audio and video.
The object parameters.
The recording ID. You can get the ID by calling the listMediaRecording method.
Turns off an audio and video input device, such as a microphone, camera, and screen sharing, and stops publishing the audio and video stream.
The options used to set the object
Media stream type, namely audio, video or screen.
Destroy the audio and video stream object.
Downloads recorded audio and video.
The object parameters.
The recording ID. You can get the ID by calling the listMediaRecording method.
Gets the current volume of the audio captured by the microphone.
Gets current playback position of the music file.
The method gets the playback position of the mixing audio file. Unit: milliseconds. You can call the method when you are in a room.
The playback position of the music file.
Gets the duration of a music file.
The method is used to get the duration of the mixing audio file. Unit: milliseconds You can call the method when you are in a room.
The duration of the music file. Unit: milliseconds.
Gets an audio stream MediaStream object, which can be used to customize audio rendering.
You can render this object using a custom renderer. For example, you can set the srcObject attribute of the audio dom node to this object.
Gets the audio stream.
Gets the volume of the audio all sound effect files.
Possible error codes: -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used.
Gets the ID of the audio and video stream.
Gets the video stream.
Gets the audio flag.
This method is used to confirm whether the current audio and video stream object (Stream) contains audio resources.
Gets the screen sharing flag.
This method is used to confirm whether the current audio and video stream object (Stream) contains screen sharing resources.
Gets the video flag.
This method is used to confirm whether the current audio and video stream object (Stream) contains video resources.
Initializes the audio and video stream object.
This method is used to initialize the audio and video stream objects created on the local client.
Returns the status of the audio and video stream playback.
The media stream type.
Enumerates recorded audio and video.
Recorded audio and video information.
id
: The recoding ID.type
: The recording type.name
: The name of the recording file.status
: The recording status.isRecording
: indicates whether the recording is running.startTime
: The start time when the recording starts.endTime
: The end time when the recording ends.Disables the audio stream.
Disables the screen sharing stream.
If you call this method to stop publishing the screen sharing stream, the remote client will trigger the Client.on("mute-screen") callback.
Disables the video stream.
Access to the device is denied.
When you obtain microphone or camera permissions, the specified device cannot be found.
An unknown error occurs when you obtain permissions to access the microphone or camera.
When you gain the permissions to access the microphone or camera, the device is occupied.
Turns on an audio and video input device, such as a microphone, camera, and screen sharing, and publishes the audio and video stream.
The options used to set the object.
The ID of the device that you want to turn on.
You can get the list of devices by calling getDevices.
Specifies whether to share the background sound played locally during screen sharing.
The method is only valid when the audio is not turned on and the type is screen. For more information, see StreamOptions.screenAudio.
You can get the data source ID of the Electron screen sharing.
Media stream type, namely audio, video or screen.
Pauses all audio effects.
Possible error codes: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"SOUND_NOT_EXISTS": The sound effect file specified by soundId does not exist. -"INVALID_OPERATION": Invalid operation you can use log records in the console to view the reason. In most cases, a status error occurs. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.pauseEffect:soundId": The format of the soundId parameter is invalid
Pauses playing a music file.
Pauses a specified audio effect.
The ID of the specified sound effect file. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
Possible error codes: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"SOUND_NOT_EXISTS": The sound effect file specified by soundId does not exist. -"INVALID_OPERATION": Invalid operation you can use log records in the console to view the reason. In most cases, a status error occurs. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.pauseEffect:soundId": The format of the soundId parameter is invalid.
Plays the audio and video stream.
div tag. The dom container node of the playback.
The audio and video options for playback.
Specifies whether to play the audio stream.
By default, the local audio stream is played and the remote audio stream is not played.
Specifies whether to play the video stream.
By default, play the video stream.
Specifies whether to play the video stream.
By default, play the video stream.
Plays a specified local or online audio effect file. -The supported audio file types include MP3, AAC, and other audio formats supported by the browser. Only online URLs are supported.
The number of loops effect files are played back. The parameter is optional. The default value is 1, which indicates the sound effect file is played back for one time.
The parameter is required. The URL address of the online effect file.
Supported audio file types include MP3, AAC, and other audio formats supported by browsers.
The ID of the sound effect file. The parameter is required. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
If you have loaded the sound effect into the memory by using preloadEffect, make sure that the soundID of the playEffect method is the same as the soundID set by preloadEffect.
Possible error codes:
Plays back the video recording.
The object parameters.
The recording ID. You can get the ID by calling the listMediaRecording method.
DOM nodes of audio or video to be rendered, such as div and span.
Presets a specified sound effect file.
This method caches sound effect files for quick playback. To ensure smooth communication, pay attention to control the size of the pre-loaded audio file.
The ID of the specified sound effect file. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
The parameter is required. The absolute path of the online sound effect file. MP3, AAC, and other audio formats are supported by the browser.
Error codes that may be returned: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.preloadEffect:filePath": The parameter format is invalid. -"Stream.preloadEffect:soundId": The parameter format is invalid.
Resumes playing all audio effect files.
Resumes playing a music file.
You can call the method when you join a room.
Resumes playing a specified audio effect.
The ID of the specified sound effect file. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
Possible error codes: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.resumeEffect :soundId": The format of the soundId parameter is invalid
Sets the playback position of the music file to a different starting position.
The method sets the playback position of the mixing audio file to a different starting position. The method allows you to play the mixing audio file from the position based on your requirements rather than from the beginning.
The playback position of the mixing audio file. Unit: milliseconds.
Sets the audio output device of the subscribed stream.
This method can set the audio output device of the subscribed stream in voice scenes, and switch the speaker during the call. You can call this method before or after the subscribed stream is played.
The ID of the device, which can be obtained by calling getDevices. The acquired ID contains ASCII characters, and the ID must be 1 to 265 bytes in length.
Sets the audio profile.
The audio profile type. Valid values:
Sets the audio playback volume.
The audio volume. Value range: 0 to 100. A value of 0 indicates that the audio is muted.
Adds a watermark to the video canvas.
The canvas watermarks settings. You can set text watermark, image watermark, and timestamp watermark. A value of null indicates removing the watermark.
Sets the volume of the audio captured by the microphone.
The volume of the audio captured by the microphone. Valid values: 0 to 100. A value of 0 indicates that the audio is muted.
Sets the playback volume of all sound effect files.
The volume of the sound effect file. The ID must be an integer. Valid values: 1 to 100. The default value of 100 indicates the original volume.
Error codes that may be returned: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"Stream.setEffectsVolume:volume": The volume parameter format is invalid. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used.
Sets a local canvas.
Call the method to set a local video canvas. The method applies to only local users. Remote users are not affected.
The options used to set the canvas.
The media stream type. You can specify the camera window or screen sharing window.
Sets a remote video stream canvas.
This method is used to associate remote users with display views. The method affects only video display viewed by local users. After a user leaves the room, the association between a remote user and the view is cleared.
The options used to set the canvas.
The media stream type. You can specify the camera window or screen sharing window.
Sets the screen profile for screen sharing.
This method sets the display properties of the screen during screen sharing and must be called before Stream.init.
The screen profile.
Sets Video stream subscription parameters.
The configuration parameters.
Specifies whether to subscribe to the audio stream.
Specifies whether to subscribe to low or high streams.
0: the low stream. 1: the high stream.
Specifies whether to subscribe to the screen sharing stream.
Specifies whether to subscribe to the video stream.
Sets the video profile.
The configuration parameters.
Adjusts the volume of a specified sound effect file.
The ID of the specified sound effect file. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
Possible error codes: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.setVolumeOfEffect:soundId": The parameter format is invalid. -"Stream.setVolumeOfEffect:volume": The parameter format is invalid.
Starts playing and mixing the music file.
This method is used to mix the specified online audio file with the audio stream captured from the microphones. The online audio file replaces the audio stream captured from the microphone.
The mixing audio settings.
The URL address of the online music file. The parameter is required.
Notification feedback when the playback of mixing audio is complete. The parameter is optional. If you stop the mixing audio or end the call, The callback to notify the reason for stopping mixing audio will not be triggered.
Specifies the number of loops the audio files are played back. The parameter is optional.
Specifies whether to play the audio file repeatedly. The default value is false.
Sets the time position at which the audio file starts to play. Unit: seconds. This parameter is optional. The default value is 0, which indicates that the playback starts from the beginning.
Specifies whether to replace the local audio stream with an audio file. The parameter is optional.
The playback volume of a music file. Valid values: 0 to 100. The parameter is optional. The default value is 100, which indicates that the original volume of the audio file is used.
Turns on single video recording.
parameter object.
If the previously recorded video has not been downloaded, whether to reset or not, the default is false.
The stream type, such as audio, video, and screen.
Stops audio and video stream.
This method is used to stop playing the audio and video stream played by Stream.play.
Stops playing all audio effects.
Error codes that may be returned: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.playEffect:soundId": The format of the soundId parameter is invalid
Stops playing a music file.
Stops playing all audio effects.
The ID of the specified sound effect file. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
Possible error codes: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.playEffect:soundId": The format of the soundId parameter is invalid.
Ends video recording.
The object parameters.
The recording ID. You can get the ID by calling the listMediaRecording method.
Switches media input devices.
This method is used to switch local streaming media input devices, such as microphones, and video output devices such as cameras.
The device type.
The ID of the device, which can be obtained by calling getDevices. The acquired ID contains ASCII characters, and the ID must be 1 to 265 bytes in length.
Captures the screenshots of the video stream from specified users.
The screenshot file is saved in the default path of the browser.
The type of the video stream from which the screenshot is captured.
The name of the screenshot. The default format is uid-1.
User ID.
Releases a specified sound effect file.
This method releases a pre-loaded sound effect file from the memory to save memory usage.
The ID of the specified sound effect file. Each sound effect file has a unique ID. The ID must be a positive integer. Valid values: 1 to 10000.
Error codes that may be returned: -"BROWSER_NOT_SUPPORT": The browser does not support the file format. -"SOUND_NOT_EXISTS": The sound effect file specified by soundId does not exist. -"INVALID_OPERATION": Invalid operation you can view the log records in the console. In most cases, a status error occurs. If the file is in the play or pause status, the operation is invalid. -"No MediaHelper": localStream is not initialized by init(). Therefore, the sound effect feature cannot be used. -"Stream.unloadEffect:soundId": The parameter format is invalid.
Enables the audio stream.
Enables the screen sharing stream.
If you have called muteScreen to disable screen sharing, you can call this method to enable the screen sharing stream. The remote client will trigger the Client.on("ummute-screen") callback.
Enables the audio stream.
By default, the video stream is enabled. If you have called muteVideo to disable the video stream, you can call this method to enable the video stream.
After you enable the video stream on the local client, the remote client will trigger the Client.on("unmute-video") callback.
The audio and video stream object.
The methods provided by the Stream interface are used to define the behavior of audio and video stream objects, such as stream playback control, audio and video encoding configuration.
You can use NERTC.createStream to create audio and video stream objects. A Stream object refers to the local audio and video stream published during a call or the remote audio and video stream subscribed.