2.4.0-alpha-8 • Published 5 years ago

@zitao/react-native-agora v2.4.0-alpha-8

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago
有任何问题欢迎加入QQ群进行反馈 471757030

for 1.x old version

react-native-agora

npm npm npm npm join chat

Description

The react-native-agora is an open-source wrapper for react-native developers. This SDK takes advantage of React Native and Agora RTC Video SDKs on Android/iOS.

Compatibility

  • react native 0.58.x
  • iOS SDK 8.0+
  • Android 5.0+ x86 arm64 armv7a

quick start

Installation

Install with npm:

npm install --save react-native-agora

Or, install with yarn:

yarn add react-native-agora

Either way, then link with:

react-native link react-native-agora

iOS Installation

中文 English

Android Installation

中文 English

Agora Native API Documentation

Android

中文 English

iOS

中文 English

API DOCS

Events

RtcEngine.on('eventName', (data) => {
    console.log(data);
});
NameDescriptionPlatform
warningwarningall
errorerrorall
apiCallExecutecapture agora native api call executedall
joinChannelSuccessjoin channel successall
reJoinChannelSuccessrejoin channel successall
leaveChannelquit channelall
clientRoleChangedwhen changed client roleall
userJoinedwhen user joined channelall
userOfflinewhen user left channelall
connectionStateChangedwhen connection state changedall
connectionLostwhen connection lostall
tokenPrivilegeWillExpirewhen token will expireall
requestTokenwhen token expiredall
microphoneEnabledwhen microphone enabledall
audioVolumeIndicationnotice audio volumeall
activeSpeakerreports which user is the loudest speakerall
firstLocalAudioFramewhen the first local audio frame is sentall
firstRemoteAudioFramewhen the first remote audio frame is sentall
videoStoppedwhen video stoppedall
firstLocalVideoFramewhen first local video frame is sentall
firstRemoteVideoDecodedwhen first remote video is decodedall
firstRemoteVideoFramewhen first remote video frame is renderedall
userMuteAudiowhen a remote user's audio stream is muted/unmutedall
userMuteVideowhen a remote user's video stream is muted/unmutedall
userEnableVideowhen a remote user enables/disables the video moduleall
userEnableLocalVideowhen a remote user enables/disables the local video capture functionall
videoSizeChangedwhen the video size or rotation information of a specified remote user changesall
remoteVideoStateChangedwhen the remote video stream state changesall
localPublishFallbackToAudioOnlyOccurs when the published video stream falls back to an audio-only stream due to unreliable network conditions or switches back to the video when the network conditions improve.all
remoteSubscribeFallbackToAudioOnlyOccurs when the remote video stream falls back to an audio-only stream due to unreliable network conditions or switches back to the video after the network conditions improve.all
audioRouteChangedwhen the local audio pkayout route changesall
cameraReadywhen the camera is turned on and ready to capture videoall
cameraFocusAreaChangedwhen the camera focus area is changedall
cameraExposureAreaChangedThe camera exposure area has changedall
remoteAudioStatsReports the statistics of the audio stream from each remote user/host.all
rtcStatsReports the statistics of the RtcEngine once every two secondsall
lastmileQualityReports the last mile network quality of the local user once every two seconds before the user joins the channel. Last mile refers to the connection between the local device and Agora's edge server. After the application calls the enableLastmileTest method, this callback reports once every two seconds the uplink and downlink last mile network conditions of the local user before the user joins the channel.all
networkQualityReports the last mile network quality of each user in the channel once every two seconds. Last mile refers to the connection between the local device and Agora's edge server. This callback reports once every two seconds the uplink last mile network conditions of each user in the channel. If a channel includes multiple users, then this callback will be triggered as many times.all
localVideoStatsReports the statistics of the uploading local video streams. This callback is triggered once every two seconds for each individual user/host. If there are multiple users/hosts in the channel, this callback is triggered multiple times every 2 seconds.all
remoteVideoStatsReports the statistics of the video stream from each remote user/host. The SDK triggers this callback once every two seconds for each remote user/host. If a channel includes multiple remote users, the SDK triggers this callback as many times. This callback reports statistics more closely linked to the real-user experience of the video transmission quality than the statistics that the onRemoteVideoTransportStats callback reportsall
audioTransportStatsOfUidReports the transport-layer statistics of each remote audio stream.all
videoTransportStatsOfUidReports the transport-layer statistics of each remote video stream.all
localAudioMixingFinishOccurs when the audio mixing file playback finishes.all
remoteAudioMixingStartOccurs when a remote user starts audio mixing.ios
remoteAudioMixingFinishOccurs when a remote user finishes audio mixing.ios
audioEffectFinishOccurs when the audio effect file playback finishes.all
streamPublishedOccurs when a CDN live stream is published.all
streamUnpublishOccurs when CDN live streaming stops. This callback notifies the host that the CDN live stream is unpublished.all
transcodingUpdateOccurs when the publisher's transcoding settings are updated.all
streamInjectedStatusReports the status of the injected online media stream.all
receiveStreamMessageOccurs when the local user receives a remote data stream within five seconds.all
occurStreamMessageErrorOccurs when the local user fails to receive a remote data stream.all
mediaEngineLoadedOccurs when the media engine is loaded.all
mediaEngineStartCallOccurs when the media engine starts.all
startEchoTestWithIntervalOccurs when you startEchoTestWithIntervalall
audioMixingStateChangedOccurs when audio mixing state changedall
lastmileProbeTestResultReports the last-mile network probe result.all

Resources