Options
All
  • Public
  • Public/Protected
  • All
Menu

react-native-agora

Index

Enumerations

Classes

Interfaces

Type aliases

Type aliases

ApiCallCallback

ApiCallCallback: (error: ErrorCode, api: string, result: string) => void

Type declaration

    • (error: ErrorCode, api: string, result: string): void
    • Parameters

      • error: ErrorCode

        ErrorCode that the SDK returns when the method call fails.

      • api: string

        The method executed by the SDK.

      • result: string

        The result of the method call.

      Returns void

AudioMixingStateCallback

AudioMixingStateCallback: (state: AudioMixingStateCode, reason: AudioMixingReason) => void

Type declaration

AudioQualityCallback

AudioQualityCallback: (uid: number, quality: number, delay: number, lost: number) => void

Type declaration

    • (uid: number, quality: number, delay: number, lost: number): void
    • Parameters

      • uid: number

        User ID of the speaker.

      • quality: number

        Audio quality of the user.

      • delay: number

        Time delay (ms) of the audio packet from the sender to the receiver, including the time delay from audio sampling pre-processing, transmission, and the jitter buffer.

      • lost: number

        Packet loss rate (%) of the audio packet sent from the sender to the receiver.

      Returns void

AudioRouteCallback

AudioRouteCallback: (routing: AudioOutputRouting) => void

Type declaration

AudioVolumeCallback

AudioVolumeCallback: (speakers: AudioVolumeInfo[], totalVolume: number) => void

Type declaration

    • Parameters

      • speakers: AudioVolumeInfo[]

        An array containing the user ID and volume information for each speaker.

        In the local user’s callback, this array contains the following members:

        • uid = 0,
        • volume = totalVolume, which reports the sum of the voice volume and audio-mixing volume of the local user, and
        • vad, which reports the voice activity status of the local user.

        In the remote speakers' callback, this array contains the following members:

        • uid of each remote speaker,
        • volume, which reports the sum of the voice volume and audio-mixing volume of each remote speaker, and
        • vad = 0.

        An empty speakers array in the callback indicates that no remote user is speaking at the moment.

      • totalVolume: number

        Total volume after audio mixing. The value ranges between 0 (lowest volume) and 255 (highest volume).

        • In the local user’s callback, totalVolume is the sum of the voice volume and audio-mixing volume of the local user.
        • In the remote speakers' callback, totalVolume is the sum of the voice volume and audio-mixing volume of all remote speakers.

      Returns void

ClientRoleCallback

ClientRoleCallback: (oldRole: ClientRole, newRole: ClientRole) => void

Type declaration

ClientRoleChangeCallback

ClientRoleChangeCallback: (reason: ClientRoleChangeFailedReason, currentRole: ClientRole) => void

Type declaration

ConnectionStateCallback

ConnectionStateCallback: (state: ConnectionStateType, reason: ConnectionChangedReason) => void

Type declaration

ContentInspectResultCallback

ContentInspectResultCallback: Object

ElapsedCallback

ElapsedCallback: (elapsed: number) => void

Type declaration

    • (elapsed: number): void
    • Parameters

      • elapsed: number

        Time elapsed (ms) from the local user calling the joinChannel until this callback is triggered.

      Returns void

EmptyCallback

EmptyCallback: () => void

Type declaration

    • (): void
    • Returns void

EnabledCallback

EnabledCallback: (enabled: boolean) => void

Type declaration

    • (enabled: boolean): void
    • Parameters

      • enabled: boolean

        Whether the microphone is enabled/disabled:

        • true: Enabled.
        • false: Disabled.

      Returns void

ErrorCallback

ErrorCallback: (err: ErrorCode) => void

Type declaration

FacePositionCallback

FacePositionCallback: (imageWidth: number, imageHeight: number, faces: FacePositionInfo[]) => void

Type declaration

    • Parameters

      • imageWidth: number

        The width (px) of the local video.

      • imageHeight: number

        The height (px) of the local video.

      • faces: FacePositionInfo[]

        The information of the detected human face. For details, see FacePositionInfo. The number of the FacePositionInfo array depends on the number of human faces detected. If the array length is 0, it means that no human face is detected.

      Returns void

FallbackCallback

FallbackCallback: (isFallbackOrRecover: boolean) => void

Type declaration

    • (isFallbackOrRecover: boolean): void
    • Parameters

      • isFallbackOrRecover: boolean

        Whether the published stream fell back to audio-only or switched back to the video:

        • true: The published stream fell back to audio-only due to poor network conditions.
        • false: The published stream switched back to the video after the network conditions improved.

      Returns void

FallbackWithUidCallback

FallbackWithUidCallback: (uid: number, isFallbackOrRecover: boolean) => void

Type declaration

    • (uid: number, isFallbackOrRecover: boolean): void
    • Parameters

      • uid: number

        ID of the remote user sending the stream.

      • isFallbackOrRecover: boolean

        Whether the remote media stream fell back to audio-only or switched back to the video:

        • true: The remote media stream fell back to audio-only due to poor network conditions.
        • false: The remote media stream switched back to the video stream after the network conditions improved.

      Returns void

LastmileProbeCallback

LastmileProbeCallback: (result: LastmileProbeResult) => void

Type declaration

LocalAudioStateCallback

LocalAudioStateCallback: (state: AudioLocalState, error: AudioLocalError) => void

Type declaration

LocalAudioStatsCallback

LocalAudioStatsCallback: (stats: LocalAudioStats) => void

Type declaration

LocalVideoStateCallback

LocalVideoStateCallback: (localVideoState: LocalVideoStreamState, error: LocalVideoStreamError) => void

Type declaration

LocalVideoStatsCallback

LocalVideoStatsCallback: (stats: LocalVideoStats) => void

Type declaration

LocalVoicePitchInHzCallback

LocalVoicePitchInHzCallback: (pitchInHz: number) => void

Type declaration

    • (pitchInHz: number): void
    • Parameters

      • pitchInHz: number

        The voice pitch (Hz) of the local user.

      Returns void

MediaRelayEventCallback

MediaRelayEventCallback: (code: ChannelMediaRelayEvent) => void

Type declaration

MediaRelayStateCallback

MediaRelayStateCallback: (state: ChannelMediaRelayState, code: ChannelMediaRelayError) => void

Type declaration

MetadataCallback

MetadataCallback: (buffer: string, uid: number, timeStampMs: number) => void

Type declaration

    • (buffer: string, uid: number, timeStampMs: number): void
    • Parameters

      • buffer: string

        The received metadata.

      • uid: number

        The ID of the user who sent the metadata.

      • timeStampMs: number

        The timestamp (ms) of the received metadata.

      Returns void

NetworkQualityCallback

NetworkQualityCallback: (quality: NetworkQuality) => void

Type declaration

    • Parameters

      • quality: NetworkQuality

        The last mile network quality based on the uplink and downlink packet loss rate and jitter.

      Returns void

NetworkQualityWithUidCallback

NetworkQualityWithUidCallback: (uid: number, txQuality: NetworkQuality, rxQuality: NetworkQuality) => void

Type declaration

    • Parameters

      • uid: number

        User ID. The network quality of the user with this uid is reported.

      • txQuality: NetworkQuality

        Uplink transmission quality of the user in terms of the transmission bitrate, packet loss rate, average RTT (Round-Trip Time) and jitter of the uplink network. txQuality is a quality rating helping you understand how well the current uplink network conditions can support the selected VideoEncoderConfiguration. For example, a 1000 Kbps uplink network may be adequate for video frames with a resolution of 680 × 480 and a frame rate of 30 fps, but may be inadequate for resolutions higher than 1280 × 720.

      • rxQuality: NetworkQuality

        Downlink network quality rating of the user in terms of packet loss rate, average RTT, and jitter of the downlink network.

      Returns void

NetworkTypeCallback

NetworkTypeCallback: (type: NetworkType) => void

Type declaration

ProxyConnectedCallback

ProxyConnectedCallback: (channel: string, uid: number, proxyType: ProxyType, localProxyIp: string, elapsed: number) => void

Type declaration

    • (channel: string, uid: number, proxyType: ProxyType, localProxyIp: string, elapsed: number): void
    • Parameters

      • channel: string

        The channel name.

      • uid: number

        The user ID.

      • proxyType: ProxyType

        The proxy type connected. See ProxyType.

      • localProxyIp: string

        Reserved for future use.

      • elapsed: number

        The time elapsed (ms) from the user calling joinChannel until this callback is triggered.

      Returns void

RecorderInfoCallback

RecorderInfoCallback: (info: RecorderInfo) => void

Type declaration

RecorderStateChangedCallback

RecorderStateChangedCallback: (reason: number, state: number) => void

Type declaration

    • (reason: number, state: number): void
    • Parameters

      • reason: number

        The current recording state:

        • -1: An error occurs during the recording. See error message for the reason.
        • 2: The audio and video recording is started.
        • 3: The audio and video recording is stopped.
      • state: number

        The reason for the state change:

        • 0: No error occurs.
        • 1: The SDK fails to write the recorded data to a file.
        • 2: The SDK does not detect audio and video streams to be recorded, or audio and video streams are interrupted for more than five seconds during recording.
        • 3: The recording duration exceeds the upper limit.
        • 4: The recording configuration changes.
        • 5: The SDK detects audio and video streams from users using versions of the SDK earlier than v3.0.0 in the Communication channel profile.

      Returns void

RectCallback

RectCallback: (rect: Rect) => void

Type declaration

    • (rect: Rect): void
    • Parameters

      • rect: Rect

        Rectangular area in the camera zoom specifying the focus area.

      Returns void

RemoteAudioStateCallback

RemoteAudioStateCallback: (uid: number, state: AudioRemoteState, reason: AudioRemoteStateReason, elapsed: number) => void

Type declaration

RemoteAudioStatsCallback

RemoteAudioStatsCallback: (stats: RemoteAudioStats) => void

Type declaration

RemoteVideoStateCallback

RemoteVideoStateCallback: (uid: number, state: VideoRemoteState, reason: VideoRemoteStateReason, elapsed: number) => void

Type declaration

RemoteVideoStatsCallback

RemoteVideoStatsCallback: (stats: RemoteVideoStats) => void

Type declaration

RequestAudioFileInfoCallback

RequestAudioFileInfoCallback: (info: AudioFileInfo, error: AudioFileInfoError) => void

Type declaration

RtcStatsCallback

RtcStatsCallback: (stats: RtcStats) => void

Type declaration

    • Parameters

      • stats: RtcStats

        Statistics of the call.

      Returns void

RtmpStreamingEventCallback

RtmpStreamingEventCallback: (url: string, eventCode: RtmpStreamingEvent) => void

Type declaration

RtmpStreamingStateCallback

RtmpStreamingStateCallback: (url: string, state: RtmpStreamingState, errCode: RtmpStreamingErrorCode) => void

Type declaration

SnapshotTakenCallback

SnapshotTakenCallback: (channel: string, uid: number, filePath: string, width: number, height: number, errCode: number) => void

Type declaration

    • (channel: string, uid: number, filePath: string, width: number, height: number, errCode: number): void
    • Parameters

      • channel: string

        The channel name.

      • uid: number

        The user ID of the user. A uid of 0 indicates the local user.

      • filePath: string

        The local path of the snapshot.

      • width: number

        The width (px) of the snapshot.

      • height: number

        The height (px) of the snapshot.

      • errCode: number

        The message that confirms success or the reason why the snapshot is not successfully taken:

        • 0: Success.
        • < 0: Failure:
        • -1: The SDK fails to write data to a file or encode a JPEG image.
        • -2: The SDK does not find the video stream of the specified user within one second after the takeSnapshot method call succeeds.

      Returns void

SoundIdCallback

SoundIdCallback: (soundId: number) => void

Type declaration

    • (soundId: number): void
    • Parameters

      • soundId: number

        ID of the local audio effect. Each local audio effect has a unique ID.

      Returns void

StreamMessageCallback

StreamMessageCallback: (uid: number, streamId: number, data: string) => void

Type declaration

    • (uid: number, streamId: number, data: string): void
    • Parameters

      • uid: number

        User ID of the remote user sending the data stream.

      • streamId: number

        Stream ID.

      • data: string

        Data received by the local user.

      Returns void

StreamMessageErrorCallback

StreamMessageErrorCallback: (uid: number, streamId: number, error: ErrorCode, missed: number, cached: number) => void

Type declaration

    • (uid: number, streamId: number, error: ErrorCode, missed: number, cached: number): void
    • Parameters

      • uid: number

        User ID of the remote user sending the data stream.

      • streamId: number

        Stream ID.

      • error: ErrorCode

        Error code.

      • missed: number

        The number of lost messages.

      • cached: number

        The number of incoming cached messages when the data stream is interrupted.

      Returns void

StreamPublishStateCallback

StreamPublishStateCallback: (channel: string, oldState: StreamPublishState, newState: StreamPublishState, elapseSinceLastState: number) => void

Type declaration

StreamSubscribeStateCallback

StreamSubscribeStateCallback: (channel: string, uid: number, oldState: StreamSubscribeState, newState: StreamSubscribeState, elapseSinceLastState: number) => void

Type declaration

TokenCallback

TokenCallback: (token: string) => void

Type declaration

    • (token: string): void
    • Parameters

      • token: string

        The token that will expire in 30 seconds.

      Returns void

TransportStatsCallback

TransportStatsCallback: (uid: number, delay: number, lost: number, rxKBitRate: number) => void

Type declaration

    • (uid: number, delay: number, lost: number, rxKBitRate: number): void
    • Parameters

      • uid: number

        User ID of the remote user sending the audio packet/video packet.

      • delay: number

        Network time delay (ms) from the remote user sending the audio packet/video packet to the local user.

      • lost: number

        Packet loss rate (%) of the audio packet/video packet sent from the remote user.

      • rxKBitRate: number

        Received bitrate (Kbps) of the audio packet/video packet sent from the remote user.

      Returns void

UidCallback

UidCallback: (uid: number) => void

Type declaration

    • (uid: number): void
    • Parameters

      • uid: number

        The user ID of the most active remote speaker. A uid of 0 represents the local user.

      Returns void

UidWithElapsedAndChannelCallback

UidWithElapsedAndChannelCallback: (channel: string, uid: number, elapsed: number) => void

Type declaration

    • (channel: string, uid: number, elapsed: number): void
    • Parameters

      • channel: string

        Channel name.

      • uid: number

        User ID.

      • elapsed: number

        Time elapsed (ms) from the user calling joinChannel until this callback is triggered.

      Returns void

UidWithElapsedCallback

UidWithElapsedCallback: (uid: number, elapsed: number) => void

Type declaration

UidWithEnabledCallback

UidWithEnabledCallback: (uid: number, enabled: boolean) => void

Type declaration

    • (uid: number, enabled: boolean): void
    • Parameters

      • uid: number

        User ID of the remote user.

      • enabled: boolean

        Whether the specific remote user enables/disables the video module:

        • true: Enabled. The remote user can enter a video session.
        • false: Disabled. The remote user can only enter a voice session, and cannot send or receive any video stream.

      Returns void

UidWithMutedCallback

UidWithMutedCallback: (uid: number, muted: boolean) => void

Type declaration

    • (uid: number, muted: boolean): void
    • Parameters

      • uid: number

        ID of the remote user.

      • muted: boolean

        Whether the remote user's video stream playback pauses/resumes:

        • true: Pause.
        • false: Resume.

      Returns void

UploadLogResultCallback

UploadLogResultCallback: Object

UrlCallback

UrlCallback: (url: string) => void

Type declaration

    • (url: string): void
    • Parameters

      • url: string

        The CDN streaming URL.

      Returns void

UrlWithErrorCallback

UrlWithErrorCallback: (url: string, error: ErrorCode) => void

Type declaration

    • Parameters

      • url: string

        The RTMP or RTMPS streaming URL.

      • error: ErrorCode

        The detailed error information.

      Returns void

UserAccountCallback

UserAccountCallback: (uid: number, userAccount: string) => void

Type declaration

    • (uid: number, userAccount: string): void
    • Parameters

      • uid: number

        The ID of the local user.

      • userAccount: string

        The user account of the local user.

      Returns void

UserInfoCallback

UserInfoCallback: (uid: number, userInfo: UserInfo) => void

Type declaration

    • (uid: number, userInfo: UserInfo): void
    • Parameters

      • uid: number

        The ID of the remote user.

      • userInfo: UserInfo

        The UserInfo object that contains the user ID and user account of the remote user.

      Returns void

UserOfflineCallback

UserOfflineCallback: (uid: number, reason: UserOfflineReason) => void

Type declaration

    • Parameters

      • uid: number

        ID of the user or host who leaves the channel or goes offline.

      • reason: UserOfflineReason

        Reason why the user goes offline.

      Returns void

UserSuperResolutionEnabledCallback

UserSuperResolutionEnabledCallback: (uid: number, enabled: boolean, reason: SuperResolutionStateReason) => void

Type declaration

    • (uid: number, enabled: boolean, reason: SuperResolutionStateReason): void
    • Parameters

      • uid: number

        The user ID of the remote user.

      • enabled: boolean

        Whether super resolution is successfully enabled:

        • true: Super resolution is successfully enabled.
        • false: Super resolution is not successfully enabled.
      • reason: SuperResolutionStateReason

        The reason why super resolution is not successfully enabled or the message that confirms success. See [SuperResolutionStateReason]{@link enum.SuperResolutionStateReason}.

      Returns void

VideoFrameCallback

VideoFrameCallback: (width: number, height: number, elapsed: number) => void

Type declaration

    • (width: number, height: number, elapsed: number): void
    • Parameters

      • width: number

        Width (pixels) of the first local video frame.

      • height: number

        Height (pixels) of the first local video frame.

      • elapsed: number

        Time elapsed (ms) from the local user calling joinChannel until this callback is triggered. If startPreview is called before joinChannel, elapsed is the time elapsed (ms) from the local user calling startPreview until this callback is triggered.

      Returns void

VideoFrameWithUidCallback

VideoFrameWithUidCallback: (uid: number, width: number, height: number, elapsed: number) => void

Type declaration

    • (uid: number, width: number, height: number, elapsed: number): void
    • Parameters

      • uid: number

        User ID of the remote user sending the video streams.

      • width: number

        Width (pixels) of the video stream.

      • height: number

        Height (pixels) of the video stream.

      • elapsed: number

        Time elapsed (ms) from the local user calling joinChannel until this callback is triggered.

      Returns void

VideoSizeCallback

VideoSizeCallback: (uid: number, width: number, height: number, rotation: number) => void

Type declaration

    • (uid: number, width: number, height: number, rotation: number): void
    • Parameters

      • uid: number

        User ID of the remote user or local user (0) whose video size or rotation changes.

      • width: number

        New width (pixels) of the video.

      • height: number

        New height (pixels) of the video.

      • rotation: number

        New rotation of the video [0 to 360).

      Returns void

VirtualBackgroundSourceEnabledCallback

VirtualBackgroundSourceEnabledCallback: (enabled: boolean, reason: VirtualBackgroundSourceStateReason) => void

Type declaration

WarningCallback

WarningCallback: (warn: WarningCode) => void

Type declaration

WlAccMessageCallback

WlAccMessageCallback: Object

WlAccStatsCallback

WlAccStatsCallback: Object

Generated using TypeDoc