Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RtcEngine

RtcEngine is the javascript object for control agora native sdk through react native bridge.

You can use the RtcEngine methods to create init

Other methods of the RtcEngine object serve for agora native sdk and set up error logging.

Hierarchy

  • RtcEngine

Index

Properties

Methods

Properties

Static Private eventTypes

eventTypes: Set<string> = new Set<string>()

Methods

Static addInjectStreamUrl

  • addInjectStreamUrl(options: InjectStreamOption): Promise<any>
  • add inject stream url

    This method injects an online media stream to a live broadcast.

    Parameters

    • options: InjectStreamOption

    Returns Promise<any>

    Promise<{success, value}>

Static addPublishStreamUrl

  • addPublishStreamUrl(options: PublishStreamOption): Promise<any>
  • add publish stream url

    This method add publish stream by option.

    Parameters

    • options: PublishStreamOption

    Returns Promise<any>

    Promise<{success, value}>

Static addVideoWatermark

  • addVideoWatermark(options: ImageOption): Promise<any>
  • add video watermark

    This method adds video watermark to the local video.

    Parameters

    • options: ImageOption

    Returns Promise<any>

    Promise<{success, value}>

Static adjustAudioMixingPlayoutVolume

  • adjustAudioMixingPlayoutVolume(volume: number): void
  • adjust audio mixing playout volume

    This method adjusts audio mixing playout by the volume parameter

    Parameters

    • volume: number

    Returns void

Static adjustAudioMixingPublishVolume

  • adjustAudioMixingPublishVolume(volume: number): void
  • adjust audio mixing publish volume

    This method adjusts audio mixing publish by the volume paraemter

    Parameters

    • volume: number

    Returns void

Static adjustAudioMixingVolume

  • adjustAudioMixingVolume(volume: number): void
  • adjust audio mixing volume

    This method adjusts audio mixing volume by the volume number parameter

    Parameters

    • volume: number

    Returns void

Static adjustPlaybackSignalVolume

  • adjustPlaybackSignalVolume(volume: number): void
  • adjust playback signal volume

    This method adjusts playback signal by volume.

    Parameters

    • volume: number

    Returns void

Static adjustRecordingSignalVolume

  • adjustRecordingSignalVolume(volume: number): void
  • adjust recording signal volume

    This method adjusts recording your signal by volume.

    Parameters

    • volume: number

    Returns void

Static createDataStream

  • createDataStream(options: DataStreamOption): any
  • create data stream

    This method creates data stream with options

    Parameters

    • options: DataStreamOption

    Returns any

Static destroy

  • destroy(): Promise<any>
  • destroy

    This method stops event subscribe and destroy the RtcEngine instance's. You should call it, when you want to destroy the engine.

    Returns Promise<any>

    Promise<{success, value}>

Static disableAudio

  • disableAudio(): void

Static disableLastmileTest

  • disableLastmileTest(): Promise<any>
  • disable lastmile test

    This method disable the network connection qualit test.

    Returns Promise<any>

    Promise<{success, value}>

Static disableLocalAudio

  • disableLocalAudio(muted: boolean): void
  • mute local audio stream

    This method mutes the local audio stream by muted.

    Parameters

    • muted: boolean

    Returns void

Static disableVideo

  • disableVideo(): void

Static enableAudio

  • enableAudio(): void

Static enableAudioVolumeIndication

  • enableAudioVolumeIndication(interval: number, smooth: number): void
  • enable audio volume indication

    This method enables audio volume by interval and smooth

    Parameters

    • interval: number
    • smooth: number

    Returns void

Static enableDualStreamMode

  • enableDualStreamMode(enabled: boolean): Promise<any>
  • enable dual stream mode

    This method enables the dual stream by parameter mode.

    Parameters

    • enabled: boolean

    Returns Promise<any>

    Promise<{success, value}>

Static enableInEarMonitoring

  • enableInEarMonitoring(enabled: boolean): void
  • enable in-ear monitor

    This method enables in-ear monitoring by boolean parameter enabled

    Parameters

    • enabled: boolean

    Returns void

Static enableLastmileTest

  • enableLastmileTest(): Promise<any>
  • enable lastmile test

    This method enables the network connection qualit test.

    Returns Promise<any>

    Promise<{success, value}>

Static enableLocalAudio

  • enableLocalAudio(enabled: boolean): void
  • enable local audio

    This method enables local audio by the boolean parameter.

    Parameters

    • enabled: boolean

    Returns void

Static enableLocalVideo

  • enableLocalVideo(enabled: boolean): void
  • enable local video

    This method enables the local video by the boolean parameter.

    Parameters

    • enabled: boolean

    Returns void

Static enableVideo

  • enableVideo(): void

Static enableWebSdkInteroperability

  • enableWebSdkInteroperability(enabled: boolean): Promise<any>
  • enable websdk interoperability

    This method used to enable websdk interoperability, so that it can connect with agora websdk apps.

    Parameters

    • enabled: boolean

    Returns Promise<any>

    Promise<{success, value}>

Static getAudioMixingCurrentPosition

  • getAudioMixingCurrentPosition(): Promise<any>
  • get audio mixing current position

    This method gets audio mixing current position value.

    Returns Promise<any>

    Promise<{success, value}>

Static getAudioMixingDuration

  • getAudioMixingDuration(): Promise<any>
  • get audio mixing duration

    This method gets the audio mixing duration

    Returns Promise<any>

    Promise<{success, value}>

Static getCallId

  • getCallId(): Promise<any>
  • get call id

    This method is used to get call id.

    Returns Promise<any>

    Promise<{success, value}>

Static getCameraMaxZoomFactor

  • getCameraMaxZoomFactor(): Promise<any>
  • get camera max zoom ratio

    This method gets the camera maximum zoom ratio.

    notice

    Android Only

    Returns Promise<any>

    Promise<{success, value}>

Static getConnectionState

  • getConnectionState(): any
  • get agora native sdk connection state

    This method gets agora native sdk connection state

    Returns any

    Promise<{success: true, state: (connection state)}>

Static getEffectsVolume

  • getEffectsVolume(): Promise<any>
  • get effects of volume

    This methods get audio mixing effects volume value.

    Returns Promise<any>

    Promise<{success, value}>

Static getSdkVersion

  • getSdkVersion(callback: Callback<any>, errorHandler?: Callback<any>): any
  • get sdk version

    This method gets the sdk version details and passed it into callback function

    Parameters

    • callback: Callback<any>

      to handle resolve from getSdkVersion

    • Optional errorHandler: Callback<any>

      to handle reject error from getSdkVersion

    Returns any

Static init

  • init(options: Option): void
  • Creates a RtcEngine Object internal.

    This method creates and start event observer. You should call this method once.

    example

    RtcEngine.init(option)

    Parameters

    • options: Option

      Defines the property of the client, see {@link Option} for details.

    Returns void

Static isCameraAutoFocusFaceModeSupported

  • isCameraAutoFocusFaceModeSupported(): Promise<any>
  • is camera auto focus face mode supported

    This method checks whether the camera mannual auto-face focus function is supported.

    Returns Promise<any>

    Promise<{success, value}>

Static isCameraExposurePositionSupported

  • isCameraExposurePositionSupported(): Promise<any>
  • is camera exposure position supported

    This method checks whether the camera mannual exposure function is supported.

    Returns Promise<any>

    Promise<{success, value}>

Static isCameraFocusSupported

  • isCameraFocusSupported(): Promise<any>
  • is camera focus supported

    This method checks whether the camera mannual focus function is supported.

    Returns Promise<any>

    Promise<{success, value}>

Static isCameraTorchSupported

  • isCameraTorchSupported(): Promise<any>
  • is camera torch supported

    This method checks whether the camera flash function is supported.

    Returns Promise<any>

    Promise<{success, value}>

Static isCameraZoomSupported

  • isCameraZoomSupported(): Promise<any>
  • is camera zoom supported

    This method checks whether the camera zoom function is supported.

    Returns Promise<any>

    Promise<{success, value}>

Static joinChannel

  • joinChannel(channelName: string, uid?: undefined | number, token?: undefined | string, info?: Object): void
  • join specified channel

    This method joins and begin rendering the video stream. when join succeeds. Otherwise, it will invoke error by the event

    Parameters

    • channelName: string
    • Optional uid: undefined | number
    • Optional token: undefined | string
    • Optional info: Object

    Returns void

Static leaveChannel

  • leaveChannel(): Promise<any>
  • leave channel

    This method leaves the joined channel, then your video view will not render ever. You should call it, when you dont need render video stream.

    Returns Promise<any>

    Promise<{success, value}>

Static methodisSpeakerphoneEnabled

  • methodisSpeakerphoneEnabled(callback: Callback<any>): void
  • check for mobile phone speaker enabled

    This method checks the phone speaker is enabled

    Parameters

    • callback: Callback<any>

    Returns void

Static muteAllRemoteAudioStreams

  • muteAllRemoteAudioStreams(muted: boolean): void
  • mute all remote audio streams

    This method mutes all remote audio streams by muted

    Parameters

    • muted: boolean

    Returns void

Static muteAllRemoteVideoStreams

  • muteAllRemoteVideoStreams(muted: boolean): void
  • mute all remote video streams

    This method mutes all remote streams by the boolean parameter.

    Parameters

    • muted: boolean

    Returns void

Static muteLocalAudioStream

  • muteLocalAudioStream(enabled: boolean): void
  • mute local audio stream

    This method sends/stops sending the local audio.

    Parameters

    • enabled: boolean

    Returns void

Static muteLocalVideoStream

  • muteLocalVideoStream(muted: boolean): void
  • mute local video stream

    This method mutes video stream by the boolean parameter.

    Parameters

    • muted: boolean

    Returns void

Static muteRemoteAudioStream

  • muteRemoteAudioStream(uid: number, muted: boolean): void
  • mute specified remote audio stream by muted

    This method mutes specified remote audio stream by number uid and boolean muted.

    Parameters

    • uid: number
    • muted: boolean

    Returns void

Static muteRemoteVideoStream

  • muteRemoteVideoStream(uid: number, muted: boolean): void
  • mute specified remote video stream.

    This method mutes remote video stream by the number of uid and boolean parameter.

    Parameters

    • uid: number
    • muted: boolean

    Returns void

Static off

  • off(eventType: string): void
  • remove event listeners

    This method unsubscribes specified eventType related all listeners. You should call this method when you want to unsubscribe some eventType.

    Parameters

    • eventType: string

    Returns void

Static on

  • on(eventType: string, listener: function): void
  • add event listener

    This method subscribes specified eventType and run listener. You should call this method at first.

    Parameters

    • eventType: string
    • listener: function
        • (...args: any[]): any
        • Parameters

          • Rest ...args: any[]

          Returns any

    Returns void

Static pauseAllEffects

  • pauseAllEffects(): Promise<any>
  • pause all effects for audio mixing

    This method pause all effects for audio mixing.

    Returns Promise<any>

    Promise<{success, value}>

Static pauseAudioMixing

  • pauseAudioMixing(): void

Static pauseEffect

  • pauseEffect(soundId: number): Promise<any>
  • pause the specified effect for audio mixing by soundid

    This method pauses the specified effect for audio mixing by soundid.

    Parameters

    • soundId: number

    Returns Promise<any>

    Promise<{success, value}>

Static playEffect

  • playEffect(options: PlayEffectOption): Promise<any>
  • play specified effect for audio mixing

    This methos plays the specified effect of audio mixing file by option config.

    Parameters

    • options: PlayEffectOption

    Returns Promise<any>

    Promise<{success, value}>

Static preloadEffect

  • preloadEffect(soundId: number, filepath: string): Promise<any>
  • preload effect for audio mixing file.

    This methods preloads the specified audio mixing file to memory by the soundid

    Parameters

    • soundId: number
    • filepath: string

    Returns Promise<any>

    Promise<{success, value}>

Static removclearVideoWatermarkse

  • removclearVideoWatermarkse(): Promise<any>
  • clear video watermarks

    This method removes the watermark image from the video stream added by addVideoWatermark.

    Returns Promise<any>

    Promise<{success, value}>

Static removeAllListeners

  • removeAllListeners(): void
  • remove all events listeners

    This method unsubscribes all eventTypes related listeners.

    Returns void

Static removeInjectStreamUrl

  • removeInjectStreamUrl(options: RemoveInjectStreamOption): Promise<any>
  • remove inject stream url

    This method removes stream by addInjectsStreamUrl.

    Parameters

    • options: RemoveInjectStreamOption

    Returns Promise<any>

    Promise<{success, value}>

Static removePublishStreamUrl

  • removePublishStreamUrl(options: RemovePublishStreamOption): Promise<any>
  • remove publish stream url

    This method remove publish stream by options.

    Parameters

    • options: RemovePublishStreamOption

    Returns Promise<any>

    Promise<{success, value}>

Static renewToken

  • renewToken(token: string): any
  • renew token

    This method renews a new token.

    Parameters

    • token: string

    Returns any

Static resumeAllEffects

  • resumeAllEffects(): Promise<any>
  • resume all audio mixing effects.

    This method resumes all audio mixing effects.

    Returns Promise<any>

    Promise<{success, value}>

Static resumeAudioMixing

  • resumeAudioMixing(): void

Static resumeEffect

  • resumeEffect(soundId: number): Promise<any>
  • resume audio mixing effect by the specified soundid

    This method resumes audio mixing effect by the specified soundid

    Parameters

    • soundId: number

    Returns Promise<any>

    Promise<{success, value}>

Static sendStreamMessage

  • sendStreamMessage(uid: number, data: any): Promise<any>
  • send stream message

    This method sends stream message by specified uid

    Parameters

    • uid: number
    • data: any

    Returns Promise<any>

    Promise<{success, value}>

Static setAudioMixingPosition

  • setAudioMixingPosition(pos: number): Promise<any>
  • set audio mixing position

    This method sets audio mixing position by the parameter pos

    Parameters

    • pos: number

    Returns Promise<any>

Static setAudioSessionOperationRestriction

  • setAudioSessionOperationRestriction(): void
  • set audio session operation restriction

    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. You can call this method at any time to return the control of the audio sessions to the SDK. This method restricts the SDK’s manipulation of the audio session. Any operation to the audio session relies solely on the app, other apps, or third-party components.

    notice

    iOS support only

    Returns void

Static setCameraAutoFocusFaceModeEnabled

  • setCameraAutoFocusFaceModeEnabled(enabled: boolean): Promise<any>
  • set enable auto focus face mode

    This method enables auto-focus face mode function.

    Parameters

    • enabled: boolean

      boolean

    Returns Promise<any>

    Promise<{success, value}>

Static setCameraExposurePosition

  • setCameraExposurePosition(options: PositionOption): Promise<any>
  • set camera exposure position

    This method sets the mannual exposure position.

    Parameters

    • options: PositionOption

    Returns Promise<any>

    Promise<{success, value}>

Static setCameraFocusPositionInPreview

  • setCameraFocusPositionInPreview(options: PositionOption): Promise<any>
  • set camera focus position in preview

    This method sets the mannual focus position.

    Parameters

    • options: PositionOption

    Returns Promise<any>

    Promise<{success, value}>

Static setCameraTorchOn

  • setCameraTorchOn(enabled: boolean): Promise<any>
  • set camera torch on

    This method enables the camera flash function.

    Parameters

    • enabled: boolean

    Returns Promise<any>

    Promise<{success, value}>

Static setCameraZoomFactor

  • setCameraZoomFactor(zoomFactor: number): Promise<any>
  • set camera zoom ratio

    This method sets the camera zoom ratio.

    Parameters

    • zoomFactor: number

    Returns Promise<any>

    Promise<{success, value}>

Static setClientRole

  • setClientRole(role: number): void
  • change the client role

    This method changes the client of role.

    Parameters

    • role: number

      (audience: 0, host: 1)

    Returns void

Static setDefaultAudioRouteToSpeakerphone

  • setDefaultAudioRouteToSpeakerphone(enabled: boolean): void
  • set default audio speaker

    This method set the default audio speaker enable or disable by pass boolean parameter.

    Parameters

    • enabled: boolean

    Returns void

Static setDefaultMuteAllRemoteAudioStreams

  • setDefaultMuteAllRemoteAudioStreams(enabled: boolean): void
  • set default mute all remote audio streams

    This method set default mute all remote audio streams enable or not by pass boolean parameter.

    Parameters

    • enabled: boolean

    Returns void

Static setDefaultMuteAllRemoteVideoStreams

  • setDefaultMuteAllRemoteVideoStreams(muted: boolean): void
  • set default mute all remote video stream

    This method mutes all remote video stream default by the boolean parameter.

    Parameters

    • muted: boolean

    Returns void

Static setEffectsVolume

  • setEffectsVolume(volume: number): Promise<any>
  • set effects volume

    This methods set audio mixing effects volume by float parameter.

    Parameters

    • volume: number

    Returns Promise<any>

    Promise<{success, value}>

Static setEnableSpeakerphone

  • setEnableSpeakerphone(enabled: boolean): void
  • set enable speaker phone

    This method set the speaker phone enable or disable by pass boolean parameter.

    Parameters

    • enabled: boolean

    Returns void

Static setInEarMonitoringVolume

  • setInEarMonitoringVolume(volume: number): void
  • set in-ear monitoring volume

    This method sets the in-ear-monitoring volume by number parameter volume

    Parameters

    • volume: number

    Returns void

Static setLiveTranscoding

  • setLiveTranscoding(options: LiveTranscodingOption): Promise<any>
  • set live transcoding

    This method sets the video layout and audio settings for CDN live.

    Parameters

    • options: LiveTranscodingOption

    Returns Promise<any>

    Promise<{success, value}>

Static setLocalPublishFallbackOption

  • setLocalPublishFallbackOption(option: number): Promise<any>
  • set local publish fallback

    This method sets the fallback option for the locally published video stream based on the network conditions.

    Parameters

    Returns Promise<any>

    Promise<{success, value}>

Static setLocalRenderMode

  • setLocalRenderMode(mode: number): void
  • set local video render mode

    This method calls native sdk render mode for local video.

    Parameters

    • mode: number

    Returns void

Static setLocalVideoMirrorMode

  • setLocalVideoMirrorMode(mode: number): Promise<any>
  • set local video mirror mode

    This method sets local video mirror mode

    Parameters

    • mode: number

    Returns Promise<any>

    Promise<{success, value}>

Static setLocalVoiceEqualization

  • setLocalVoiceEqualization(band: number, gain: number): void
  • set local voice equalization

    This method set local video equalization of band frequency by enum band number and number of gain

    Parameters

    • band: number
    • gain: number

    Returns void

Static setLocalVoicePitch

  • setLocalVoicePitch(pitch: number): void
  • set local voice pitch

    This method sets the local voice pitch by float parameter pitch

    Parameters

    • pitch: number

    Returns void

Static setLocalVoiceReverb

  • setLocalVoiceReverb(reverb: number, value: number): void
  • set local voice reverb

    This method sets local voice by reverb and value

    Parameters

    • reverb: number
    • value: number

    Returns void

Static setLog

  • setLog(filepath: string, level: number): Promise<any>
  • set log file and log filter

    This method sets the log file generated path and specified the log level.

    Parameters

    • filepath: string
    • level: number

    Returns Promise<any>

    Promise<{success, value}>

Static setMixedAudioFrameParameters

  • setMixedAudioFrameParameters(options: MixedAudioFrameOption): Promise<any>
  • set mixed audio frame parameters

    This method Sets the audio frame format for the mixedAudioFrame callback.

    Parameters

    • options: MixedAudioFrameOption

    Returns Promise<any>

    Promise<{success, value}>

Static setPlaybackAudioFrameParameters

  • setPlaybackAudioFrameParameters(options: AudioFrameOption): Promise<any>
  • set playback audio frame parameters

    This method Sets the audio frame format for the playbackFrame callback.

    Parameters

    • options: AudioFrameOption

    Returns Promise<any>

    Promise<{success, value}>

Static setRecordingAudioFrameParameters

  • setRecordingAudioFrameParameters(options: AudioFrameOption): Promise<any>
  • set recording audio frame parameters

    This method Sets the audio recording format for the audioFrame callback.

    Parameters

    • options: AudioFrameOption

    Returns Promise<any>

    Promise<{success, value}>

Static setRemoteDefaultVideoStreamType

  • setRemoteDefaultVideoStreamType(options: DefaultVideoStreamOption): Promise<any>
  • set remote default video stream type

    This method sets the default video stream type.

    Parameters

    • options: DefaultVideoStreamOption

    Returns Promise<any>

    Promise<{success, value}>

Static setRemoteRenderMode

  • setRemoteRenderMode(uid: number, mode: number): void
  • set the specified remote video render mode

    This method calls native sdk render mode for the specified remote video.

    Parameters

    • uid: number
    • mode: number

    Returns void

Static setRemoteSubscribeFallbackOption

  • setRemoteSubscribeFallbackOption(option: number): Promise<any>
  • set remote publish fallback

    This method sets the fallback option for the remotely subscribed video stream based on the network conditions.

    Parameters

    Returns Promise<any>

    Promise<{success, value}>

Static setRemoteVideoStreamType

  • setRemoteVideoStreamType(options: VideoStreamOption): Promise<any>
  • set remote video stream type

    This method sets the remote video stream type by uid and streamType.

    Parameters

    • options: VideoStreamOption

    Returns Promise<any>

    Promise<{success, value}>

Static setVideoQualityParameters

  • setVideoQualityParameters(quality: boolean): Promise<any>
  • set video quality

    This method sets the preferences for the video quality. (Live broadcast only).

    Parameters

    • quality: boolean

      boolean

    Returns Promise<any>

    Promise<{success, value}>

Static setVolumeOfEffect

  • setVolumeOfEffect(volume: number): Promise<any>
  • set volume for playing effects.

    This methods set for playing audio mixing effects

    Parameters

    • volume: number

    Returns Promise<any>

    Promise<{success, value}>

Static setupLocalVideo

  • setupLocalVideo(options: VideoOption): void
  • show local video

    This method calls native sdk render canvas for local video.

    Parameters

    • options: VideoOption

    Returns void

Static setupRemoteVideo

  • setupRemoteVideo(options: VideoOption): void
  • show remote video

    This method calls native sdk render canvas for remote video.

    Parameters

    • options: VideoOption

    Returns void

Static startAudioMixing

  • startAudioMixing(options: AudioMixingOption): void
  • start audio mixing

    This method will start audio mixing by option config

    Parameters

    • options: AudioMixingOption

    Returns void

Static startAudioRecording

  • startAudioRecording(options: AudioRecordingOption): Promise<any>
  • start audio recording by quality

    This method start audio recording by quality config

    Parameters

    • options: AudioRecordingOption

    Returns Promise<any>

    Promise<{success, value}>

Static startEchoTest

  • startEchoTest(): Promise<any>
  • start echo test

    This method launches an audio call test to determine whether the audio devices (for example, headset and speaker) and the network connection are working properly.

    Returns Promise<any>

    Promise<{success, value}>

Static startPreview

  • startPreview(): void

Static stopAllEffects

  • stopAllEffects(): Promise<any>
  • stop play all for effect audio mixing.

    This methods stops all effect audio mixing.

    Returns Promise<any>

    Promise<{success, value}>

Static stopAudioMixing

  • stopAudioMixing(): void

Static stopAudioRecording

  • stopAudioRecording(): Promise<any>
  • stop audio recording

    This method stops audio recording.

    Returns Promise<any>

    Promise<{success, value}>

Static stopEchoTest

  • stopEchoTest(): Promise<any>
  • stop echo test

    This method stop launched an audio call test.

    Returns Promise<any>

    Promise<{success, value}>

Static stopEffect

  • stopEffect(soundId: number): Promise<any>
  • stop play effect for audio mixing

    This methods stops the specified effect for audio mixing file by soundid.

    Parameters

    • soundId: number

    Returns Promise<any>

    Promise<{success, value}>

Static stopPreview

  • stopPreview(): void

Static switchCamera

  • switchCamera(): Promise<any>
  • switch camera

    This method switches camera between front and rear.

    Returns Promise<any>

    Promise<{success, value}>

Static unloadEffect

  • unloadEffect(soundId: number): Promise<any>
  • unload effect

    This methods unload the already loaded audio mixing file from memory by the soundid.

    Parameters

    • soundId: number

    Returns Promise<any>

    Promise<{success, value}>

Generated using TypeDoc