RtcEngine class
RtcEngine is the main class of the Meta SDK.
- Mixed-in types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addInjectStreamUrl(
String url, LiveInjectStreamConfig config) → Future< void> -
Injects an online media stream to a live broadcast.
override
-
addPublishStreamUrl(
String url, bool transcodingEnabled) → Future< void> -
Publishes the local stream to the CDN.
override
-
addVideoWatermark(
String watermarkUrl, WatermarkOptions options) → Future< void> -
Adds a watermark image to the local video.
override
-
adjustAudioMixingPlayoutVolume(
int volume) → Future< void> -
Adjusts the volume of audio mixing for local playback.
override
-
adjustAudioMixingPublishVolume(
int volume) → Future< void> -
Adjusts the volume of audio mixing for publishing (sending to other users).
override
-
adjustAudioMixingVolume(
int volume) → Future< void> -
Adjusts the volume of audio mixing.
override
-
adjustPlaybackSignalVolume(
int volume) → Future< void> -
Adjusts the playback volume of all remote users.
override
-
adjustRecordingSignalVolume(
int volume) → Future< void> -
Adjusts the recording volume.
override
-
adjustUserPlaybackSignalVolume(
int uid, int volume) → Future< void> -
Adjusts the playback volume of a specified remote user.
override
-
clearVideoWatermarks(
) → Future< void> -
Removes the watermark image from the video stream added by RtcEngine.addVideoWatermark.
override
-
complain(
String callId, String description) → Future< void> -
Allows a user to complain about the call quality after a call ends.
override
-
createDataStream(
bool reliable, bool ordered) → Future< int?> -
Creates a data stream.
override
-
destroy(
) → Future< void> -
Destroys the RtcEngine instance and releases all resources used by the Meta SDK.
override
-
disableAudio(
) → Future< void> -
Disables the audio module.
override
-
disableLastmileTest(
) → Future< void> -
Disables the network connection quality test.
override
-
disableVideo(
) → Future< void> -
Disables the video module.
override
-
enableAudio(
) → Future< void> -
Enables the audio module.
override
-
enableAudioVolumeIndication(
int interval, int smooth, bool report_vad) → Future< void> -
Enables the RtcEngineEventHandler.audioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume.
override
-
enableDualStreamMode(
bool enabled) → Future< void> -
Enables/Disables the dual video stream mode.
override
-
enableEncryption(
bool enabled, EncryptionConfig config) → Future< void> -
Enables/Disables the built-in encryption.
override
-
enableFaceDetection(
bool enable) → Future< void> -
Enables/Disables face detection for the local user.
override
-
enableInEarMonitoring(
bool enabled) → Future< void> -
Enables in-ear monitoring.
override
-
enableLastmileTest(
) → Future< void> -
Enables the network connection quality test.
override
-
enableLocalAudio(
bool enabled) → Future< void> -
Enables/Disables the local audio capture.
override
-
enableLocalVideo(
bool enabled) → Future< void> -
Disables/Re-enables the local video capture.
override
-
enableSoundPositionIndication(
bool enabled) → Future< void> -
Enables/Disables stereo panning for remote users.
override
-
enableVideo(
) → Future< void> -
Enables the video module.
override
-
enableWebSdkInteroperability(
bool enabled) → Future< void> -
Enables interoperability with the Meta Web SDK (LiveBroadcasting only).
override
-
getAudioMixingCurrentPosition(
) → Future< int?> -
Gets the playback position (ms) of the music file.
override
-
getAudioMixingDuration(
) → Future< int?> -
Gets the duration (ms) of the music file.
override
-
getAudioMixingPlayoutVolume(
) → Future< int?> -
Gets the audio mixing volume for local playback.
override
-
getAudioMixingPublishVolume(
) → Future< int?> -
Gets the audio mixing volume for publishing.
override
-
getCallId(
) → Future< String?> -
Gets the current call ID.
override
-
getCameraMaxZoomFactor(
) → Future< double?> -
Gets the maximum zoom ratio supported by the camera.
override
-
getConnectionState(
) → Future< ConnectionStateType> -
Gets the connection state of the SDK.
override
-
getEffectsVolume(
) → Future< double?> -
Gets the volume of the audio effects.
override
-
getUserInfoByUid(
int uid) → Future< UserInfo> -
Gets the user information by passing in the user ID.
override
-
getUserInfoByUserAccount(
String userAccount) → Future< UserInfo> -
Gets the user information by passing in the user account.
override
-
isCameraAutoFocusFaceModeSupported(
) → Future< bool?> -
Checks whether the camera auto-face focus function is supported.
override
-
isCameraExposurePositionSupported(
) → Future< bool?> -
Checks whether the camera exposure function is supported.
override
-
isCameraFocusSupported(
) → Future< bool?> -
Checks whether the camera manual focus function is supported.
override
-
isCameraTorchSupported(
) → Future< bool?> -
Checks whether the camera flash function is supported.
override
-
isCameraZoomSupported(
) → Future< bool?> -
Checks whether the camera zoom function is supported.
override
-
isSpeakerphoneEnabled(
) → Future< bool?> -
Checks whether the speakerphone is enabled.
override
-
joinChannel(
String token, String channelName, String optionalInfo, int optionalUid) → Future< void> -
Allows a user to join a channel.
override
-
joinChannelWithUserAccount(
String token, String channelName, String userAccount) → Future< void> -
Joins the channel with a user account.
override
-
leaveChannel(
) → Future< void> -
Allows a user to leave a channel.
override
-
muteAllRemoteAudioStreams(
bool muted) → Future< void> -
Stops/Resumes receiving all remote audio streams.
override
-
muteAllRemoteVideoStreams(
bool muted) → Future< void> -
Stops/Resumes receiving all remote video streams.
override
-
muteLocalAudioStream(
bool muted) → Future< void> -
Stops/Resumes sending the local audio stream.
override
-
muteLocalVideoStream(
bool muted) → Future< void> -
Stops/Resumes sending the local video stream.
override
-
muteRemoteAudioStream(
int uid, bool muted) → Future< void> -
Stops/Resumes receiving a specified audio stream.
override
-
muteRemoteVideoStream(
int uid, bool muted) → Future< void> -
Stops/Resumes receiving a specified remote user's video stream.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pauseAllEffects(
) → Future< void> -
Pauses all audio effects.
override
-
pauseAudioMixing(
) → Future< void> -
Pauses playing and mixing the music file.
override
-
pauseEffect(
int soundId) → Future< void> -
Pauses a specified audio effect.
override
-
playEffect(
int soundId, String filePath, int loopCount, double pitch, double pan, double gain, bool publish) → Future< void> -
Plays a specified local or online audio effect file.
override
-
preloadEffect(
int soundId, String filePath) → Future< void> -
Preloads a specified audio effect file into the memory.
override
-
rate(
String callId, int rating, {String? description}) → Future< void> -
Allows the user to rate a call after the call ends.
override
-
registerLocalUserAccount(
String appId, String userAccount) → Future< void> -
Registers a user account.
override
-
registerMediaMetadataObserver(
) → Future< void> -
Registers the metadata observer.
override
-
removeInjectStreamUrl(
String url) → Future< void> -
Removes the injected online media stream from a live broadcast.
override
-
removePublishStreamUrl(
String url) → Future< void> -
Removes an RTMP stream from the CDN.
override
-
renewToken(
String token) → Future< void> -
Renews the token when the current token expires.
override
-
resumeAllEffects(
) → Future< void> -
Resumes playing all audio effects.
override
-
resumeAudioMixing(
) → Future< void> -
Resumes playing and mixing the music file.
override
-
resumeEffect(
int soundId) → Future< void> -
Resumes playing a specified audio effect.
override
-
sendCustomReportMessage(
String id, String category, String event, String label, int value) → Future< void> -
This function is in the beta stage with a free trial. The ability provided in its beta test version is reporting a maximum of 10 message pieces within 6 seconds, with each message piece not exceeding 256 bytes and each string not exceeding 100 bytes. To try out this function, contact support@wuji.co and discuss the format of customized messages with us.
override
-
sendMetadata(
String metadata) → Future< void> -
Sends the metadata.
override
-
sendStreamMessage(
int streamId, String message) → Future< void> -
Sends data stream messages.
override
-
setAudioMixingPitch(
int pitch) → Future< void> -
Sets the pitch of the local music file.
override
-
setAudioMixingPosition(
int pos) → Future< void> -
Sets the playback position (ms) of the music file to a different starting position (the default plays from the beginning).
override
-
setAudioProfile(
AudioProfile profile, AudioScenario scenario) → Future< void> -
Sets the audio parameters and application scenarios.
override
-
setAudioSessionOperationRestriction(
AudioSessionOperationRestriction restriction) → Future< void> -
The SDK and the app can both configure the audio session by default. The app may occasionally use other apps or third-party components to manipulate the audio session and restrict the SDK from doing so. This method allows the app to restrict the SDK’s manipulation of the audio session.
override
-
setBeautyEffectOptions(
bool enabled, BeautyOptions options) → Future< void> -
Enables/Disables image enhancement and sets the options.
override
-
setCameraAutoFocusFaceModeEnabled(
bool enabled) → Future< void> -
Enables the camera auto-face focus function.
override
-
setCameraCapturerConfiguration(
CameraCapturerConfiguration config) → Future< void> -
Sets the camera capturer configuration.
override
-
setCameraExposurePosition(
double positionXinView, double positionYinView) → Future< void> -
Sets the camera exposure position.
override
-
setCameraFocusPositionInPreview(
double positionX, double positionY) → Future< void> -
Sets the camera manual focus position.
A successful method call triggers the RtcEngineEventHandler.cameraFocusAreaChanged callback on the local client.
override
-
setCameraTorchOn(
bool isOn) → Future< void> -
Enables the camera flash function.
override
-
setCameraZoomFactor(
double factor) → Future< void> -
Sets the camera zoom ratio.
override
-
setChannelProfile(
ChannelProfile profile) → Future< void> -
Sets the channel profile of the Meta RtcEngine.
override
-
setClientRole(
ClientRole role) → Future< void> -
Sets the role of a user (ChannelProfile.LiveBroadcasting only).
override
-
setDefaultAudioRoutetoSpeakerphone(
bool defaultToSpeaker) → Future< void> -
Sets the default audio playback route.
override
-
setDefaultMuteAllRemoteAudioStreams(
bool muted) → Future< void> -
Sets whether to receive all remote audio streams by default.
override
-
setDefaultMuteAllRemoteVideoStreams(
bool muted) → Future< void> -
Sets whether to receive all remote video streams by default.
override
-
setEffectsVolume(
double volume) → Future< void> -
Sets the volume of the audio effects.
override
-
setEnableSpeakerphone(
bool enabled) → Future< void> -
Enables/Disables the audio playback route to the speakerphone.
override
-
setEncryptionMode(
EncryptionMode encryptionMode) → Future< void> -
Sets the built-in encryption mode.
override
-
setEncryptionSecret(
String secret) → Future< void> -
Enables built-in encryption with an encryption password before joining a channel.
override
-
setEventHandler(
RtcEngineEventHandler handler) → void - Sets the engine event handler.
-
setInEarMonitoringVolume(
int volume) → Future< void> -
Sets the volume of the in-ear monitor.
override
-
setLiveTranscoding(
LiveTranscoding transcoding) → Future< void> -
Sets the video layout and audio settings for CDN live.
override
-
setLocalPublishFallbackOption(
StreamFallbackOptions option) → Future< void> -
Sets the fallback option for the locally published video stream based on the network conditions.
override
-
setLocalVoiceChanger(
AudioVoiceChanger voiceChanger) → Future< void> -
Sets the local voice changer option.
override
-
setLocalVoiceEqualization(
AudioEqualizationBandFrequency bandFrequency, int bandGain) → Future< void> -
Sets the local voice equalization effect.
override
-
setLocalVoicePitch(
double pitch) → Future< void> -
Changes the voice pitch of the local speaker.
override
-
setLocalVoiceReverb(
AudioReverbType reverbKey, int value) → Future< void> -
Sets the local voice reverberation.
override
-
setLocalVoiceReverbPreset(
AudioReverbPreset preset) → Future< void> -
Sets the preset local voice reverberation effect
override
-
setLogFile(
String filePath) → Future< void> -
Specifies an SDK output log file.
override
-
setLogFileSize(
int fileSizeInKBytes) → Future< void> -
Sets the log file size (KB).
override
-
setLogFilter(
LogFilter filter) → Future< void> -
Sets the output log level of the SDK.
override
-
setMaxMetadataSize(
int size) → Future< void> -
Sets the maximum size of the metadata.
override
-
setParameters(
String parameters) → Future< void> - @nodoc Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
-
setRemoteDefaultVideoStreamType(
VideoStreamType streamType) → Future< void> -
Sets the default video-stream type of the remotely subscribed video stream when the remote user sends dual streams.
override
-
setRemoteSubscribeFallbackOption(
StreamFallbackOptions option) → Future< void> -
Sets the fallback option for the remotely subscribed video stream based on the network conditions.
override
-
setRemoteUserPriority(
int uid, UserPriority userPriority) → Future< void> -
Sets the priority of a remote user's media stream.
override
-
setRemoteVideoStreamType(
int uid, VideoStreamType streamType) → Future< void> -
Sets the stream type of the remote video.
override
-
setRemoteVoicePosition(
int uid, double pan, double gain) → Future< void> -
Sets the sound position of a remote user.
When the local user calls this method to set the sound position of a remote user, the sound difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a real sense of space. This method applies to massively multiplayer online games, such as Battle Royale games.
override
-
setVideoEncoderConfiguration(
VideoEncoderConfiguration config) → Future< void> -
Sets the video encoder configuration.
override
-
setVolumeOfEffect(
int soundId, double volume) → Future< void> -
Sets the volume of a specified audio effect.
override
-
startAudioMixing(
String filePath, bool loopback, bool replace, int cycle) → Future< void> -
Starts playing and mixing the music file.
override
-
startAudioRecording(
String filePath, AudioSampleRateType sampleRate, AudioRecordingQuality quality) → Future< void> -
Starts an audio recording on the client.
override
-
startChannelMediaRelay(
ChannelMediaRelayConfiguration channelMediaRelayConfiguration) → Future< void> -
Starts to relay media streams across channels.
override
-
startEchoTest(
int intervalInSeconds) → Future< void> -
Starts an audio call test.
override
-
startLastmileProbeTest(
LastmileProbeConfig config) → Future< void> -
Starts the last-mile network probe test before joining a channel to get the uplink and downlink last-mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT).
override
-
startMediaRecord(
MediaRecordConfig mediaRecordConfig) → Future< void> -
开始录制
Note
仅用于zfz
override
-
startPreview(
) → Future< void> -
Starts the local video preview before joining a channel.
override
-
stopAllEffects(
) → Future< void> -
Stops playing all audio effects.
override
-
stopAudioMixing(
) → Future< void> -
Stops playing or mixing the music file.
override
-
stopAudioRecording(
) → Future< void> -
Stops the audio recording on the client.
override
-
stopChannelMediaRelay(
) → Future< void> -
Stops the media stream relay.
override
-
stopEchoTest(
) → Future< void> -
Stops the audio call test.
override
-
stopEffect(
int soundId) → Future< void> -
Stops playing a specified audio effect.
override
-
stopLastmileProbeTest(
) → Future< void> -
Stops the last-mile network probe test.
override
-
stopMediaRecord(
) → Future< void> -
结束录制
Note
仅用于zfz
override
-
stopPreview(
) → Future< void> -
Stops the local video preview and the video.
override
-
switchCamera(
) → Future< void> -
Switches between front and rear cameras.
override
-
switchChannel(
String token, String channelName) → Future< void> -
Switches to a different channel.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
unloadEffect(
int soundId) → Future< void> -
Releases a specified preloaded audio effect from the memory.
override
-
unregisterMediaMetadataObserver(
) → Future< void> -
Unregisters the metadata observer.
override
-
updateChannelMediaRelay(
ChannelMediaRelayConfiguration channelMediaRelayConfiguration) → Future< void> -
Updates the channels for media relay.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited