Browse Source

Merge pull request #40 from syanbo/v2.x

refactor. event
matrixbirds 5 years ago
parent
commit
ea72642c14
No account linked to committer's email address

+ 1
- 0
.gitignore View File

72
 .vscode
72
 .vscode
73
 samples/**/package-lock.json
73
 samples/**/package-lock.json
74
 *.iml
74
 *.iml
75
+android/bin

+ 1
- 0
.npmignore View File

37
 .settings
37
 .settings
38
 .vscode
38
 .vscode
39
 package-lock.json
39
 package-lock.json
40
+android/bin

+ 50
- 0
CHANGELOG View File

1
+## THE CHANGELOG
2
+
3
+#### 2.3.3-alpha
4
+- support agora video sdk 2.3.3
5
+- release 2.3.3-alpha.3
6
+- release 2.3.3-alpha.4 (remove deprecated native api)
7
+- release 2.3.3-alpha.5 (refactor event react api & refactor native wrapper)
8
+
9
+
10
+#### 1.1.2
11
+- add onVideoMute
12
+- add onAudioMute
13
+
14
+#### 1.1.1
15
+
16
+- add createDataStream
17
+- add sendStreamMessage
18
+- add onStreamMessage
19
+
20
+#### 1.0.9
21
+
22
+- update to agora sdk version 2.0.2
23
+
24
+- add setCameraAutoFocusFaceModeEnabled
25
+
26
+- add setDefaultAudioRouteToSpeakerphone
27
+
28
+- add setCameraTorchOn
29
+
30
+- fix bug: Android speaker's volume indication
31
+
32
+#### 1.0.8
33
+
34
+ - update to agora sdk version 1.12
35
+
36
+ - init wouldn't start video preview. Should manually use startPreview.
37
+
38
+ - init options add new boolean parameter `swapWidthAndHeight` to support swap width and height.
39
+
40
+ - add configPublisher
41
+
42
+ - add setLocalRenderMode
43
+
44
+ - add setRemoteRenderMode
45
+
46
+ - add enableAudioVolumeIndication
47
+
48
+ - add onAudioVolumeIndication
49
+
50
+ - add zOrderMediaOverlay for android platform, support media overlay

+ 189
- 154
README.md View File

34
 
34
 
35
  `react-native link react-native-agora`
35
  `react-native link react-native-agora`
36
 
36
 
37
-### [iOS Installation](docs/IOS_INSTALLATION.md)
38
-### [iOS 开发环境安装指南](docs/IOS_INSTALLATION.zh.md)
37
+### iOS Installation
38
+  [中文](docs/IOS_INSTALLATION.zh.md)
39
+  [English](docs/IOS_INSTALLATION.md)
39
 
40
 
40
-### [Android Installation](docs/ANDROID_INSTALLATION.md)
41
-### [Android 开发环境安装指南](docs/ANDROID_INSTALLATION.zh.md)
41
+### Android Installation
42
+  [中文](docs/ANDROID_INSTALLATION.zh.md) 
43
+  [English](docs/ANDROID_INSTALLATION.md)
42
 
44
 
43
-## Documentation
45
+## Agora Native API Documentation
44
 
46
 
45
-[声网API文档](https://docs.agora.io/cn/Video/API%20Reference/java/index.html)
47
+### Android
48
+  [中文](https://docs.agora.io/cn/Video/API%20Reference/java/index.html) 
49
+  [English](https://docs.agora.io/en/Video/API%20Reference/java/index.html)
46
 
50
 
47
-[Agora.io API DOCS](https://docs.agora.io/en/Video/API%20Reference/java/index.html)
51
+## iOS
52
+  [中文](https://docs.agora.io/cn/Video/API%20Reference/oc/docs/headers/Agora-Objective-C-API-Overview.html)
53
+  [English](https://docs.agora.io/en/Video/API%20Reference/oc/docs/headers/Agora-Objective-C-API-Overview.html)
48
 
54
 
49
-##### RtcEngine方法
50
 
55
 
51
-| Property                         | Arguments                                     | Description                           |
56
+#### RtcEngine Methods
57
+
58
+| Method Name | Parameters  | Description  |
52
 | -------------------------------- | ---------------------------------------- | ------------------------------------- |
59
 | -------------------------------- | ---------------------------------------- | ------------------------------------- |
53
-| init | [Option](#Option) | create and initialize AgoraRtcEngine instance                     
54
-| Promise<any> joinChannel | String channelName, Number uid | join channel|
55
-| eventEmitter | [Events](#Events) | registe event emitters|
56
-| removeEmitter | void | remove event emitter |
60
+| init | [Option](#Option) | create and initialize AgoraRtcEngine instance, notice: invoke this method, it will start subscribe events |
61
+| Promise<any> joinChannel | String channelName, Number uid, String? token, String? extraInfo | join channel|
62
+| on | String: [EventType](#Events), Handler: Function | addEventListener for native module events |
63
+| off | String: [EventType](#Events) | removeEventListeners for native module events |
64
+| removeAllListeners | void | remove all event listeners |
65
+| destroy | void | destroy AgoraRtcEngine instance |
66
+| getSdkVersion | Function: callback | get sdk version |
57
 | Promise<any> enableLastmileTest | void | enable network quality test |
67
 | Promise<any> enableLastmileTest | void | enable network quality test |
58
 | Promise<any> disableLastmileTest | void | disable network quality test |
68
 | Promise<any> disableLastmileTest | void | disable network quality test |
59
 | Promise<any> leaveChannel | void | quit channel |
69
 | Promise<any> leaveChannel | void | quit channel |
60
-| destroy | void | destroy AgoraRtcEngine instance |
61
 | setupLocalVideo | Number: uid, Number: renderMode, Number: reactTag | setup local video |
70
 | setupLocalVideo | Number: uid, Number: renderMode, Number: reactTag | setup local video |
62
 | setupRemoteVideo | Number: uid, Number: renderMode, Number: reactTag | setup remote video |
71
 | setupRemoteVideo | Number: uid, Number: renderMode, Number: reactTag | setup remote video |
63
 | startPreview | void | open video preview |
72
 | startPreview | void | open video preview |
70
 | enableVideo | void | enable video  |
79
 | enableVideo | void | enable video  |
71
 | disableVideo | void | disable video |
80
 | disableVideo | void | disable video |
72
 | setEnableSpeakerphone | Boolean: enabled | set enable speaker phone |
81
 | setEnableSpeakerphone | Boolean: enabled | set enable speaker phone |
73
-| setCameraAutoFocusFaceModeEnabled | Boolean: enabled | set camera auto focus face mode |
82
+| Promise<any> setCameraAutoFocusFaceModeEnabled | Boolean: enabled | set camera auto focus face mode |
74
 | setDefaultAudioRouteToSpeakerphone | Boolean: enabled | set default audio route to speaker phone |
83
 | setDefaultAudioRouteToSpeakerphone | Boolean: enabled | set default audio route to speaker phone |
75
-| setCameraTorchOn  | Boolean: enabled | set camera torch on |
84
+| Promise<any> setCameraTorchOn  | Boolean: enabled | set camera torch on |
76
 | muteLocalAudioStream  | Boolean: enabled | mute/unmute local audio |
85
 | muteLocalAudioStream  | Boolean: enabled | mute/unmute local audio |
77
 | muteRemoteAudioStream  | Number: uid, Boolean: enabled | mute/unmute remote audio by uid |
86
 | muteRemoteAudioStream  | Number: uid, Boolean: enabled | mute/unmute remote audio by uid |
78
 | muteAllRemoteAudioStreams | Boolean: enabled | mute/unmute all remote audio |
87
 | muteAllRemoteAudioStreams | Boolean: enabled | mute/unmute all remote audio |
80
 | enableLocalVideo | Boolean: enabled | set enabled status to local video |
89
 | enableLocalVideo | Boolean: enabled | set enabled status to local video |
81
 | muteAllRemoteVideoStreams | void | mute/unmute all remote videos |
90
 | muteAllRemoteVideoStreams | void | mute/unmute all remote videos |
82
 | muteRemoteVideoStream | Number: uid, Boolean: enabled | mute/unmute remote video by uid |
91
 | muteRemoteVideoStream | Number: uid, Boolean: enabled | mute/unmute remote video by uid |
83
-| getSdkVersion | Function: callback | get sdk version |
84
-| createDataStream | Boolean: reliable, Boolean: ordered | createDataStream |
85
-| sendStreamMessage | Number: streamId, String data | send data with uid |
86
-
92
+| Promise<any> createDataStream | Boolean: reliable, Boolean: ordered | createDataStream |
93
+| Promise<any> renewToken | String: token | renew token |
94
+| Promise<any> getConnectionState | void | return connection state |
95
+| setClientRole | Number: role(1: host, 2: audience) | change client role |
96
+| enableAudio | void | enable audio |
97
+| disableAudio | void | disable audio |
98
+| enableLocalAudio | Boolean: enable | enable/disable local audio |
99
+| muteLocalAudioStream | Boolean: mute | enable/disable local audio stream |
100
+| muteAllRemoteAudioStreams | Boolean: mute | enable/disable all remote audio streams |
101
+| muteRemoteAudioStream | Number: uid, Boolean: mute | mute/unmute remote audio stream by uid |
102
+| adjustRecordingSignalVolume | Number: volume | Adjusts the recording volume. |
103
+| adjustPlaybackSignalVolume | Number: volume | Adjusts the playback volume. |
104
+| enableAudioVolumeIndication | Number: interval, Number: smooth | Enables the onAudioVolumeIndication callback at a set time interval to report on which users are speaking and the speakers' volume. |
105
+| Promise<any> startAudioRecording | {filePath: String, quality: int} | start audio recording |
106
+| Promise<any> stopAudioRecoding | void | stop audio recording |
107
+| methodisSpeakerphoneEnabled | void | Checks whether the speakerphone is enabled.|| enableInEarMonitoring | Boolean: enabled | enable/disable in-ear monitoring | 
108
+| setInEarMonitoringVolume | Number: volume | Sets the volume of the in-ear monitor. |
109
+| setLocalVoicePitch | Number(double): pitch | Changes the voice pitch of the local speaker. |
110
+| setLocalVoiceEqualization | Number: bandFrequency, Number: bandGain | Sets the local voice equalization effect. |
111
+| setLocalVoiceReverb | Number: reverbKey, Number: value | Sets the local voice reverberation.|
112
+| startAudioMixing | {filepath: String, loopback: Boolean, replace: Boolean, cycle: Int} | [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#ac56ceea1a143a4898382bce10b04df09)
113
+ & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/startAudioMixing:loopback:replace:cycle:) |
114
+ | stopAudioMixing | void | stop audio mixing |
115
+ | pauseAudioMixing | void | [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#ab2d4fb72ec3031f59da72b55857e0da7) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/pauseAudioMixing) |
116
+ | resumeAudioMixing | void | resume audio mixing |
117
+ | adjustAudioMixingVolume | Number: volume | adjust audio mixing volume, call this method when you are in a channel |
118
+ | adjustAudioMixingPlayoutVolume | Number: volume | adjust audio mixing playout volume, call this method when you are in a channel |
119
+ | adjustAudioMixingPublishVolume | Number: volume | Adjusts the volume of audio mixing for publishing (sending to other users). call this method when you are in a channel. |
120
+ | Promise<any> getAudioMixingDuration | void | Gets the duration (ms) of the music file. Call this method when you are in a channel. |
121
+ | Promise<any> getAudioMixingCurrentPosition | void | Gets the playback position (ms) of the music file. Call this method when you are in a channel. |
122
+ | Promise<any> setAudioMixingPosition | Number: pos | Sets the playback position (ms) of the music file to a different starting position (the default plays from the beginning). |
123
+ | Promise<any> getEffectsVolume | void | Retrieves the volume of the audio effects. |
124
+ | Promise<any> setEffectsVolume | Number(double): volume | Sets the volume of the audio effects. |
125
+ | Promise<any> setVolumeOfEffect | Number: soundId, Number(double): volume | Sets the volume of a specified audio effect. |
126
+ | Promise<any> playEffect | {soundId: Number, filePath: String, loopCount: Number, pitch: Number(double), gain: Boolean, publish: Boolean} | Plays a specified audio effect. [android](https://docs.agora.io/en/Video/API%20Reference/java/interfaceio_1_1agora_1_1rtc_1_1_i_audio_effect_manager.html#a6fd330db3e3e5735f7f8d5c36bc3fea1) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/playEffect:filePath:loopCount:pitch:pan:gain:publish:) |
127
+ | Promise<any> stopEffect | Number: soundId | Stops playing a specified audio effect. |
128
+ | Promise<any> stopAllEffects | void | Stops all playing audio effects. |
129
+ | Promise<any> preloadEffect | Number: soundid, String: filepath | Preloads a specified audio effect file into the memory. Supported audio formats: mp3, aac, m4a, 3gp, wav.|
130
+ | Promise<any> unloadEffect | Number: soundId | Releases a specified preloaded audio effect from the memory. |
131
+ | Promise<any> pauseEffect | Number: soundId | Pauses a specified audio effect. |
132
+ | Promise<any> pauseAllEffects | void | Pauses all audio effects. |
133
+ | Promise<any> resumeEffect | void | Resumes playing a specified audio effect. |
134
+ | Promise<any> resumeAllEffects | void | Resumes playing all audio effects. |
135
+ | setAudioSessionOperationRestriction | void | [ios only](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setAudioSessionOperationRestriction:) |
136
+ | Promise<any> startEchoTest | void | Starts an audio call test. |
137
+ | Promise<any> stopEchoTest | void | Stop the audio call test. |
138
+ | Promise<any> setRecordingAudioFrameParameters | {sampleRate: Number, channel: Number, mode: Number, samplesPerCall: Number } | Sets the audio recording format for the RecordFrame callback.  |
139
+ | Promise<any> setPlaybackAudioFrameParameters | {sampleRate: Number, channel: Number, mode: Number, samplesPerCall: Number } | Sets the audio playback format for the onPlaybackFrame callback. |
140
+ | Promise<any> addVideoWatermark | {url: String, x: Number, y: Number, width: Number, height: Number } | add video watermark |
141
+ | clearVideoWatermarks | void | remove the watermark image from the video stream added by addVideoWatermark |
142
+ | setLocalPublishFallbackOption | Number: [option(0, 1, 2)](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_constants.html#a3e453c93766e783a7e5eca05b1776238)| [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#ac8c08e79844a4e62e0670553484cbe90) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setLocalPublishFallbackOption:) |
143
+ | setRemoteSubscribeFallbackOption  | Number: [option (0, 1, 2)](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_constants.html#a3e453c93766e783a7e5eca05b1776238)| [android](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#af64301ea1788dad0561aa678f3fe6ad3) & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setRemoteSubscribeFallbackOption:) |
144
+ | Promise<any> enableDualStreamMode | Boolean: enabled | Enables/disables dual-stream mode. |
145
+ | setRemoteVideoStreamType | { uid: Number, streamType: Number } | Sets the video stream type of the remotely subscribed video stream. |
146
+ | setRemoteDefaultVideoStreamType | { streamType: Number } | Sets the default video stream type of the remotely subscribed video stream. |
147
+ | Promise<any> addInjectStreamUrl | [InjectionStream](#InjectionStream) | Injects an online media stream to a live broadcast. |
148
+ | Promise<any> removePublishStreamUrl | String: url | Removes a CDN live stream URL address. |
149
+ | Promise<any> setVideoQualityParameters | Boolean: quality | 
150
+Sets the preference option for the video quality (Live broadcast only). |
151
+ | Promise<any> setLocalVideoMirrorMode | Number: mode | Sets the local video mirror mode. |
152
+ | Promise<any> switchCamera | void | Switches between front and rear cameras. | 
153
+ | Promise<any> isCameraZoomSupported | void | Checks whether the camera zoom function is supported. |
154
+ | Promise<any> isCameraTorchSupported	| void | Checks whether the camera flash function is supported. |
155
+ | Promise<any> isCameraFocusSupported	| void | Checks whether the camera manual focus function is supported. |
156
+ | Promise<any> isCameraExposurePositionSupported | void |Checks whether the camera exposure function is supported. |
157
+ | Promise<any> isCameraAutoFocusFaceModeSupported | void | Checks whether the camera face auto-focus function is supported. |
158
+ | Promise<any> setCameraZoomFactor | Number(float): zoomFactor |	Sets the camera zoom ratio. |
159
+ | Promise<any> getCameraMaxZoomFactor | void |	Gets the maximum zoom ratio of the camera.[android only](https://docs.agora.io/en/Video/API%20Reference/java/classio_1_1agora_1_1rtc_1_1_rtc_engine.html#a1084b42001cc5c008d58ec938fc0b7f3) |
160
+ | Promise<any>  setCameraFocusPositionInPreview | {x: Number(double), y: Number(double) } | Sets the camera manual focus position.|
161
+ | Promise<any>  setCameraExposurePosition | {x: Number(double), y: Number(double) } |	Sets the camera exposure position.|
162
+ | Promise<any>  setCameraTorchOn | Boolean isOn | Enables the camera flash function. |
163
+ | Promise<any>  setCameraAutoFocusFaceModeEnabled | Boolean enabled | Enables the camera auto-face focus function. |
164
+ | Promise<any> getCallId | void | getcalll id |
165
+ | Promise<any> setLog | filePath: String, level: Number | specifies an SDK output log file. |
166
+ | addPublishStreamUrl | { url: String, enabled: Boolean } | Adds a CDN live stream URL address. it must be invoked after invoking setLiveTranscoding |
167
+ | removePublishStreamUrl | { url: String } | Removes a CDN live stream URL address. |
87
 
168
 
88
 #### Option
169
 #### Option
89
 ```typescript
170
 ```typescript
126
 }
207
 }
127
 ```
208
 ```
128
 
209
 
210
+
211
+#### InjectionStream
212
+```typescript
213
+export interface InjectionStream {
214
+  config: {
215
+    size: {
216
+      width: Number,
217
+      height: Number,
218
+    },
219
+    videoGop: Number,
220
+    videoBitrate: Number,
221
+    audioBitrate: Number,
222
+    audioSampleRate: Number,
223
+    videoFrameRate: Number
224
+    audioChannels: Number
225
+  }
226
+}
227
+```
228
+
129
 #### Events
229
 #### Events
130
 
230
 
131
 ```javascript
231
 ```javascript
132
-RtcEngine.eventEmitter({
133
-  onFirstRemoteVideoDecoded: data => {},
134
-  onJoinChannelSuccess: data => {},
135
-  onUserOffline: data => {},
136
-  onUserJoined: data => {},
137
-  onError: data => {},
138
-  onWarning: data => {},
139
-  onLeaveChannel: data => {},
140
-  onAudioVolumeIndication: data => {},
141
-  onStreamMessage: ({uid, streamId, data}) => {},
142
-  onStreamMessageError: ({uid, streamId, error, missed, cached}) => {},
143
-})
232
+RtcEngine.on('eventName', (data) => {
233
+    console.log(data);
234
+});
144
 ```
235
 ```
145
 
236
 
146
-| Name                      | Description  |
147
-| ------------------------- | ------------ |
148
-| onWarning                 | warning |
149
-| onError                   | error |
150
-| onFirstRemoteVideoDecoded | when received first frame send from remote decoded stream |
151
-| onJoinChannelSuccess      | join channel success |
152
-| onReJoinChannelSuccess      | rejoin channel success |
153
-| onLeaveChannel            | quit channel |
154
-| onClientRoleChanged | when changed client role |
155
-| onUserJoined              | when user joined channel |
156
-| onUserOffline             | when user left channel |
157
-| onConnectionStateChanged | when connection state changed |
158
-| onConnectionInterrupted | when connection interrupted |
159
-| onConnectionLost | when connection lost |
160
-| onConnectionBanned | when connection banned |
161
-| onApiCallExecuted | capture api call executed |
162
-| onTokenPrivilegeWillExpire | when token will expire |
163
-| onRequestToken | when token expired |
164
-| onMicrophoneEnabled | when microphone enabled |
165
-| onAudioVolumeIndication | notice audio volume |
166
-| onActiveSpeaker | reports which user is the loudest speaker |
167
-| onFirstLocalAudioFrame | when the first local audio frame is sent |
168
-| onFirstRemoteAudioFrame | when the first remote audio frame is sent |
169
-| onVideoStopped | when video stopped |
170
-| onFirstLocalVideoFrame | when first local video frame is sent |
171
-| onFirstRemoteVideoDecoded | when first remote video is decoded |
172
-| onFirstRemoteVideoFrame | when first remote video frame is rendered |
173
-| onUserMuteAudio | when a remote user's audio stream is muted/unmuted |
174
-| onUserMuteVideo | when a remote user's video stream is muted/unmuted |
175
-| onUserEnableVideo | when a remote user enables/disables the video module |
176
-| onUserEnableLocalVideo | when a remote user enables/disables the local video capture function |
177
-| onVideoSizeChanged | when the video size or rotation information of a specified remote user changes |
178
-| onRemoteVideoStateChanged | when the remote video stream state changes |
179
-| onLocalPublishFallbackToAudioOnly | when the published media stream falls back to an audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve |
180
-| onRemoteSubscribeFallbackToAudioOnly | when the subscribed media stream falls back to audio-only stream due to poor network conditions or switches back to video stream after the network conditions improve |
181
-| onAudioRouteChanged | when the local audio pkayout route changes |
182
-| onCameraReady | when the camera is turned on and ready to capture video |
183
-| onCameraFocusAreaChanged | when the camera focus area is changed |
184
-| onCameraExposureAreaChanged | The camera exposure area has changed |
185
-| onAudioQuality | Reports the statistics of the audio stream from each remote user/host |
186
-| onRtcStats | Reports the statistics of the RtcEngine once every two seconds |
187
-| onLastmileQuality | Reports 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. |
188
-| onNetworkQuality | Reports 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. |
189
-| onLocalVideoStats | Reports 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. |
190
-| onRemoteVideoStats | Reports 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 reports |
191
-| onRemoteAudioStats | Reports the statistics of the audio stream from each remote user/host |
192
-| onLocalVideoStat | Reports the statistics of the uploading local video streams |
193
-| onRemoteVideoStat | Reports the statistics of the video stream from each remote user/host.|
194
-| onRemoteAudioTransportStats | Reports the transport-layer statistics of each remote audio stream.This callback reports the transport-layer statistics, such as the packet loss rate and time delay, once every two seconds after the local user receives an audio packet from a remote user. |
195
-| onRemoteVideoTransportStats | Reports the transport-layer statistics of each remote video stream.This callback reports the transport-layer statistics, such as the packet loss rate and time delay, once every two seconds after the local user receives the video packet from a remote user. |
196
-| onAudioMixingFinished | when the audio mixing file playback finishes. |
197
-| onAudioEffectFinished | when the audio effect file playback finishes. |
198
-| onStreamPublished | when a CDN live stream is published. |
199
-| onStreamUnpublished | when CDN live streaming stops. |
200
-| onTranscodingUpdated | when the publisher's transcoding settings are updated. |
201
-| onStreamInjectedStatus | Reports the status of the injected online media stream. |
202
-| onStreamMessage | recevied stream message peer endpoint |
203
-| onStreamMessageError | recevied error message from peer endpoint stream message |
204
-| onMediaEngineLoadSuccess | when the media engine is loaded. |
205
-| onMediaEngineStartCallSuccess | when the media engine starts. |
206
-
207
-##### AgoraView 组件
237
+| Name                      | Description  | Platform |
238
+| ------------------------- | ------------ | ------- |
239
+| warning                 | warning | all |
240
+| error                   | error | all |
241
+| apiCallExecute | capture agora native api call executed| all |
242
+| joinChannelSuccess      | join channel success | all |
243
+| reJoinChannelSuccess      | rejoin channel success | all |
244
+| leaveChannel            | quit channel | all |
245
+| clientRoleChanged | when changed client role | all |
246
+| userJoined              | when user joined channel | all |
247
+| userOffline             | when user left channel | all |
248
+| connectionStateChanged | when connection state changed | all |
249
+| connectionLost | when connection lost | all |
250
+| tokenPrivilegeWillExpire | when token will expire | all |
251
+| requestToken | when token expired | all |
252
+| microphoneEnabled | when microphone enabled | all |
253
+| audioVolumeIndication | notice audio volume | all |
254
+| activeSpeaker | reports which user is the loudest speaker | all |
255
+| firstLocalAudioFrame | when the first local audio frame is sent | all |
256
+| firstRemoteAudioFrame | when the first remote audio frame is sent | all |
257
+| videoStopped | when video stopped | all |
258
+| firstLocalVideoFrame | when first local video frame is sent | all |
259
+| firstRemoteVideoDecoded | when first remote video is decoded | all |
260
+| firstRemoteVideoFrame | when first remote video frame is rendered | all |
261
+| userMuteAudio | when a remote user's audio stream is muted/unmuted | all |
262
+| userMuteVideo | when a remote user's video stream is muted/unmuted | all |
263
+| userEnableVideo | when a remote user enables/disables the video module | all |
264
+| userEnableLocalVideo | when a remote user enables/disables the local video capture function | all |
265
+| videoSizeChanged | when the video size or rotation information of a specified remote user changes | all|
266
+| remoteVideoStateChanged | when the remote video stream state changes | all |
267
+| localPublishFallbackToAudioOnly | Occurs 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 |
268
+| remoteSubscribeFallbackToAudioOnly | Occurs 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 |
269
+| audioRouteChanged | when the local audio pkayout route changes | all |
270
+| cameraReady | when the camera is turned on and ready to capture video | all |
271
+| cameraFocusAreaChanged | when the camera focus area is changed | all |
272
+| cameraExposureAreaChanged | The camera exposure area has changed | all |
273
+| remoteAudioStats | Reports the statistics of the audio stream from each remote user/host. | all |
274
+| rtcStats | Reports the statistics of the RtcEngine once every two seconds | all |
275
+| lastmileQuality | Reports 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 |
276
+| networkQuality | Reports 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 |
277
+| localVideoStats | Reports 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 |
278
+| remoteVideoStats | Reports 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 reports | all |
279
+| audioTransportStatsOfUid | Reports the transport-layer statistics of each remote audio stream. | all |
280
+| videoTransportStatsOfUid | Reports the transport-layer statistics of each remote video stream. | all |
281
+| localAudioMixingFinish | Occurs when the audio mixing file playback finishes. | all |
282
+| remoteAudioMixingStart | Occurs when a remote user starts audio mixing. | ios |
283
+| remoteAudioMixingFinish | Occurs when a remote user finishes audio mixing. | ios |
284
+| audioEffectFinish | Occurs when the audio effect file playback finishes. | all |
285
+| streamPublished | Occurs when a CDN live stream is published. | all |
286
+| streamUnpublish | Occurs when CDN live streaming stops. This callback notifies the host that the CDN live stream is unpublished. | all |
287
+| transcodingUpdate | Occurs when the publisher's transcoding settings are updated. | all |
288
+| streamInjectedStatus | Reports the status of the injected online media stream. | all |
289
+| receiveStreamMessage | Occurs when the local user receives a remote data stream within five seconds. | all |
290
+| occurStreamMessageError | Occurs when the local user fails to receive a remote data stream. | all |
291
+| mediaEngineLoaded | Occurs when the media engine is loaded. | all |
292
+| mediaEngineStartCall | Occurs when the media engine starts. | all |
293
+
294
+#### AgoraView Component
208
 
295
 
209
 | Name           | Description          |
296
 | Name           | Description          |
210
 | -------------- | -------------------- |
297
 | -------------- | -------------------- |
211
-| showLocalVideo | 是否显示本地视频(bool)       |
212
-| remoteUid      | 显示远程视频(number 传入uid) |
213
-| zOrderMediaOverlay (Android only)      | 多视频界面覆盖 设置为true优先在上层(bool) |
214
-
215
-
216
-## 运行示例
217
-
218
-- 更新示例 React-Native为0.58
219
-
220
-[Samples](./samples/README.md)
221
-
222
-
223
-## 更新信息
224
-#### 2.3.3-alpha
225
-- support agora video sdk 2.3.3
226
-- release 2.3.3-alpha.3
227
-- release 2.3.3-alpha.4 (remove deprecated native api)
228
-
229
-
230
-#### 1.1.2
231
-- 增加onVideoMute
232
-- 新增onAudioMute回调
233
-
234
-#### 1.1.1
235
-
236
-- 新增方法 创建数据流通道 createDataStream
237
-- 新增方法 发送数据流 sendStreamMessage
238
-- 新增监听数据流事件 onStreamMessage
239
-
240
-#### 1.0.9
241
-
242
-- 更新Agora SDK 为 2.0.2
243
-
244
-- 新增方法 是否开启人脸对焦功能 setCameraAutoFocusFaceModeEnabled
245
-
246
-- 新增方法 修改默认的语音路由 setDefaultAudioRouteToSpeakerphone
247
-
248
-- 新增方法 是否打开闪光灯 setCameraTorchOn
249
-
250
-- 修复 Android 说话者音量提示bug
251
-
252
-#### 1.0.8
253
-
254
- - 更新 Agora SDK 为 1.12
255
-
256
- - init 不再默认开启视频预览 根据自己需求和时机调用startPreview
257
-
258
- - init options 新增参数  是否交换宽和高 swapWidthAndHeight 默认false
259
-
260
- - 新增方法 配置旁路直播推流方法 configPublisher
261
-
262
- - 新增方法 设置本地视频显示模式 setLocalRenderMode
263
-
264
- - 新增方法 设置远端视频显示模式 setRemoteRenderMode
265
-
266
- - 新增方法 启用说话者音量提示 enableAudioVolumeIndication
267
-
268
- - 新增音量提示回调 onAudioVolumeIndication
269
-
270
- - Android AgoraView 新增zOrderMediaOverlay属性 解决多视频界面覆盖 设置为true优先在上层
298
+| showLocalVideo | boolean: (true | false) enable/disable video view  | 
299
+| remoteUid      | uid for remote |
300
+| zOrderMediaOverlay (Android only)      | enable zorder to media overlay |
301
+
302
+## Resources
303
+* Complete [API documentation](https://docs.agora.io/en/) at the Developer Center
304
+* [File bugs about this sample](https://github.com/syanbo/react-native-agora/issues)
305
+* [React Native Getting Started](https://facebook.github.io/react-native/docs/getting-started.html)

+ 0
- 8
android/src/main/java/com/syan/agora/AgoraManager.java View File

172
         return mRtcEngine.joinChannel(token, channelName, optionalInfo, uid);
172
         return mRtcEngine.joinChannel(token, channelName, optionalInfo, uid);
173
     }
173
     }
174
 
174
 
175
-//    public int joinChannelWithToken(ReadableMap options) {
176
-//        String token = options.getString("token");
177
-//        String channel = options.getString("channel");
178
-//        String optionalInfo = options.getString("optionalInfo");
179
-//        int uid = options.getInt("uid");
180
-//        return mRtcEngine.joinChannel(token, channel, optionalInfo, uid);
181
-//    }
182
-
183
     public int enableLastmileTest() {
175
     public int enableLastmileTest() {
184
         return mRtcEngine.enableLastmileTest();
176
         return mRtcEngine.enableLastmileTest();
185
     }
177
     }

+ 225
- 147
android/src/main/java/com/syan/agora/AgoraModule.java View File

29
 import io.agora.rtc.Constants;
29
 import io.agora.rtc.Constants;
30
 import io.agora.rtc.IAudioEffectManager;
30
 import io.agora.rtc.IAudioEffectManager;
31
 import io.agora.rtc.IRtcEngineEventHandler;
31
 import io.agora.rtc.IRtcEngineEventHandler;
32
-import io.agora.rtc.PublisherConfiguration;
33
 import io.agora.rtc.RtcEngine;
32
 import io.agora.rtc.RtcEngine;
34
 import io.agora.rtc.live.LiveInjectStreamConfig;
33
 import io.agora.rtc.live.LiveInjectStreamConfig;
35
 import io.agora.rtc.live.LiveTranscoding;
34
 import io.agora.rtc.live.LiveTranscoding;
258
         return constants;
257
         return constants;
259
     }
258
     }
260
 
259
 
260
+    private final static String AGWarning = "warning";
261
+    private final static String AGError = "error";
262
+    private final static String AGApiCallExecute = "apiCallExecute";
263
+    private final static String AGJoinChannelSuccess = "joinChannelSuccess";
264
+    private final static String AGRejoinChannelSuccess = "rejoinChannelSuccess";
265
+    private final static String AGLeaveChannel = "leaveChannel";
266
+    private final static String AGClientRoleChanged = "clientRoleChanged";
267
+    private final static String AGUserJoined = "userJoined";
268
+    private final static String AGUserOffline = "userOffline";
269
+    private final static String AGConnectionStateChanged = "connectionStateChanged";
270
+    private final static String AGConnectionLost = "connectionLost";
271
+    private final static String AGTokenPrivilegeWillExpire = "tokenPrivilegeWillExpire";
272
+    private final static String AGRequestToken = "requestToken";
273
+
274
+    private final static String AGMicrophoneEnabled = "microphoneEnabled";
275
+    private final static String AGAudioVolumeIndication = "audioVolumeIndication";
276
+    private final static String AGActiveSpeaker = "activeSpeaker";
277
+    private final static String AGFirstLocalAudioFrame = "firstLocalAudioFrame";
278
+    private final static String AGFirstRemoteAudioFrame = "firstRemoteAudioFrame";
279
+    private final static String AGVideoStopped = "videoStopped";
280
+    private final static String AGFirstLocalVideoFrame = "firstLocalVideoFrame";
281
+    private final static String AGFirstRemoteVideoDecoded = "firstRemoteVideoDecoded";
282
+    private final static String AGFirstRemoteVideoFrame = "firstRemoteVideoFrame";
283
+    private final static String AGUserMuteAudio = "userMuteAudio";
284
+    private final static String AGUserMuteVideo = "userMuteVideo";
285
+    private final static String AGUserEnableVideo = "userEnableVideo";
286
+    private final static String AGUserEnableLocalVideo = "userEnableLocalVideo";
287
+    private final static String AGVideoSizeChanged = "videoSizeChanged";
288
+    private final static String AGRemoteVideoStateChanged = "remoteVideoStateChanged";
289
+    private final static String AGLocalPublishFallbackToAudioOnly = "localPublishFallbackToAudioOnly";
290
+    private final static String AGRemoteSubscribeFallbackToAudioOnly = "remoteSubscribeFallbackToAudioOnly";
291
+
292
+    private final static String AGAudioRouteChanged = "audioRouteChanged";
293
+    private final static String AGCameraReady = "cameraReady";
294
+    private final static String AGCameraFocusAreaChanged = "cameraFocusAreaChanged";
295
+    private final static String AGCameraExposureAreaChanged = "cameraExposureAreaChanged";
296
+
297
+    private final static String AGRtcStats = "rtcStats";
298
+    private final static String AGLastmileQuality = "lastmileQuality";
299
+    private final static String AGNetworkQuality = "networkQuality";
300
+    private final static String AGLocalVideoStats = "localVideoStats";
301
+    private final static String AGRemoteVideoStats = "remoteVideoStats";
302
+    private final static String AGRemoteAudioStats = "remoteAudioStats";
303
+    private final static String AGAudioTransportStatsOfUid = "audioTransportStatsOfUid";
304
+    private final static String AGVideoTransportStatsOfUid = "videoTransportStatsOfUid";
305
+
306
+    private final static String AGLocalAudioMixingFinish = "localAudioMixingFinish";
307
+    private final static String AGRemoteAudioMixingStart = "remoteAudioMixingStart";
308
+    private final static String AGRemoteAudioMixingFinish = "remoteAudioMixingFinish";
309
+    private final static String AGAudioEffectFinish = "audioEffectFinish";
310
+
311
+    private final static String AGStreamPublished = "streamPublished";
312
+    private final static String AGStreamUnpublish = "streamUnpublish";
313
+    private final static String AGTranscodingUpdate = "transcodingUpdate";
314
+
315
+    private final static String AGStreamInjectedStatus = "streamInjectedStatus";
316
+
317
+    private final static String AGReceiveStreamMessage = "receiveStreamMessage";
318
+    private final static String AGOccurStreamMessageError = "occurStreamMessageError";
319
+
320
+    private final static String AGMediaEngineLoaded = "mediaEngineLoaded";
321
+    private final static String AGMediaEngineStartCall = "mediaEngineStartCall";
322
+
261
     private IRtcEngineEventHandler mRtcEventHandler = new IRtcEngineEventHandler() {
323
     private IRtcEngineEventHandler mRtcEventHandler = new IRtcEngineEventHandler() {
262
 
324
 
263
         @Override
325
         @Override
268
                     WritableMap map = Arguments.createMap();
330
                     WritableMap map = Arguments.createMap();
269
                     map.putString("message", "AgoraWarning");
331
                     map.putString("message", "AgoraWarning");
270
                     map.putInt("code", code);
332
                     map.putInt("code", code);
333
+                    sendEvent(getReactApplicationContext(), AGWarning, map);
271
                 }
334
                 }
272
             });
335
             });
273
         }
336
         }
280
                     WritableMap map = Arguments.createMap();
343
                     WritableMap map = Arguments.createMap();
281
                     map.putString("message", "AgoraError");
344
                     map.putString("message", "AgoraError");
282
                     map.putInt("code", code);
345
                     map.putInt("code", code);
283
-                    sendEvent(getReactApplicationContext(), "onError", map);
346
+                    sendEvent(getReactApplicationContext(), AGError, map);
347
+                }
348
+            });
349
+        }
350
+
351
+        @Override
352
+        public void onApiCallExecuted(final int code, final String api, final String result) {
353
+            runOnUiThread(new Runnable() {
354
+                @Override
355
+                public void run() {
356
+                    WritableMap map = Arguments.createMap();
357
+                    map.putInt("error", code);
358
+                    map.putString("api", api);
359
+                    map.putString("result", result);
360
+                    if (code != 0) {
361
+                        sendEvent(getReactApplicationContext(), AGError, map);
362
+                    } else {
363
+                        sendEvent(getReactApplicationContext(), AGApiCallExecute, map);
364
+                    }
284
                 }
365
                 }
285
             });
366
             });
286
         }
367
         }
294
                     map.putString("channel", channel);
375
                     map.putString("channel", channel);
295
                     map.putInt("uid", uid);
376
                     map.putInt("uid", uid);
296
                     map.putInt("elapsed", elapsed);
377
                     map.putInt("elapsed", elapsed);
297
-                    sendEvent(getReactApplicationContext(), "onJoinChannelSuccess", map);
378
+                    sendEvent(getReactApplicationContext(), AGJoinChannelSuccess, map);
298
                 }
379
                 }
299
             });
380
             });
300
         }
381
         }
308
                     map.putString("channel", channel);
389
                     map.putString("channel", channel);
309
                     map.putInt("uid", uid);
390
                     map.putInt("uid", uid);
310
                     map.putInt("elapsed", elapsed);
391
                     map.putInt("elapsed", elapsed);
311
-                    sendEvent(getReactApplicationContext(), "onReJoinChannelSuccess", map);                }
392
+                    sendEvent(getReactApplicationContext(), AGRejoinChannelSuccess, map);
393
+                }
312
             });
394
             });
313
         }
395
         }
314
 
396
 
318
                 @Override
400
                 @Override
319
                 public void run() {
401
                 public void run() {
320
                     WritableMap statsMap = Arguments.createMap();
402
                     WritableMap statsMap = Arguments.createMap();
321
-                    statsMap.putInt("totalDuration", stats.totalDuration);
403
+                    statsMap.putInt("duration", stats.totalDuration);
322
                     statsMap.putInt("txBytes", stats.txBytes);
404
                     statsMap.putInt("txBytes", stats.txBytes);
323
                     statsMap.putInt("rxBytes", stats.rxBytes);
405
                     statsMap.putInt("rxBytes", stats.rxBytes);
324
-                    statsMap.putInt("txKBitRate", stats.txKBitRate);
325
-                    statsMap.putInt("rxKBitRate", stats.rxKBitRate);
406
+                    // statsMap.putInt("txKBitRate", stats.txKBitRate);
407
+                    // statsMap.putInt("rxKBitRate", stats.rxKBitRate);
326
                     statsMap.putInt("txAudioKBitRate", stats.txAudioKBitRate);
408
                     statsMap.putInt("txAudioKBitRate", stats.txAudioKBitRate);
327
                     statsMap.putInt("rxAudioKBitRate", stats.rxAudioKBitRate);
409
                     statsMap.putInt("rxAudioKBitRate", stats.rxAudioKBitRate);
328
                     statsMap.putInt("txVideoKBitRate", stats.txVideoKBitRate);
410
                     statsMap.putInt("txVideoKBitRate", stats.txVideoKBitRate);
329
                     statsMap.putInt("rxVideoKBitRate", stats.rxVideoKBitRate);
411
                     statsMap.putInt("rxVideoKBitRate", stats.rxVideoKBitRate);
330
-                    statsMap.putInt("users", stats.users);
331
                     statsMap.putInt("lastmileDelay", stats.lastmileDelay);
412
                     statsMap.putInt("lastmileDelay", stats.lastmileDelay);
332
-                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
413
+                    statsMap.putInt("userCount", stats.users);
333
                     statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
414
                     statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
415
+                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
334
 
416
 
335
                     WritableMap map = Arguments.createMap();
417
                     WritableMap map = Arguments.createMap();
336
                     map.putMap("stats", statsMap);
418
                     map.putMap("stats", statsMap);
337
-                    sendEvent(getReactApplicationContext(), "onLeaveChannel", map);
419
+                    sendEvent(getReactApplicationContext(), AGLeaveChannel, map);
338
                 }
420
                 }
339
             });
421
             });
340
         }
422
         }
347
                     WritableMap map = Arguments.createMap();
429
                     WritableMap map = Arguments.createMap();
348
                     map.putInt("oldRole", oldRole);
430
                     map.putInt("oldRole", oldRole);
349
                     map.putInt("newRole", newRole);
431
                     map.putInt("newRole", newRole);
350
-                    sendEvent(getReactApplicationContext(), "onClientRoleChanged", map);
432
+                    sendEvent(getReactApplicationContext(), AGClientRoleChanged, map);
351
                 }
433
                 }
352
             });
434
             });
353
         }
435
         }
360
                     WritableMap map = Arguments.createMap();
442
                     WritableMap map = Arguments.createMap();
361
                     map.putInt("uid", uid);
443
                     map.putInt("uid", uid);
362
                     map.putInt("elapsed", elapsed);
444
                     map.putInt("elapsed", elapsed);
363
-                    sendEvent(getReactApplicationContext(), "onUserJoined", map);
445
+                    sendEvent(getReactApplicationContext(), AGUserJoined, map);
364
                 }
446
                 }
365
             });
447
             });
366
         }
448
         }
373
                     WritableMap map = Arguments.createMap();
455
                     WritableMap map = Arguments.createMap();
374
                     map.putInt("uid", uid);
456
                     map.putInt("uid", uid);
375
                     map.putInt("reason", reason);
457
                     map.putInt("reason", reason);
376
-                    sendEvent(getReactApplicationContext(), "onUserOffline", map);
458
+                    sendEvent(getReactApplicationContext(), AGUserOffline, map);
377
                 }
459
                 }
378
             });
460
             });
379
         }
461
         }
386
                     WritableMap map = Arguments.createMap();
468
                     WritableMap map = Arguments.createMap();
387
                     map.putInt("state", state);
469
                     map.putInt("state", state);
388
                     map.putInt("reason", reason);
470
                     map.putInt("reason", reason);
389
-                    sendEvent(getReactApplicationContext(), "onConnectionStateChanged", map);
471
+                    sendEvent(getReactApplicationContext(), AGConnectionStateChanged, map);
390
                 }
472
                 }
391
             });
473
             });
392
         }
474
         }
398
                 @Override
480
                 @Override
399
                 public void run() {
481
                 public void run() {
400
                     WritableMap map = Arguments.createMap();
482
                     WritableMap map = Arguments.createMap();
401
-                    map.putString("message", "onConnectionLost");
402
-                    sendEvent(getReactApplicationContext(), "onConnectionLost", map);
403
-                }
404
-            });
405
-        }
406
-
407
-        @Override
408
-        public void onApiCallExecuted(final int code, final String api, final String result) {
409
-            runOnUiThread(new Runnable() {
410
-                @Override
411
-                public void run() {
412
-                    if (code != 0) {
413
-                        WritableMap map = Arguments.createMap();
414
-                        map.putInt("error", code);
415
-                        map.putString("api", api);
416
-                        map.putString("result", result);
417
-                        sendEvent(getReactApplicationContext(), "onApiCallExecuted", map);
418
-                    }
483
+                    map.putString("message", "connectionLost");
484
+                    sendEvent(getReactApplicationContext(), AGConnectionLost, map);
419
                 }
485
                 }
420
             });
486
             });
421
         }
487
         }
427
                 public void run() {
493
                 public void run() {
428
                     WritableMap map = Arguments.createMap();
494
                     WritableMap map = Arguments.createMap();
429
                     map.putString("token", token);
495
                     map.putString("token", token);
430
-                    sendEvent(getReactApplicationContext(), "onTokenPrivilegeWillExpire", map);
496
+                    sendEvent(getReactApplicationContext(), AGTokenPrivilegeWillExpire, map);
431
                 }
497
                 }
432
             });
498
             });
433
         }
499
         }
439
                 public void run() {
505
                 public void run() {
440
                     WritableMap map = Arguments.createMap();
506
                     WritableMap map = Arguments.createMap();
441
                     map.putString("message", "RequestToken");
507
                     map.putString("message", "RequestToken");
442
-                    sendEvent(getReactApplicationContext(), "onRequestToken", map);
508
+                    sendEvent(getReactApplicationContext(), AGRequestToken, map);
443
                 }
509
                 }
444
             });
510
             });
445
         }
511
         }
451
                 public void run() {
517
                 public void run() {
452
                     WritableMap map = Arguments.createMap();
518
                     WritableMap map = Arguments.createMap();
453
                     map.putBoolean("enabled", enabled);
519
                     map.putBoolean("enabled", enabled);
454
-                    sendEvent(getReactApplicationContext(), "onMicrophoneEnabled", map);
520
+                    sendEvent(getReactApplicationContext(), AGMicrophoneEnabled, map);
455
                 }
521
                 }
456
 
522
 
457
             });
523
             });
474
                     WritableMap map = Arguments.createMap();
540
                     WritableMap map = Arguments.createMap();
475
                     map.putArray("speakers", arr);
541
                     map.putArray("speakers", arr);
476
                     map.putInt("totalVolume", totalVolume);
542
                     map.putInt("totalVolume", totalVolume);
477
-                    sendEvent(getReactApplicationContext(), "onAudioVolumeIndication", map);
543
+                    sendEvent(getReactApplicationContext(), AGAudioVolumeIndication, map);
478
                 }
544
                 }
479
             });
545
             });
480
         }
546
         }
486
                 public void run() {
552
                 public void run() {
487
                     WritableMap map = Arguments.createMap();
553
                     WritableMap map = Arguments.createMap();
488
                     map.putInt("uid", uid);
554
                     map.putInt("uid", uid);
489
-                    sendEvent(getReactApplicationContext(), "onActiveSpeaker", map);
555
+                    sendEvent(getReactApplicationContext(), AGActiveSpeaker, map);
490
                 }
556
                 }
491
             });
557
             });
492
         }
558
         }
498
                 public void run() {
564
                 public void run() {
499
                     WritableMap map = Arguments.createMap();
565
                     WritableMap map = Arguments.createMap();
500
                     map.putInt("elapsed", elapsed);
566
                     map.putInt("elapsed", elapsed);
501
-                    sendEvent(getReactApplicationContext(), "onFirstLocalAudioFrame", map);
567
+                    sendEvent(getReactApplicationContext(), AGFirstLocalAudioFrame, map);
502
                 }
568
                 }
503
             });
569
             });
504
         }
570
         }
511
                     WritableMap map = Arguments.createMap();
577
                     WritableMap map = Arguments.createMap();
512
                     map.putInt("uid", uid);
578
                     map.putInt("uid", uid);
513
                     map.putInt("elapsed", elapsed);
579
                     map.putInt("elapsed", elapsed);
514
-                    sendEvent(getReactApplicationContext(), "onFirstRemoteAudioFrame", map);
580
+                    sendEvent(getReactApplicationContext(), AGFirstRemoteAudioFrame, map);
515
                 }
581
                 }
516
             });
582
             });
517
         }
583
         }
523
                 public void run() {
589
                 public void run() {
524
                     WritableMap map = Arguments.createMap();
590
                     WritableMap map = Arguments.createMap();
525
                     map.putString("message", "VideoStopped");
591
                     map.putString("message", "VideoStopped");
526
-                    sendEvent(getReactApplicationContext(), "onVideoStopped", map);
592
+                    sendEvent(getReactApplicationContext(), AGVideoStopped, map);
527
                 }
593
                 }
528
             });
594
             });
529
         }
595
         }
537
                     map.putInt("width", width);
603
                     map.putInt("width", width);
538
                     map.putInt("height", height);
604
                     map.putInt("height", height);
539
                     map.putInt("elapsed", elapsed);
605
                     map.putInt("elapsed", elapsed);
540
-                    sendEvent(getReactApplicationContext(), "onFirstLocalVideoFrame", map);
606
+                    sendEvent(getReactApplicationContext(), AGFirstLocalVideoFrame, map);
541
                 }
607
                 }
542
             });
608
             });
543
         }
609
         }
555
                     map.putInt("width", width);
621
                     map.putInt("width", width);
556
                     map.putInt("height", height);
622
                     map.putInt("height", height);
557
                     map.putInt("elapsed", elapsed);
623
                     map.putInt("elapsed", elapsed);
558
-                    sendEvent(getReactApplicationContext(), "onFirstRemoteVideoDecoded", map);
624
+                    sendEvent(getReactApplicationContext(), AGFirstRemoteVideoDecoded, map);
559
                 }
625
                 }
560
             });
626
             });
561
         }
627
         }
570
                     map.putInt("width", width);
636
                     map.putInt("width", width);
571
                     map.putInt("height", height);
637
                     map.putInt("height", height);
572
                     map.putInt("elapsed", elapsed);
638
                     map.putInt("elapsed", elapsed);
573
-                    sendEvent(getReactApplicationContext(), "onFirstRemoteVideoFrame", map);
639
+                    sendEvent(getReactApplicationContext(), AGFirstRemoteVideoFrame, map);
574
                 }
640
                 }
575
             });
641
             });
576
         }
642
         }
581
                 @Override
647
                 @Override
582
                 public void run() {
648
                 public void run() {
583
                     WritableMap map = Arguments.createMap();
649
                     WritableMap map = Arguments.createMap();
584
-                    map.putInt("uid", uid);
585
                     map.putBoolean("muted", muted);
650
                     map.putBoolean("muted", muted);
586
-                    sendEvent(getReactApplicationContext(), "onUserMuteAudio", map);
651
+                    map.putInt("uid", uid);
652
+                    sendEvent(getReactApplicationContext(), AGUserMuteAudio, map);
587
                 }
653
                 }
588
             });
654
             });
589
         }
655
         }
594
                 @Override
660
                 @Override
595
                 public void run() {
661
                 public void run() {
596
                     WritableMap map = Arguments.createMap();
662
                     WritableMap map = Arguments.createMap();
597
-                    map.putInt("uid", uid);
598
                     map.putBoolean("muted", muted);
663
                     map.putBoolean("muted", muted);
599
-                    sendEvent(getReactApplicationContext(), "onUserMuteVideo", map);
664
+                    map.putInt("uid", uid);
665
+                    sendEvent(getReactApplicationContext(), AGUserMuteVideo, map);
600
                 }
666
                 }
601
             });
667
             });
602
         }
668
         }
603
 
669
 
604
         @Override
670
         @Override
605
-        public void onUserEnableVideo(final int uid, final boolean muted) {
671
+        public void onUserEnableVideo(final int uid, final boolean enabled) {
606
             runOnUiThread(new Runnable() {
672
             runOnUiThread(new Runnable() {
607
                 @Override
673
                 @Override
608
                 public void run() {
674
                 public void run() {
609
                     WritableMap map = Arguments.createMap();
675
                     WritableMap map = Arguments.createMap();
676
+                    map.putBoolean("enabled", enabled);
610
                     map.putInt("uid", uid);
677
                     map.putInt("uid", uid);
611
-                    map.putBoolean("muted", muted);
612
-                    sendEvent(getReactApplicationContext(), "onUserEnableVideo", map);
678
+                    sendEvent(getReactApplicationContext(), AGUserEnableVideo, map);
613
                 }
679
                 }
614
             });
680
             });
615
         }
681
         }
616
 
682
 
617
         @Override
683
         @Override
618
-        public void onUserEnableLocalVideo(final int uid, final boolean muted) {
684
+        public void onUserEnableLocalVideo(final int uid, final boolean enabled) {
619
             runOnUiThread(new Runnable() {
685
             runOnUiThread(new Runnable() {
620
                 @Override
686
                 @Override
621
                 public void run() {
687
                 public void run() {
622
                     WritableMap map = Arguments.createMap();
688
                     WritableMap map = Arguments.createMap();
689
+                    map.putBoolean("enabled", enabled);
623
                     map.putInt("uid", uid);
690
                     map.putInt("uid", uid);
624
-                    map.putBoolean("muted", muted);
625
-                    sendEvent(getReactApplicationContext(), "onUserEnableLocalVideo", map);
691
+                    sendEvent(getReactApplicationContext(), AGUserEnableLocalVideo, map);
626
                 }
692
                 }
627
             });
693
             });
628
         }
694
         }
637
                     map.putInt("width", width);
703
                     map.putInt("width", width);
638
                     map.putInt("height", height);
704
                     map.putInt("height", height);
639
                     map.putInt("rotation", rotation);
705
                     map.putInt("rotation", rotation);
640
-                    sendEvent(getReactApplicationContext(), "onVideoSizeChanged", map);
706
+                    sendEvent(getReactApplicationContext(), AGVideoSizeChanged, map);
641
                 }
707
                 }
642
             });
708
             });
643
         }
709
         }
650
                     WritableMap map = Arguments.createMap();
716
                     WritableMap map = Arguments.createMap();
651
                     map.putInt("uid", uid);
717
                     map.putInt("uid", uid);
652
                     map.putInt("state", state);
718
                     map.putInt("state", state);
653
-                    sendEvent(getReactApplicationContext(), "onRemoteVideoStateChanged", map);
719
+                    sendEvent(getReactApplicationContext(), AGRemoteVideoStateChanged, map);
654
                 }
720
                 }
655
             });
721
             });
656
         }
722
         }
662
                 public void run() {
728
                 public void run() {
663
                     WritableMap map = Arguments.createMap();
729
                     WritableMap map = Arguments.createMap();
664
                     map.putBoolean("isFallbackOrRecover", isFallbackOrRecover);
730
                     map.putBoolean("isFallbackOrRecover", isFallbackOrRecover);
665
-                    sendEvent(getReactApplicationContext(), "onLocalPublishFallbackToAudioOnly", map);
731
+                    sendEvent(getReactApplicationContext(), AGLocalPublishFallbackToAudioOnly, map);
666
                 }
732
                 }
667
             });
733
             });
668
         }
734
         }
673
                 @Override
739
                 @Override
674
                 public void run() {
740
                 public void run() {
675
                     WritableMap map = Arguments.createMap();
741
                     WritableMap map = Arguments.createMap();
676
-                    map.putInt("uid", uid);
677
                     map.putBoolean("isFallbackOrRecover", isFallbackOrRecover);
742
                     map.putBoolean("isFallbackOrRecover", isFallbackOrRecover);
678
-                    sendEvent(getReactApplicationContext(), "onRemoteSubscribeFallbackToAudioOnly", map);
743
+                    map.putInt("uid", uid);
744
+                    sendEvent(getReactApplicationContext(), AGRemoteSubscribeFallbackToAudioOnly, map);
679
                 }
745
                 }
680
             });
746
             });
681
         }
747
         }
687
                 public void run() {
753
                 public void run() {
688
                     WritableMap map = Arguments.createMap();
754
                     WritableMap map = Arguments.createMap();
689
                     map.putInt("routing", routing);
755
                     map.putInt("routing", routing);
690
-                    sendEvent(getReactApplicationContext(), "onAudioRouteChanged", map);
756
+                    sendEvent(getReactApplicationContext(), AGAudioRouteChanged, map);
691
                 }
757
                 }
692
             });
758
             });
693
         }
759
         }
699
                 public void run() {
765
                 public void run() {
700
                     WritableMap map = Arguments.createMap();
766
                     WritableMap map = Arguments.createMap();
701
                     map.putString("message", "CameraDidReady");
767
                     map.putString("message", "CameraDidReady");
702
-                    sendEvent(getReactApplicationContext(), "onCameraReady", map);
768
+                    sendEvent(getReactApplicationContext(), AGCameraReady, map);
703
                 }
769
                 }
704
             });
770
             });
705
         }
771
         }
716
                     rectMap.putInt("left", rect.left);
782
                     rectMap.putInt("left", rect.left);
717
                     WritableMap map = Arguments.createMap();
783
                     WritableMap map = Arguments.createMap();
718
                     map.putMap("rect", rectMap);
784
                     map.putMap("rect", rectMap);
719
-                    sendEvent(getReactApplicationContext(), "onCameraFocusAreaChanged", map);
785
+                    sendEvent(getReactApplicationContext(), AGCameraFocusAreaChanged, map);
720
                 }
786
                 }
721
             });
787
             });
722
         }
788
         }
733
                     rectMap.putInt("left", rect.left);
799
                     rectMap.putInt("left", rect.left);
734
                     WritableMap map = Arguments.createMap();
800
                     WritableMap map = Arguments.createMap();
735
                     map.putMap("rect", rectMap);
801
                     map.putMap("rect", rectMap);
736
-                    sendEvent(getReactApplicationContext(), "onCameraExposureAreaChanged", map);
802
+                    sendEvent(getReactApplicationContext(), AGCameraExposureAreaChanged, map);
803
+                }
804
+            });
805
+        }
806
+
807
+        @Override
808
+        public void onRemoteAudioStats(final RemoteAudioStats stats) {
809
+            runOnUiThread(new Runnable() {
810
+                @Override
811
+                public void run() {
812
+                    WritableMap statsMap = Arguments.createMap();
813
+                    statsMap.putInt("uid", stats.uid);
814
+                    statsMap.putInt("quality", stats.quality);
815
+                    statsMap.putInt("networkTransportDelay", stats.networkTransportDelay);
816
+                    statsMap.putInt("jitterBufferDelay", stats.jitterBufferDelay);
817
+                    statsMap.putInt("audioLossRate", stats.audioLossRate);
818
+                    WritableMap map = Arguments.createMap();
819
+                    map.putMap("stats", statsMap);
820
+                    sendEvent(getReactApplicationContext(), AGRemoteAudioStats, map);
737
                 }
821
                 }
738
             });
822
             });
739
         }
823
         }
744
                 @Override
828
                 @Override
745
                 public void run() {
829
                 public void run() {
746
                     WritableMap statsMap = Arguments.createMap();
830
                     WritableMap statsMap = Arguments.createMap();
747
-                    statsMap.putInt("totalDuration", stats.totalDuration);
831
+                    statsMap.putInt("duration", stats.totalDuration);
748
                     statsMap.putInt("txBytes", stats.txBytes);
832
                     statsMap.putInt("txBytes", stats.txBytes);
749
                     statsMap.putInt("rxBytes", stats.rxBytes);
833
                     statsMap.putInt("rxBytes", stats.rxBytes);
750
-                    statsMap.putInt("txKBitRate", stats.txKBitRate);
751
-                    statsMap.putInt("rxKBitRate", stats.rxKBitRate);
752
                     statsMap.putInt("txAudioKBitRate", stats.txAudioKBitRate);
834
                     statsMap.putInt("txAudioKBitRate", stats.txAudioKBitRate);
753
                     statsMap.putInt("rxAudioKBitRate", stats.rxAudioKBitRate);
835
                     statsMap.putInt("rxAudioKBitRate", stats.rxAudioKBitRate);
754
                     statsMap.putInt("txVideoKBitRate", stats.txVideoKBitRate);
836
                     statsMap.putInt("txVideoKBitRate", stats.txVideoKBitRate);
755
                     statsMap.putInt("rxVideoKBitRate", stats.rxVideoKBitRate);
837
                     statsMap.putInt("rxVideoKBitRate", stats.rxVideoKBitRate);
756
-                    statsMap.putInt("users", stats.users);
757
                     statsMap.putInt("lastmileDelay", stats.lastmileDelay);
838
                     statsMap.putInt("lastmileDelay", stats.lastmileDelay);
758
-                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
839
+                    statsMap.putInt("userCount", stats.users);
759
                     statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
840
                     statsMap.putDouble("cpuAppUsage", stats.cpuAppUsage);
841
+                    statsMap.putDouble("cpuTotalUsage", stats.cpuTotalUsage);
760
 
842
 
761
                     WritableMap map = Arguments.createMap();
843
                     WritableMap map = Arguments.createMap();
762
                     map.putMap("stats", statsMap);
844
                     map.putMap("stats", statsMap);
763
-                    sendEvent(getReactApplicationContext(), "onRtcStats", map);
845
+                    sendEvent(getReactApplicationContext(), AGRtcStats, map);
764
                 }
846
                 }
765
             });
847
             });
766
         }
848
         }
772
                 public void run() {
854
                 public void run() {
773
                     WritableMap map = Arguments.createMap();
855
                     WritableMap map = Arguments.createMap();
774
                     map.putInt("quality", quality);
856
                     map.putInt("quality", quality);
775
-                    sendEvent(getReactApplicationContext(), "onLastmileQuality", map);
857
+                    sendEvent(getReactApplicationContext(), AGLastmileQuality, map);
776
                 }
858
                 }
777
             });
859
             });
778
         }
860
         }
786
                     map.putInt("uid", uid);
868
                     map.putInt("uid", uid);
787
                     map.putInt("txQuality", txQuality);
869
                     map.putInt("txQuality", txQuality);
788
                     map.putInt("rxQuality", rxQuality);
870
                     map.putInt("rxQuality", rxQuality);
789
-                    sendEvent(getReactApplicationContext(), "onNetworkQuality", map);
871
+                    sendEvent(getReactApplicationContext(), AGNetworkQuality, map);
790
                 }
872
                 }
791
             });
873
             });
792
         }
874
         }
803
 
885
 
804
                     WritableMap map = Arguments.createMap();
886
                     WritableMap map = Arguments.createMap();
805
                     map.putMap("stats", statsMap);
887
                     map.putMap("stats", statsMap);
806
-                    sendEvent(getReactApplicationContext(), "onLocalVideoStats", map);
888
+                    sendEvent(getReactApplicationContext(), AGLocalVideoStats, map);
807
                 }
889
                 }
808
             });
890
             });
809
         }
891
         }
815
                 public void run() {
897
                 public void run() {
816
                     WritableMap statsMap = Arguments.createMap();
898
                     WritableMap statsMap = Arguments.createMap();
817
                     statsMap.putInt("uid", stats.uid);
899
                     statsMap.putInt("uid", stats.uid);
818
-                    statsMap.putInt("delay", stats.delay);
900
+                    statsMap.putInt("width", stats.width);
901
+                    statsMap.putInt("height", stats.height);
819
                     statsMap.putInt("receivedBitrate", stats.receivedBitrate);
902
                     statsMap.putInt("receivedBitrate", stats.receivedBitrate);
820
                     statsMap.putInt("receivedFrameRate", stats.receivedFrameRate);
903
                     statsMap.putInt("receivedFrameRate", stats.receivedFrameRate);
821
                     statsMap.putInt("rxStreamType", stats.rxStreamType);
904
                     statsMap.putInt("rxStreamType", stats.rxStreamType);
822
                     WritableMap map = Arguments.createMap();
905
                     WritableMap map = Arguments.createMap();
823
                     map.putMap("stats", statsMap);
906
                     map.putMap("stats", statsMap);
824
-                    sendEvent(getReactApplicationContext(), "onRemoteVideoStats", map);
825
-                }
826
-            });
827
-        }
828
-
829
-        @Override
830
-        public void onRemoteAudioStats(final RemoteAudioStats stats) {
831
-            runOnUiThread(new Runnable() {
832
-                @Override
833
-                public void run() {
834
-                    WritableMap statsMap = Arguments.createMap();
835
-                    statsMap.putInt("uid", stats.uid);
836
-                    statsMap.putInt("quality", stats.quality);
837
-                    statsMap.putInt("networkTransportDelay", stats.networkTransportDelay);
838
-                    statsMap.putInt("jitterBufferDelay", stats.jitterBufferDelay);
839
-                    statsMap.putInt("audioLossRate", stats.audioLossRate);
840
-                    WritableMap map = Arguments.createMap();
841
-                    map.putMap("stats", statsMap);
842
-                    sendEvent(getReactApplicationContext(), "onRemoteAudioStats", map);
907
+                    sendEvent(getReactApplicationContext(), AGRemoteVideoStats, map);
843
                 }
908
                 }
844
             });
909
             });
845
         }
910
         }
859
                     statsMap.putInt("rxKBitRate", rxKBitRate);
924
                     statsMap.putInt("rxKBitRate", rxKBitRate);
860
                     WritableMap map = Arguments.createMap();
925
                     WritableMap map = Arguments.createMap();
861
                     map.putMap("stats", statsMap);
926
                     map.putMap("stats", statsMap);
862
-                    sendEvent(getReactApplicationContext(), "onRemoteAudioTransportStats", map);
927
+                    sendEvent(getReactApplicationContext(), AGAudioTransportStatsOfUid, map);
863
                 }
928
                 }
864
             });
929
             });
865
         }
930
         }
879
                     statsMap.putInt("rxKBitRate", rxKBitRate);
944
                     statsMap.putInt("rxKBitRate", rxKBitRate);
880
                     WritableMap map = Arguments.createMap();
945
                     WritableMap map = Arguments.createMap();
881
                     map.putMap("stats", statsMap);
946
                     map.putMap("stats", statsMap);
882
-                    sendEvent(getReactApplicationContext(), "onRemoteVideoTransportStats", map);
947
+                    sendEvent(getReactApplicationContext(), AGVideoTransportStatsOfUid, map);
883
                 }
948
                 }
884
             });
949
             });
885
         }
950
         }
891
                 public void run() {
956
                 public void run() {
892
                     WritableMap map = Arguments.createMap();
957
                     WritableMap map = Arguments.createMap();
893
                     map.putString("message", "LocalAudioMixingSucceedFinish");
958
                     map.putString("message", "LocalAudioMixingSucceedFinish");
894
-                    sendEvent(getReactApplicationContext(), "onAudioMixingFinish", map);
959
+                    sendEvent(getReactApplicationContext(), AGLocalAudioMixingFinish, map);
895
                 }
960
                 }
896
             });
961
             });
897
         }
962
         }
903
                 public void run() {
968
                 public void run() {
904
                     WritableMap map = Arguments.createMap();
969
                     WritableMap map = Arguments.createMap();
905
                     map.putInt("soundId", soundId);
970
                     map.putInt("soundId", soundId);
906
-                    sendEvent(getReactApplicationContext(), "onAudioEffectFinished", map);
971
+                    sendEvent(getReactApplicationContext(), AGAudioEffectFinish, map);
907
                 }
972
                 }
908
             });
973
             });
909
         }
974
         }
910
 
975
 
911
         @Override
976
         @Override
912
-        public void onStreamPublished(final String url, final int error) {
977
+        public void onStreamPublished(final String url, final int errorCode) {
913
             runOnUiThread(new Runnable() {
978
             runOnUiThread(new Runnable() {
914
                 @Override
979
                 @Override
915
                 public void run() {
980
                 public void run() {
916
                     WritableMap map = Arguments.createMap();
981
                     WritableMap map = Arguments.createMap();
917
                     map.putString("url", url);
982
                     map.putString("url", url);
918
-                    map.putInt("error", error);
919
-                    sendEvent(getReactApplicationContext(), "onStreamPublished", map);
983
+                    map.putInt("code", errorCode);
984
+                    sendEvent(getReactApplicationContext(), AGStreamPublished, map);
920
                 }
985
                 }
921
             });
986
             });
922
         }
987
         }
928
                 public void run() {
993
                 public void run() {
929
                     WritableMap map = Arguments.createMap();
994
                     WritableMap map = Arguments.createMap();
930
                     map.putString("url", url);
995
                     map.putString("url", url);
931
-                    sendEvent(getReactApplicationContext(), "onStreamUnpublished", map);
996
+                    sendEvent(getReactApplicationContext(), AGStreamUnpublish, map);
932
                 }
997
                 }
933
             });
998
             });
934
         }
999
         }
939
                 @Override
1004
                 @Override
940
                 public void run() {
1005
                 public void run() {
941
                     WritableMap map = Arguments.createMap();
1006
                     WritableMap map = Arguments.createMap();
942
-                    map.putString("message", "TranscodingUpdated");
943
-                    sendEvent(getReactApplicationContext(), "onTranscodingUpdated", map);
1007
+                    map.putString("message", "AGTranscodingUpdate");
1008
+                    sendEvent(getReactApplicationContext(), AGTranscodingUpdate, map);
944
                 }
1009
                 }
945
             });
1010
             });
946
         }
1011
         }
951
                 @Override
1016
                 @Override
952
                 public void run() {
1017
                 public void run() {
953
                     WritableMap map = Arguments.createMap();
1018
                     WritableMap map = Arguments.createMap();
954
-                    map.putString("url", url);
955
                     map.putInt("uid", uid);
1019
                     map.putInt("uid", uid);
1020
+                    map.putString("url", url);
956
                     map.putInt("status", status);
1021
                     map.putInt("status", status);
957
-                    sendEvent(getReactApplicationContext(), "onStreamInjectedStatus", map);
1022
+                    sendEvent(getReactApplicationContext(), AGStreamInjectedStatus, map);
958
                 }
1023
                 }
959
             });
1024
             });
960
         }
1025
         }
972
                     map.putInt("uid", uid);
1037
                     map.putInt("uid", uid);
973
                     map.putInt("streamId", streamId);
1038
                     map.putInt("streamId", streamId);
974
                     map.putString("data", msg);
1039
                     map.putString("data", msg);
975
-                    sendEvent(getReactApplicationContext(), "onStreamMessage", map);
1040
+                    sendEvent(getReactApplicationContext(), AGReceiveStreamMessage, map);
976
                 }
1041
                 }
977
             });
1042
             });
978
         }
1043
         }
979
 
1044
 
980
         @Override
1045
         @Override
981
-        public void onStreamMessageError(final int uid, final int streamId, final int code, final int missed, final int cached) {
1046
+        public void onStreamMessageError(final int uid, final int streamId, final int error, final int missed, final int cached) {
982
             runOnUiThread(new Runnable() {
1047
             runOnUiThread(new Runnable() {
983
                 @Override
1048
                 @Override
984
                 public void run() {
1049
                 public void run() {
985
                     WritableMap map = Arguments.createMap();
1050
                     WritableMap map = Arguments.createMap();
986
-                    map.putString("type", "onStreamMessageError");
987
                     map.putInt("uid", uid);
1051
                     map.putInt("uid", uid);
988
                     map.putInt("streamId", streamId);
1052
                     map.putInt("streamId", streamId);
989
-                    map.putInt("error", code);
1053
+                    map.putInt("error", error);
990
                     map.putInt("missed", missed);
1054
                     map.putInt("missed", missed);
991
                     map.putInt("cached", cached);
1055
                     map.putInt("cached", cached);
992
-                    sendEvent(getReactApplicationContext(), "onStreamMessageError", map);
1056
+                    sendEvent(getReactApplicationContext(), AGOccurStreamMessageError, map);
993
                 }
1057
                 }
994
             });
1058
             });
995
         }
1059
         }
1000
                 @Override
1064
                 @Override
1001
                 public void run() {
1065
                 public void run() {
1002
                     WritableMap map = Arguments.createMap();
1066
                     WritableMap map = Arguments.createMap();
1003
-                    map.putString("message", "onMediaEngineLoadSuccess");
1004
-                    sendEvent(getReactApplicationContext(), "onMediaEngineLoadSuccess", map);
1067
+                    map.putString("message", "MediaEngineLoaded");
1068
+                    sendEvent(getReactApplicationContext(), AGMediaEngineLoaded, map);
1005
                 }
1069
                 }
1006
             });
1070
             });
1007
         }
1071
         }
1012
                 @Override
1076
                 @Override
1013
                 public void run() {
1077
                 public void run() {
1014
                     WritableMap map = Arguments.createMap();
1078
                     WritableMap map = Arguments.createMap();
1015
-                    map.putString("message", "onMediaEngineStartCallSuccess");
1016
-                    sendEvent(getReactApplicationContext(), "onMediaEngineStartCallSuccess", map);
1079
+                    map.putString("message", "AGMediaEngineStartCall");
1080
+                    sendEvent(getReactApplicationContext(), AGMediaEngineStartCall, map);
1017
                 }
1081
                 }
1018
             });
1082
             });
1019
         }
1083
         }
1029
                            Promise promise) {
1093
                            Promise promise) {
1030
         try {
1094
         try {
1031
             int res = AgoraManager.getInstance().renewToken(token);
1095
             int res = AgoraManager.getInstance().renewToken(token);
1032
-            if (res != 0) throw new ReactNativeAgoraException("renewToken Failed", res);
1096
+            if (res != 0) throw new ReactNativeAgoraException("renew token failed", res);
1033
             WritableMap map = Arguments.createMap();
1097
             WritableMap map = Arguments.createMap();
1034
             map.putBoolean("success", true);
1098
             map.putBoolean("success", true);
1035
             promise.resolve(map);
1099
             promise.resolve(map);
1074
             WritableMap err = Arguments.createMap();
1138
             WritableMap err = Arguments.createMap();
1075
             err.putBoolean("success", false);
1139
             err.putBoolean("success", false);
1076
             err.putString("message", e.toString());
1140
             err.putString("message", e.toString());
1077
-            sendEvent(getReactApplicationContext(), "onError", err);
1141
+            sendEvent(getReactApplicationContext(), "error", err);
1078
         }
1142
         }
1079
     }
1143
     }
1080
 
1144
 
1088
             err.putBoolean("success", false);
1152
             err.putBoolean("success", false);
1089
             err.putString("message", e.toString());
1153
             err.putString("message", e.toString());
1090
             err.putInt("code", ((ReactNativeAgoraException) e).getCode());
1154
             err.putInt("code", ((ReactNativeAgoraException) e).getCode());
1091
-            sendEvent(getReactApplicationContext(), "onError", err);
1155
+            sendEvent(getReactApplicationContext(), "error", err);
1092
         }
1156
         }
1093
     }
1157
     }
1094
 
1158
 
1118
             WritableMap err = Arguments.createMap();
1182
             WritableMap err = Arguments.createMap();
1119
             err.putBoolean("success", false);
1183
             err.putBoolean("success", false);
1120
             err.putString("message", e.toString());
1184
             err.putString("message", e.toString());
1121
-            sendEvent(getReactApplicationContext(), "onError", err);
1185
+            sendEvent(getReactApplicationContext(), "error", err);
1122
         }
1186
         }
1123
     }
1187
     }
1124
 
1188
 
1132
             WritableMap err = Arguments.createMap();
1196
             WritableMap err = Arguments.createMap();
1133
             err.putBoolean("success", false);
1197
             err.putBoolean("success", false);
1134
             err.putString("message", e.toString());
1198
             err.putString("message", e.toString());
1135
-            sendEvent(getReactApplicationContext(), "onError", err);
1199
+            sendEvent(getReactApplicationContext(), "error", err);
1136
         }
1200
         }
1137
     }
1201
     }
1138
 
1202
 
1155
             WritableMap err = Arguments.createMap();
1219
             WritableMap err = Arguments.createMap();
1156
             err.putBoolean("success", false);
1220
             err.putBoolean("success", false);
1157
             err.putString("message", e.toString());
1221
             err.putString("message", e.toString());
1158
-            sendEvent(getReactApplicationContext(), "onError", err);
1222
+            sendEvent(getReactApplicationContext(), "error", err);
1159
         }
1223
         }
1160
     }
1224
     }
1161
 
1225
 
1168
             WritableMap err = Arguments.createMap();
1232
             WritableMap err = Arguments.createMap();
1169
             err.putBoolean("success", false);
1233
             err.putBoolean("success", false);
1170
             err.putString("message", e.toString());
1234
             err.putString("message", e.toString());
1171
-            sendEvent(getReactApplicationContext(), "onError", err);
1235
+            sendEvent(getReactApplicationContext(), "error", err);
1172
         }
1236
         }
1173
     }
1237
     }
1174
 
1238
 
1301
         }
1365
         }
1302
     }
1366
     }
1303
 
1367
 
1368
+    @ReactMethod
1369
+    public void getCameraMaxZoomFactor(Promise promise) {
1370
+        try {
1371
+            double res = AgoraManager.getInstance().mRtcEngine.getCameraMaxZoomFactor();
1372
+            WritableMap map = Arguments.createMap();
1373
+            map.putBoolean("success", true);
1374
+            map.putDouble("value", res);
1375
+            promise.resolve(map);
1376
+        } catch (Exception e) {
1377
+            promise.reject(e);
1378
+        }
1379
+    }
1380
+
1304
     @ReactMethod
1381
     @ReactMethod
1305
     public void setCameraFocusPositionInPreview(ReadableMap options, Promise promise) {
1382
     public void setCameraFocusPositionInPreview(ReadableMap options, Promise promise) {
1306
         try {
1383
         try {
1353
     public void setCameraAutoFocusFaceModeEnabled(boolean enabled, Promise promise) {
1430
     public void setCameraAutoFocusFaceModeEnabled(boolean enabled, Promise promise) {
1354
         try {
1431
         try {
1355
             int res = AgoraManager.getInstance().mRtcEngine.setCameraAutoFocusFaceModeEnabled(enabled);
1432
             int res = AgoraManager.getInstance().mRtcEngine.setCameraAutoFocusFaceModeEnabled(enabled);
1356
-            if (res != 0) throw new ReactNativeAgoraException("setCameraTorchOn Failed", res);
1433
+            if (res != 0) throw new ReactNativeAgoraException("setCameraAutoFocusFaceModeEnabled Failed", res);
1357
             WritableMap map = Arguments.createMap();
1434
             WritableMap map = Arguments.createMap();
1358
             map.putBoolean("success", true);
1435
             map.putBoolean("success", true);
1359
             map.putInt("value", res);
1436
             map.putInt("value", res);
1428
             WritableMap err = Arguments.createMap();
1505
             WritableMap err = Arguments.createMap();
1429
             err.putBoolean("success", false);
1506
             err.putBoolean("success", false);
1430
             err.putString("message", e.toString());
1507
             err.putString("message", e.toString());
1431
-            sendEvent(getReactApplicationContext(), "onError", err);
1508
+            sendEvent(getReactApplicationContext(), "error", err);
1432
         }
1509
         }
1433
     }
1510
     }
1434
 
1511
 
1441
             WritableMap err = Arguments.createMap();
1518
             WritableMap err = Arguments.createMap();
1442
             err.putBoolean("success", false);
1519
             err.putBoolean("success", false);
1443
             err.putString("message", e.toString());
1520
             err.putString("message", e.toString());
1444
-            sendEvent(getReactApplicationContext(), "onError", err);
1521
+            sendEvent(getReactApplicationContext(), "error", err);
1445
         }
1522
         }
1446
     }
1523
     }
1447
 
1524
 
1494
             WritableMap err = Arguments.createMap();
1571
             WritableMap err = Arguments.createMap();
1495
             err.putBoolean("success", false);
1572
             err.putBoolean("success", false);
1496
             err.putString("message", e.toString());
1573
             err.putString("message", e.toString());
1497
-            sendEvent(getReactApplicationContext(), "onError", err);
1574
+            sendEvent(getReactApplicationContext(), "error", err);
1498
         }
1575
         }
1499
     }
1576
     }
1500
 
1577
 
1507
             WritableMap err = Arguments.createMap();
1584
             WritableMap err = Arguments.createMap();
1508
             err.putBoolean("success", false);
1585
             err.putBoolean("success", false);
1509
             err.putString("message", e.toString());
1586
             err.putString("message", e.toString());
1510
-            sendEvent(getReactApplicationContext(), "onError", err);
1587
+            sendEvent(getReactApplicationContext(), "error", err);
1511
         }
1588
         }
1512
     }
1589
     }
1513
 
1590
 
1520
             WritableMap err = Arguments.createMap();
1597
             WritableMap err = Arguments.createMap();
1521
             err.putBoolean("success", false);
1598
             err.putBoolean("success", false);
1522
             err.putString("message", e.toString());
1599
             err.putString("message", e.toString());
1523
-            sendEvent(getReactApplicationContext(), "onError", err);
1600
+            sendEvent(getReactApplicationContext(), "error", err);
1524
         }
1601
         }
1525
     }
1602
     }
1526
 
1603
 
1533
             WritableMap err = Arguments.createMap();
1610
             WritableMap err = Arguments.createMap();
1534
             err.putBoolean("success", false);
1611
             err.putBoolean("success", false);
1535
             err.putString("message", e.toString());
1612
             err.putString("message", e.toString());
1536
-            sendEvent(getReactApplicationContext(), "onError", err);
1613
+            sendEvent(getReactApplicationContext(), "error", err);
1537
         }
1614
         }
1538
     }
1615
     }
1539
 
1616
 
1546
             WritableMap err = Arguments.createMap();
1623
             WritableMap err = Arguments.createMap();
1547
             err.putBoolean("success", false);
1624
             err.putBoolean("success", false);
1548
             err.putString("message", e.toString());
1625
             err.putString("message", e.toString());
1549
-            sendEvent(getReactApplicationContext(), "onError", err);
1626
+            sendEvent(getReactApplicationContext(), "error", err);
1550
         }
1627
         }
1551
     }
1628
     }
1552
 
1629
 
1564
             WritableMap err = Arguments.createMap();
1641
             WritableMap err = Arguments.createMap();
1565
             err.putBoolean("success", false);
1642
             err.putBoolean("success", false);
1566
             err.putString("message", e.toString());
1643
             err.putString("message", e.toString());
1567
-            sendEvent(getReactApplicationContext(), "onError", err);
1644
+            sendEvent(getReactApplicationContext(), "error", err);
1568
         }
1645
         }
1569
     }
1646
     }
1570
 
1647
 
1577
             WritableMap err = Arguments.createMap();
1654
             WritableMap err = Arguments.createMap();
1578
             err.putBoolean("success", false);
1655
             err.putBoolean("success", false);
1579
             err.putString("message", e.toString());
1656
             err.putString("message", e.toString());
1580
-            sendEvent(getReactApplicationContext(), "onError", err);
1657
+            sendEvent(getReactApplicationContext(), "error", err);
1581
         }
1658
         }
1582
     }
1659
     }
1583
 
1660
 
1590
             WritableMap err = Arguments.createMap();
1667
             WritableMap err = Arguments.createMap();
1591
             err.putBoolean("success", false);
1668
             err.putBoolean("success", false);
1592
             err.putString("message", e.toString());
1669
             err.putString("message", e.toString());
1593
-            sendEvent(getReactApplicationContext(), "onError", err);
1670
+            sendEvent(getReactApplicationContext(), "error", err);
1594
         }
1671
         }
1595
     }
1672
     }
1596
 
1673
 
1603
             WritableMap err = Arguments.createMap();
1680
             WritableMap err = Arguments.createMap();
1604
             err.putBoolean("success", false);
1681
             err.putBoolean("success", false);
1605
             err.putString("message", e.toString());
1682
             err.putString("message", e.toString());
1606
-            sendEvent(getReactApplicationContext(), "onError", err);
1683
+            sendEvent(getReactApplicationContext(), "error", err);
1607
         }
1684
         }
1608
     }
1685
     }
1609
 
1686
 
1616
             WritableMap err = Arguments.createMap();
1693
             WritableMap err = Arguments.createMap();
1617
             err.putBoolean("success", false);
1694
             err.putBoolean("success", false);
1618
             err.putString("message", e.toString());
1695
             err.putString("message", e.toString());
1619
-            sendEvent(getReactApplicationContext(), "onError", err);
1696
+            sendEvent(getReactApplicationContext(), "error", err);
1620
         }
1697
         }
1621
     }
1698
     }
1622
 
1699
 
1629
             WritableMap err = Arguments.createMap();
1706
             WritableMap err = Arguments.createMap();
1630
             err.putBoolean("success", false);
1707
             err.putBoolean("success", false);
1631
             err.putString("message", e.toString());
1708
             err.putString("message", e.toString());
1632
-            sendEvent(getReactApplicationContext(), "onError", err);
1709
+            sendEvent(getReactApplicationContext(), "error", err);
1633
         }
1710
         }
1634
     }
1711
     }
1635
 
1712
 
1642
             WritableMap err = Arguments.createMap();
1719
             WritableMap err = Arguments.createMap();
1643
             err.putBoolean("success", false);
1720
             err.putBoolean("success", false);
1644
             err.putString("message", e.toString());
1721
             err.putString("message", e.toString());
1645
-            sendEvent(getReactApplicationContext(), "onError", err);
1722
+            sendEvent(getReactApplicationContext(), "error", err);
1646
         }
1723
         }
1647
     }
1724
     }
1648
 
1725
 
1769
     public void disableLastmileTest(Promise promise) {
1846
     public void disableLastmileTest(Promise promise) {
1770
         try {
1847
         try {
1771
             int res = AgoraManager.getInstance().mRtcEngine
1848
             int res = AgoraManager.getInstance().mRtcEngine
1772
-                    .enableLastmileTest();
1849
+                    .disableLastmileTest();
1773
             if (res != 0) throw new ReactNativeAgoraException("disableLastmileTest Failed", res);
1850
             if (res != 0) throw new ReactNativeAgoraException("disableLastmileTest Failed", res);
1774
             WritableMap map = Arguments.createMap();
1851
             WritableMap map = Arguments.createMap();
1775
             map.putBoolean("success", true);
1852
             map.putBoolean("success", true);
2013
     @ReactMethod
2090
     @ReactMethod
2014
     public void addInjectStreamUrl(ReadableMap options, Promise promise) {
2091
     public void addInjectStreamUrl(ReadableMap options, Promise promise) {
2015
         try {
2092
         try {
2016
-            LiveInjectStreamConfig config = new LiveInjectStreamConfig();
2017
-            config.width = options.getInt("width");
2018
-            config.height = options.getInt("height");
2019
-            config.videoGop = options.getInt("videoGop");
2020
-            config.videoBitrate = options.getInt("videoBitrate");
2021
-            config.videoFramerate = options.getInt("videoFramerate");
2022
-            config.audioBitrate = options.getInt("audioBitrate");
2023
-            config.audioSampleRate = getAudioSampleRateEnum(options.getInt("audioSampleRate"));
2024
-            config.audioChannels = options.getInt("audioChannels");
2025
-
2093
+            LiveInjectStreamConfig injectstream = new LiveInjectStreamConfig();
2094
+            ReadableMap config = options.getMap("config");
2095
+            ReadableMap size = config.getMap("size");
2096
+            injectstream.width = size.getInt("width");
2097
+            injectstream.height = size.getInt("height");
2098
+            injectstream.videoGop = config.getInt("videoGop");
2099
+            injectstream.videoBitrate = config.getInt("videoBitrate");
2100
+            injectstream.videoFramerate = config.getInt("videoFramerate");
2101
+            injectstream.audioBitrate = config.getInt("audioBitrate");
2102
+            injectstream.audioSampleRate = getAudioSampleRateEnum(config.getInt("audioSampleRate"));
2103
+            injectstream.audioChannels = config.getInt("audioChannels");
2026
 
2104
 
2027
             int res = AgoraManager.getInstance().mRtcEngine
2105
             int res = AgoraManager.getInstance().mRtcEngine
2028
                     .addInjectStreamUrl(
2106
                     .addInjectStreamUrl(
2029
                             options.getString("url"),
2107
                             options.getString("url"),
2030
-                            config
2108
+                            injectstream
2031
                     );
2109
                     );
2032
             if (res != 0) throw new ReactNativeAgoraException("addInjectStreamUrl Failed", res);
2110
             if (res != 0) throw new ReactNativeAgoraException("addInjectStreamUrl Failed", res);
2033
             WritableMap map = Arguments.createMap();
2111
             WritableMap map = Arguments.createMap();
2176
             WritableMap err = Arguments.createMap();
2254
             WritableMap err = Arguments.createMap();
2177
             err.putBoolean("success", false);
2255
             err.putBoolean("success", false);
2178
             err.putString("message", e.toString());
2256
             err.putString("message", e.toString());
2179
-            sendEvent(getReactApplicationContext(), "onError", err);
2257
+            sendEvent(getReactApplicationContext(), "error", err);
2180
         }
2258
         }
2181
     }
2259
     }
2182
 
2260
 

+ 62
- 67
ios/RCTAgora/AgoraConst.h View File

10
 
10
 
11
 static NSString *RCTAgoraErrorDomain = @"RCTAgoraErrorDomain";
11
 static NSString *RCTAgoraErrorDomain = @"RCTAgoraErrorDomain";
12
 
12
 
13
-static NSString *DidOccurWarning = @"onWarning";
14
-static NSString *DidOccurError = @"onError";
15
-static NSString *DidApiCallExecute = @"onApiCallExecute";
16
-static NSString *DidJoinChannel = @"onJoinChannelSuccess";
17
-static NSString *DidRejoinChannel = @"onRejoinChannelSuccess";
18
-static NSString *DidLeaveChannel = @"onLeaveChannel";
19
-static NSString *DidClientRoleChanged = @"onClientRoleChanged";
20
-static NSString *DidJoinedOfUid = @"onUserJoined";
21
-static NSString *DidOfflineOfUid = @"onUserOffline";
22
-static NSString *ConnectionChangedToState = @"onConnectionStateChanged";
23
-static NSString *ConnectionDidLost = @"onConnectionLost";
24
-static NSString *TokenPrivilegeWillExpire = @"onTokenPrivilegeWillExpire";
25
-static NSString *RequestToken = @"onRequestToken";
26
-
27
-static NSString *DidMicrophoneEnabled = @"onMicrophoneEnabled";
28
-static NSString *ReportAudioVolumeIndicationOfSpeakers = @"onAudioVolumeIndication";
29
-static NSString *ActiveSpeaker = @"onActiveSpeaker";
30
-static NSString *FirstLocalAudioFrame = @"onFirstLocalAudioFrame";
31
-static NSString *FirstRemoteAudioFrameOfUid = @"onFirstRemoteAudioFrame";
32
-static NSString *VideoDidStop = @"onVideoStopped";
33
-static NSString *FirstLocalVideoFrameWithSize = @"onFirstLocalVideoFrame";
34
-static NSString *FirstRemoteVideoDecodedOfUid = @"onFirstRemoteVideoDecoded";
35
-static NSString *FirstRemoteVideoFrameOfUid = @"onFirstRemoteVideoFrame";
36
-static NSString *DidAudioMuted = @"onUserMuteAudio";
37
-static NSString *DidVideoMuted = @"onUserMuteVideo";
38
-static NSString *DidVideoEnabled = @"onUserEnableVideo";
39
-static NSString *DidLocalVideoEnabled = @"onUserEnableLocalVideo";
40
-static NSString *VideoSizeChangedOfUid = @"onVideoSizeChanged";
41
-static NSString *RemoteVideoStateChangedOfUid = @"onRemoteVideoStateChanged";
42
-static NSString *DidLocalPublishFallbackToAudioOnly = @"onLocalPublishFallbackToAudioOnly";
43
-static NSString *DidRemoteSubscribeFallbackToAudioOnly = @"onRemoteSubscribeFallbackToAudioOnly";
44
-
45
-static NSString *DeviceTypeStateChanged = @"onDeviceTypeStateChanged";
46
-static NSString *DidAudioRouteChanged = @"onAudioRouteChanged";
47
-static NSString *CameraDidReady = @"onCameraReady";
48
-static NSString *CameraFocusDidChangedToRect = @"onCameraFocusAreaChanged";
49
-static NSString *CameraExposureDidChangedToRect = @"onCameraExposureAreaChanged";
50
-
51
-static NSString *ReportRtcStats = @"onRtcStats";
52
-static NSString *LastmileQuality = @"onLastmileQuality";
53
-static NSString *NetworkQuality = @"onNetworkQuality";
54
-static NSString *LocalVideoStats = @"onLocalVideoStats";
55
-static NSString *RemoteVideoStats = @"onRemoteVideoStats";
56
-static NSString *RemoteAudioStats = @"onRemoteAudioStats";
57
-static NSString *AudioTransportStatsOfUid = @"AudioTransportStatsOfUid";
58
-static NSString *VideoTransportStatsOfUid = @"VideoTransportStatsOfUid";
59
-
60
-static NSString *LocalAudioMixingDidFinish = @"onLocalAudioMixingFinish";
61
-static NSString *RemoteAudioMixingDidStart = @"onRemoteAudioMixingStart";
62
-static NSString *RemoteAudioMixingDidFinish = @"onRemoteAudioMixingFinish";
63
-static NSString *DidAudioEffectFinish = @"onAudioEffectFinish";
64
-
65
-static NSString *StreamPublished = @"onStreamPublished";
66
-static NSString *StreamUnpublish = @"onStreamUnpublish";
67
-static NSString *TranscodingUpdated = @"onTranscodingUpdate";
68
-
69
-static NSString *StreamInjectedStatus = @"onStreamInjectedStatus";
70
-
71
-static NSString *ReceiveStreamMessage = @"onReceiveStreamMessage";
72
-static NSString *DidOccurStreamMessageError = @"onOccurStreamMessageError";
73
-
74
-static NSString *MediaEngineDidLoaded = @"onMediaEngineLoaded";
75
-static NSString *MediaEngineDidStartCall = @"onMediaEngineStartCall";
76
-
77
-static NSString *ConnectionDidInterrupted = @"onConnectionInterrupted";
78
-static NSString *ConnectionDidBanned = @"onConnectionBanned";
79
-static NSString *AudioQualityOfUid = @"onAudioQuality";
13
+static NSString *AGWarning = @"warning";
14
+static NSString *AGError = @"error";
15
+static NSString *AGApiCallExecute = @"apiCallExecute";
16
+static NSString *AGJoinChannelSuccess = @"joinChannelSuccess";
17
+static NSString *AGRejoinChannelSuccess = @"rejoinChannelSuccess";
18
+static NSString *AGLeaveChannel = @"leaveChannel";
19
+static NSString *AGClientRoleChanged = @"clientRoleChanged";
20
+static NSString *AGUserJoined = @"userJoined";
21
+static NSString *AGUserOffline = @"userOffline";
22
+static NSString *AGConnectionStateChanged = @"connectionStateChanged";
23
+static NSString *AGConnectionLost = @"connectionLost";
24
+static NSString *AGTokenPrivilegeWillExpire = @"tokenPrivilegeWillExpire";
25
+static NSString *AGRequestToken = @"requestToken";
26
+
27
+static NSString *AGMicrophoneEnabled = @"microphoneEnabled";
28
+static NSString *AGAudioVolumeIndication = @"audioVolumeIndication";
29
+static NSString *AGActiveSpeaker = @"activeSpeaker";
30
+static NSString *AGFirstLocalAudioFrame = @"firstLocalAudioFrame";
31
+static NSString *AGFirstRemoteAudioFrame = @"firstRemoteAudioFrame";
32
+static NSString *AGVideoStopped = @"videoStopped";
33
+static NSString *AGFirstLocalVideoFrame = @"firstLocalVideoFrame";
34
+static NSString *AGFirstRemoteVideoDecoded = @"firstRemoteVideoDecoded";
35
+static NSString *AGFirstRemoteVideoFrame = @"firstRemoteVideoFrame";
36
+static NSString *AGUserMuteAudio = @"userMuteAudio";
37
+static NSString *AGUserMuteVideo = @"userMuteVideo";
38
+static NSString *AGUserEnableVideo = @"userEnableVideo";
39
+static NSString *AGUserEnableLocalVideo = @"userEnableLocalVideo";
40
+static NSString *AGVideoSizeChanged = @"videoSizeChanged";
41
+static NSString *AGRemoteVideoStateChanged = @"remoteVideoStateChanged";
42
+static NSString *AGLocalPublishFallbackToAudioOnly = @"localPublishFallbackToAudioOnly";
43
+static NSString *AGRemoteSubscribeFallbackToAudioOnly = @"remoteSubscribeFallbackToAudioOnly";
44
+
45
+static NSString *AGAudioRouteChanged = @"audioRouteChanged";
46
+static NSString *AGCameraReady = @"cameraReady";
47
+static NSString *AGCameraFocusAreaChanged = @"cameraFocusAreaChanged";
48
+static NSString *AGCameraExposureAreaChanged = @"cameraExposureAreaChanged";
49
+
50
+static NSString *AGRtcStats = @"rtcStats";
51
+static NSString *AGLastmileQuality = @"lastmileQuality";
52
+static NSString *AGNetworkQuality = @"networkQuality";
53
+static NSString *AGLocalVideoStats = @"localVideoStats";
54
+static NSString *AGRemoteVideoStats = @"remoteVideoStats";
55
+static NSString *AGRemoteAudioStats = @"remoteAudioStats";
56
+static NSString *AGAudioTransportStatsOfUid = @"audioTransportStatsOfUid";
57
+static NSString *AGVideoTransportStatsOfUid = @"videoTransportStatsOfUid";
58
+
59
+static NSString *AGLocalAudioMixingFinish = @"localAudioMixingFinish";
60
+static NSString *AGRemoteAudioMixingStart = @"remoteAudioMixingStart";
61
+static NSString *AGRemoteAudioMixingFinish = @"remoteAudioMixingFinish";
62
+static NSString *AGAudioEffectFinish = @"audioEffectFinish";
63
+
64
+static NSString *AGStreamPublished = @"streamPublished";
65
+static NSString *AGStreamUnpublish = @"streamUnpublish";
66
+static NSString *AGTranscodingUpdate = @"transcodingUpdate";
67
+
68
+static NSString *AGStreamInjectedStatus = @"streamInjectedStatus";
69
+
70
+static NSString *AGReceiveStreamMessage = @"receiveStreamMessage";
71
+static NSString *AGOccurStreamMessageError = @"occurStreamMessageError";
72
+
73
+static NSString *AGMediaEngineLoaded = @"mediaEngineLoaded";
74
+static NSString *AGMediaEngineStartCall = @"mediaEngineStartCall";
80
 
75
 
81
 @interface AgoraConst : NSObject
76
 @interface AgoraConst : NSObject
82
 
77
 

+ 137
- 155
ios/RCTAgora/RCTAgora.m View File

151
   
151
   
152
   [AgoraConst share].rtcEngine = self.rtcEngine;
152
   [AgoraConst share].rtcEngine = self.rtcEngine;
153
   
153
   
154
-  //频道模式
154
+  //channel mode
155
   [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
155
   [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
156
-  //启用双流模式
156
+  //enable dual stream
157
   [self.rtcEngine enableDualStreamMode:YES];
157
   [self.rtcEngine enableDualStreamMode:YES];
158
   [self.rtcEngine enableVideo];
158
   [self.rtcEngine enableVideo];
159
   
159
   
170
   [self.rtcEngine setAudioProfile:(AgoraAudioProfile)[options[@"audioProfile"] integerValue]
170
   [self.rtcEngine setAudioProfile:(AgoraAudioProfile)[options[@"audioProfile"] integerValue]
171
                          scenario:(AgoraAudioScenario)[options[@"audioScenario"] integerValue]];
171
                          scenario:(AgoraAudioScenario)[options[@"audioScenario"] integerValue]];
172
   
172
   
173
-  //Agora Native SDK 与 Agora Web SDK 间的互通
173
+  //Enable Agora Native SDK be Interoperable with Agora Web SDK
174
   [self.rtcEngine enableWebSdkInteroperability:YES];
174
   [self.rtcEngine enableWebSdkInteroperability:YES];
175
 }
175
 }
176
 
176
 
219
 }
219
 }
220
 
220
 
221
 // set client role
221
 // set client role
222
-RCT_EXPORT_METHOD(setClientRole:(NSString *) role) {
222
+RCT_EXPORT_METHOD(setClientRole:(NSInteger) role) {
223
   [self.rtcEngine setClientRole:(AgoraClientRole)role];
223
   [self.rtcEngine setClientRole:(AgoraClientRole)role];
224
 }
224
 }
225
 
225
 
234
                   :(RCTPromiseResolveBlock) resolve
234
                   :(RCTPromiseResolveBlock) resolve
235
                   reject:(RCTPromiseRejectBlock) reject) {
235
                   reject:(RCTPromiseRejectBlock) reject) {
236
   int res = [self.rtcEngine leaveChannel:^(AgoraChannelStats * _Nonnull stat) {
236
   int res = [self.rtcEngine leaveChannel:^(AgoraChannelStats * _Nonnull stat) {
237
-    [self sendEvent:DidLeaveChannel params:@{
237
+    [self sendEvent:AGLeaveChannel params:@{
238
                                              @"message": @"leaveChannel",
238
                                              @"message": @"leaveChannel",
239
                                              @"duration": @(stat.duration),
239
                                              @"duration": @(stat.duration),
240
                                              @"txBytes": @(stat.txBytes),
240
                                              @"txBytes": @(stat.txBytes),
396
   [self.rtcEngine muteRemoteAudioStream:uid mute:mute];
396
   [self.rtcEngine muteRemoteAudioStream:uid mute:mute];
397
 }
397
 }
398
 
398
 
399
-//// start recoding service
400
-//RCT_EXPORT_METHOD(startAudioRecording:(NSDictionary*)options){
401
-//  [self.rtcEngine startAudioRecording:options[@"path"] quality:(AgoraAudioRecordingQuality)[options[@"quality"] integerValue]];
402
-//}
403
-//
404
-//// stop recoding service
405
-//RCT_EXPORT_METHOD(stopAudioRecording:(NSString*)recordingKey){
406
-//  [self.rtcEngine stopAudioRecording];
407
-//}
408
-
409
 // adjust recorcding signal volume
399
 // adjust recorcding signal volume
410
 RCT_EXPORT_METHOD(adjustRecordingSignalVolume: (NSInteger) volume){
400
 RCT_EXPORT_METHOD(adjustRecordingSignalVolume: (NSInteger) volume){
411
   [self.rtcEngine adjustRecordingSignalVolume:volume];
401
   [self.rtcEngine adjustRecordingSignalVolume:volume];
692
                                    loopCount:(int)[options[@"loopCount"] integerValue]
682
                                    loopCount:(int)[options[@"loopCount"] integerValue]
693
                                        pitch:[options[@"pitch"] doubleValue]
683
                                        pitch:[options[@"pitch"] doubleValue]
694
                                          pan:[options[@"pan"] doubleValue]
684
                                          pan:[options[@"pan"] doubleValue]
695
-                                        gain:[options[@"gain"] boolValue]
685
+                                        gain:[options[@"gain"] doubleValue]
696
                                      publish:[options[@"publish"] boolValue]];
686
                                      publish:[options[@"publish"] boolValue]];
697
   if (res != 0) {
687
   if (res != 0) {
698
     reject(@"131010", @"playEffect failed", [self makeNSError:@{
688
     reject(@"131010", @"playEffect failed", [self makeNSError:@{
1052
 }
1042
 }
1053
 
1043
 
1054
 // set recording audioframe parameters with samplerate
1044
 // set recording audioframe parameters with samplerate
1055
-RCT_EXPORT_METHOD(setRecordingAudioFrameParametersWithSampleRate:(NSDictionary *) options
1045
+RCT_EXPORT_METHOD(setRecordingAudioFrameParameters:(NSDictionary *) options
1056
                   resolve:(RCTPromiseResolveBlock)resolve
1046
                   resolve:(RCTPromiseResolveBlock)resolve
1057
                   reject:(RCTPromiseRejectBlock)reject) {
1047
                   reject:(RCTPromiseRejectBlock)reject) {
1058
   NSInteger res = [self.rtcEngine setRecordingAudioFrameParametersWithSampleRate:[options[@"sampleRate"] integerValue]
1048
   NSInteger res = [self.rtcEngine setRecordingAudioFrameParametersWithSampleRate:[options[@"sampleRate"] integerValue]
1061
                                                                   samplesPerCall:[options[@"samplesPerCall"] integerValue]
1051
                                                                   samplesPerCall:[options[@"samplesPerCall"] integerValue]
1062
                    ];
1052
                    ];
1063
   if (res != 0) {
1053
   if (res != 0) {
1064
-    reject(@"131023", @"setRecordingAudioFrameParametersWithSampleRate failed", [self makeNSError:@{
1054
+    reject(@"131023", @"setRecordingAudioFrameParameters failed", [self makeNSError:@{
1065
                                                                                                     @"code": @(131023),
1055
                                                                                                     @"code": @(131023),
1066
                                                                                                     @"message":@{
1056
                                                                                                     @"message":@{
1067
                                                                                                         @"success": @(NO),
1057
                                                                                                         @"success": @(NO),
1077
 }
1067
 }
1078
 
1068
 
1079
 // set playback audioframe parameters with samplerate
1069
 // set playback audioframe parameters with samplerate
1080
-RCT_EXPORT_METHOD(setPlaybackAudioFrameParametersWithSampleRate:(NSDictionary *) options
1070
+RCT_EXPORT_METHOD(setPlaybackAudioFrameParameters:(NSDictionary *) options
1081
                   resolve:(RCTPromiseResolveBlock)resolve
1071
                   resolve:(RCTPromiseResolveBlock)resolve
1082
                   reject:(RCTPromiseRejectBlock)reject) {
1072
                   reject:(RCTPromiseRejectBlock)reject) {
1083
   NSInteger res = [self.rtcEngine setPlaybackAudioFrameParametersWithSampleRate:[options[@"sampleRate"] integerValue]
1073
   NSInteger res = [self.rtcEngine setPlaybackAudioFrameParametersWithSampleRate:[options[@"sampleRate"] integerValue]
1086
                                                                  samplesPerCall:[options[@"samplesPerCall"] integerValue]
1076
                                                                  samplesPerCall:[options[@"samplesPerCall"] integerValue]
1087
                    ];
1077
                    ];
1088
   if (res != 0) {
1078
   if (res != 0) {
1089
-    reject(@"131024", @"setPlaybackAudioFrameParametersWithSampleRate failed", [self makeNSError:@{
1079
+    reject(@"131024", @"setPlaybackAudioFrameParameters failed", [self makeNSError:@{
1090
                                                                                                    @"code": @(131024),
1080
                                                                                                    @"code": @(131024),
1091
                                                                                                    @"message":@{
1081
                                                                                                    @"message":@{
1092
                                                                                                        @"success":@(NO),
1082
                                                                                                        @"success":@(NO),
1472
 RCT_EXPORT_METHOD(setCameraExposurePosition
1462
 RCT_EXPORT_METHOD(setCameraExposurePosition
1473
                   :(NSDictionary *)options
1463
                   :(NSDictionary *)options
1474
                   resolve:(RCTPromiseResolveBlock)resolve) {
1464
                   resolve:(RCTPromiseResolveBlock)resolve) {
1475
-  BOOL res = [self.rtcEngine setCameraFocusPositionInPreview:CGPointMake((CGFloat)[options[@"x"] floatValue], (CGFloat)[options[@"y"] floatValue])];
1465
+  BOOL res = [self.rtcEngine setCameraExposurePosition:CGPointMake((CGFloat)[options[@"x"] floatValue], (CGFloat)[options[@"y"] floatValue])];
1476
   resolve(@{
1466
   resolve(@{
1477
             @"success": @(YES),
1467
             @"success": @(YES),
1478
             @"value": @(res)
1468
             @"value": @(res)
1579
 // add publish stream url
1569
 // add publish stream url
1580
 RCT_EXPORT_METHOD(addPublishStreamUrl:(NSDictionary *)options) {
1570
 RCT_EXPORT_METHOD(addPublishStreamUrl:(NSDictionary *)options) {
1581
   [self.rtcEngine addPublishStreamUrl:options[@"url"] transcodingEnabled:[options[@"enable"] boolValue]];
1571
   [self.rtcEngine addPublishStreamUrl:options[@"url"] transcodingEnabled:[options[@"enable"] boolValue]];
1582
-  [self.rtcEngine setLiveTranscoding:AgoraLiveTranscoding.defaultTranscoding];
1583
 }
1572
 }
1584
 
1573
 
1585
 // remove publish stream url
1574
 // remove publish stream url
1660
 
1649
 
1661
 - (NSArray<NSString *> *)supportedEvents {
1650
 - (NSArray<NSString *> *)supportedEvents {
1662
   return @[
1651
   return @[
1663
-           DidOccurWarning,
1664
-           DidOccurError,
1665
-           DidApiCallExecute,
1666
-           DidJoinChannel,
1667
-           DidRejoinChannel,
1668
-           DidLeaveChannel,
1669
-           DidClientRoleChanged,
1670
-           DidJoinedOfUid,
1671
-           DidOfflineOfUid,
1672
-           ConnectionChangedToState,
1673
-           ConnectionDidLost,
1674
-           TokenPrivilegeWillExpire,
1675
-           RequestToken,
1652
+           AGWarning,
1653
+           AGError,
1654
+           AGApiCallExecute,
1655
+           AGJoinChannelSuccess,
1656
+           AGRejoinChannelSuccess,
1657
+           AGLeaveChannel,
1658
+           AGClientRoleChanged,
1659
+           AGUserJoined,
1660
+           AGUserOffline,
1661
+           AGConnectionStateChanged,
1662
+           AGConnectionLost,
1663
+           AGTokenPrivilegeWillExpire,
1664
+           AGRequestToken,
1676
            
1665
            
1677
-           DidMicrophoneEnabled,
1678
-           ReportAudioVolumeIndicationOfSpeakers,
1679
-           ActiveSpeaker,
1680
-           FirstLocalAudioFrame,
1681
-           FirstRemoteAudioFrameOfUid,
1682
-           VideoDidStop,
1683
-           FirstLocalVideoFrameWithSize,
1684
-           FirstRemoteVideoDecodedOfUid,
1685
-           FirstRemoteVideoFrameOfUid,
1686
-           DidAudioMuted,
1687
-           DidVideoMuted,
1688
-           DidVideoEnabled,
1689
-           DidLocalVideoEnabled,
1690
-           VideoSizeChangedOfUid,
1691
-           RemoteVideoStateChangedOfUid,
1692
-           DidLocalPublishFallbackToAudioOnly,
1693
-           DidRemoteSubscribeFallbackToAudioOnly,
1666
+           AGMicrophoneEnabled,
1667
+           AGAudioVolumeIndication,
1668
+           AGActiveSpeaker,
1669
+           AGFirstLocalAudioFrame,
1670
+           AGFirstRemoteAudioFrame,
1671
+           AGVideoStopped,
1672
+           AGFirstLocalVideoFrame,
1673
+           AGFirstRemoteVideoDecoded,
1674
+           AGFirstRemoteVideoFrame,
1675
+           AGUserMuteAudio,
1676
+           AGUserMuteVideo,
1677
+           AGUserEnableVideo,
1678
+           AGUserEnableLocalVideo,
1679
+           AGVideoSizeChanged,
1680
+           AGRemoteVideoStateChanged,
1681
+           AGLocalPublishFallbackToAudioOnly,
1682
+           AGRemoteSubscribeFallbackToAudioOnly,
1694
            
1683
            
1695
-           DeviceTypeStateChanged,
1696
-           DidAudioRouteChanged,
1697
-           CameraDidReady,
1698
-           CameraFocusDidChangedToRect,
1699
-           CameraExposureDidChangedToRect,
1684
+           AGAudioRouteChanged,
1685
+           AGCameraReady,
1686
+           AGCameraFocusAreaChanged,
1687
+           AGCameraExposureAreaChanged,
1700
            
1688
            
1701
-           ReportRtcStats,
1702
-           LastmileQuality,
1703
-           NetworkQuality,
1704
-           LocalVideoStats,
1705
-           RemoteVideoStats,
1706
-           RemoteAudioStats,
1707
-           AudioTransportStatsOfUid,
1708
-           VideoTransportStatsOfUid,
1689
+           AGRtcStats,
1690
+           AGLastmileQuality,
1691
+           AGNetworkQuality,
1692
+           AGLocalVideoStats,
1693
+           AGRemoteVideoStats,
1694
+           AGRemoteAudioStats,
1695
+           AGAudioTransportStatsOfUid,
1696
+           AGVideoTransportStatsOfUid,
1709
            
1697
            
1710
-           LocalAudioMixingDidFinish,
1711
-           RemoteAudioMixingDidStart,
1712
-           RemoteAudioMixingDidFinish,
1713
-           DidAudioEffectFinish,
1698
+           AGLocalAudioMixingFinish,
1699
+           AGRemoteAudioMixingStart,
1700
+           AGRemoteAudioMixingFinish,
1701
+           AGAudioEffectFinish,
1714
            
1702
            
1715
-           StreamPublished,
1716
-           StreamUnpublish,
1717
-           TranscodingUpdated,
1703
+           AGStreamPublished,
1704
+           AGStreamUnpublish,
1705
+           AGTranscodingUpdate,
1718
            
1706
            
1719
-           StreamInjectedStatus,
1707
+           AGStreamInjectedStatus,
1720
            
1708
            
1721
-           ReceiveStreamMessage,
1722
-           DidOccurStreamMessageError,
1709
+           AGReceiveStreamMessage,
1710
+           AGOccurStreamMessageError,
1723
            
1711
            
1724
-           MediaEngineDidLoaded,
1725
-           MediaEngineDidStartCall,
1726
-           
1727
-           ConnectionDidInterrupted,
1728
-           ConnectionDidBanned,
1729
-           AudioQualityOfUid
1712
+           AGMediaEngineLoaded,
1713
+           AGMediaEngineStartCall,
1730
            ];
1714
            ];
1731
 }
1715
 }
1732
 
1716
 
1747
 #pragma mark - <AgoraRtcEngineDelegate>
1731
 #pragma mark - <AgoraRtcEngineDelegate>
1748
 // EVENT CALLBACKS
1732
 // EVENT CALLBACKS
1749
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurWarning:(AgoraWarningCode)warningCode {
1733
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurWarning:(AgoraWarningCode)warningCode {
1750
-  [self sendEvent:DidOccurWarning params:@{@"message": @"AgoraWarning", @"code": @(warningCode)}];
1734
+  [self sendEvent:AGWarning params:@{@"message": @"AgoraWarning", @"code": @(warningCode)}];
1751
 }
1735
 }
1752
 
1736
 
1753
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurError:(AgoraErrorCode)errorCode {
1737
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurError:(AgoraErrorCode)errorCode {
1754
-  [self sendEvent:DidOccurError params:@{@"message": @"AgoraError", @"code": @(errorCode)}];
1738
+  [self sendEvent:AGError params:@{@"message": @"AgoraError", @"code": @(errorCode)}];
1755
 }
1739
 }
1756
 
1740
 
1757
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didApiCallExecute:(NSInteger)error api:(NSString *_Nonnull)api result:(NSString *_Nonnull)result {
1741
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didApiCallExecute:(NSInteger)error api:(NSString *_Nonnull)api result:(NSString *_Nonnull)result {
1758
   if (error != 0) {
1742
   if (error != 0) {
1759
-    [self sendEvent:DidOccurError  params:@{
1743
+    [self sendEvent:AGError  params:@{
1744
+                                            @"api": api,
1745
+                                            @"result": result,
1746
+                                            @"error": @(error)
1747
+                                            }];
1748
+  } else {
1749
+    [self sendEvent:AGApiCallExecute  params:@{
1760
                                             @"api": api,
1750
                                             @"api": api,
1761
                                             @"result": result,
1751
                                             @"result": result,
1762
                                             @"error": @(error)
1752
                                             @"error": @(error)
1765
 }
1755
 }
1766
 
1756
 
1767
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didJoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1757
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didJoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1768
-  [self sendEvent:DidJoinChannel params:@{
1758
+  [self sendEvent:AGJoinChannelSuccess params:@{
1769
                                           @"channel": channel,
1759
                                           @"channel": channel,
1770
                                           @"uid": @(uid),
1760
                                           @"uid": @(uid),
1771
                                           @"elapsed": @(elapsed)
1761
                                           @"elapsed": @(elapsed)
1773
 }
1763
 }
1774
 
1764
 
1775
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1765
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didRejoinChannel:(NSString *_Nonnull)channel withUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1776
-  [self sendEvent:DidRejoinChannel params:@{
1766
+  [self sendEvent:AGRejoinChannelSuccess params:@{
1777
                                             @"channel": channel,
1767
                                             @"channel": channel,
1778
                                             @"uid": @(uid),
1768
                                             @"uid": @(uid),
1779
                                             @"elapsed": @(elapsed)
1769
                                             @"elapsed": @(elapsed)
1781
 }
1771
 }
1782
 
1772
 
1783
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLeaveChannelWithStats:(AgoraChannelStats *_Nonnull)stats {
1773
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLeaveChannelWithStats:(AgoraChannelStats *_Nonnull)stats {
1784
-  [self sendEvent:DidLeaveChannel params:@{
1774
+  [self sendEvent:AGLeaveChannel params:@{
1785
                                            @"stats": @{
1775
                                            @"stats": @{
1786
                                                @"duration": @(stats.duration),
1776
                                                @"duration": @(stats.duration),
1787
                                                @"txBytes": @(stats.txBytes),
1777
                                                @"txBytes": @(stats.txBytes),
1799
 }
1789
 }
1800
 
1790
 
1801
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole {
1791
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didClientRoleChanged:(AgoraClientRole)oldRole newRole:(AgoraClientRole)newRole {
1802
-  [self sendEvent:DidClientRoleChanged params:@{
1792
+  [self sendEvent:AGClientRoleChanged params:@{
1803
                                                 @"oldRole": @(oldRole),
1793
                                                 @"oldRole": @(oldRole),
1804
                                                 @"newRole": @(newRole)
1794
                                                 @"newRole": @(newRole)
1805
                                                 }];
1795
                                                 }];
1806
 }
1796
 }
1807
 
1797
 
1808
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1798
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didJoinedOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1809
-  [self sendEvent:DidJoinedOfUid params:@{
1799
+  [self sendEvent:AGUserJoined params:@{
1810
                                           @"uid": @(uid),
1800
                                           @"uid": @(uid),
1811
                                           @"elapsed": @(elapsed)
1801
                                           @"elapsed": @(elapsed)
1812
                                           }];
1802
                                           }];
1813
 }
1803
 }
1814
 
1804
 
1815
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason {
1805
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOfflineOfUid:(NSUInteger)uid reason:(AgoraUserOfflineReason)reason {
1816
-  [self sendEvent:DidOfflineOfUid params:@{
1806
+  [self sendEvent:AGUserOffline params:@{
1817
                                            @"uid": @(uid),
1807
                                            @"uid": @(uid),
1818
                                            @"reason": @(reason)
1808
                                            @"reason": @(reason)
1819
                                            }];
1809
                                            }];
1820
 }
1810
 }
1821
 
1811
 
1822
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine connectionChangedToState:(AgoraConnectionStateType)state reason:(AgoraConnectionChangedReason)reason {
1812
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine connectionChangedToState:(AgoraConnectionStateType)state reason:(AgoraConnectionChangedReason)reason {
1823
-  [self sendEvent:ConnectionChangedToState params:@{
1813
+  [self sendEvent:AGConnectionStateChanged params:@{
1824
                                                     @"state": @(state),
1814
                                                     @"state": @(state),
1825
                                                     @"reason": @(reason)
1815
                                                     @"reason": @(reason)
1826
                                                     }];
1816
                                                     }];
1827
 }
1817
 }
1828
 
1818
 
1829
 - (void)rtcEngineConnectionDidLost:(AgoraRtcEngineKit *_Nonnull)engine {
1819
 - (void)rtcEngineConnectionDidLost:(AgoraRtcEngineKit *_Nonnull)engine {
1830
-  [self sendEvent:ConnectionDidLost params:@{
1831
-                                             @"message": @"ConnectionDidLost"
1820
+  [self sendEvent:AGConnectionLost params:@{
1821
+                                             @"message": @"connectionLost"
1832
                                              }];
1822
                                              }];
1833
 }
1823
 }
1834
 
1824
 
1835
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine tokenPrivilegeWillExpire:(NSString *_Nonnull)token {
1825
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine tokenPrivilegeWillExpire:(NSString *_Nonnull)token {
1836
-  [self sendEvent:TokenPrivilegeWillExpire params:@{
1826
+  [self sendEvent:AGTokenPrivilegeWillExpire params:@{
1837
                                                     @"token": token
1827
                                                     @"token": token
1838
                                                     }];
1828
                                                     }];
1839
 }
1829
 }
1840
 
1830
 
1841
 - (void)rtcEngineRequestToken:(AgoraRtcEngineKit *_Nonnull)engine {
1831
 - (void)rtcEngineRequestToken:(AgoraRtcEngineKit *_Nonnull)engine {
1842
-  [self sendEvent:RequestToken params:@{
1832
+  [self sendEvent:AGRequestToken params:@{
1843
                                         @"message": @"RequestToken"
1833
                                         @"message": @"RequestToken"
1844
                                         }];
1834
                                         }];
1845
 }
1835
 }
1846
 
1836
 
1847
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didMicrophoneEnabled:(BOOL)enabled {
1837
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didMicrophoneEnabled:(BOOL)enabled {
1848
-  [self sendEvent:DidMicrophoneEnabled params:@{
1838
+  [self sendEvent:AGMicrophoneEnabled params:@{
1849
                                                 @"enabled": @(enabled)
1839
                                                 @"enabled": @(enabled)
1850
                                                 }];
1840
                                                 }];
1851
 }
1841
 }
1858
                         @"volume": @(speaker.volume)
1848
                         @"volume": @(speaker.volume)
1859
                         }];
1849
                         }];
1860
   }
1850
   }
1861
-  [self sendEvent:ReportAudioVolumeIndicationOfSpeakers params:@{
1851
+  [self sendEvent:AGAudioVolumeIndication params:@{
1862
                                                                  @"speakers": result,
1852
                                                                  @"speakers": result,
1863
                                                                  @"totalVolume": @(totalVolume)
1853
                                                                  @"totalVolume": @(totalVolume)
1864
                                                                  }];
1854
                                                                  }];
1865
 }
1855
 }
1866
 
1856
 
1867
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine activeSpeaker:(NSUInteger)speakerUid {
1857
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine activeSpeaker:(NSUInteger)speakerUid {
1868
-  [self sendEvent:ActiveSpeaker params:@{
1869
-                                         @"speakerUid": @(speakerUid)
1858
+  [self sendEvent:AGActiveSpeaker params:@{
1859
+                                         @"uid": @(speakerUid)
1870
                                          }];
1860
                                          }];
1871
 }
1861
 }
1872
 
1862
 
1873
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstLocalAudioFrame:(NSInteger)elapsed {
1863
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstLocalAudioFrame:(NSInteger)elapsed {
1874
-  [self sendEvent:FirstLocalAudioFrame params:@{
1864
+  [self sendEvent:AGFirstLocalAudioFrame params:@{
1875
                                                 @"elapsed": @(elapsed)
1865
                                                 @"elapsed": @(elapsed)
1876
                                                 }];
1866
                                                 }];
1877
 }
1867
 }
1878
 
1868
 
1879
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteAudioFrameOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1869
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteAudioFrameOfUid:(NSUInteger)uid elapsed:(NSInteger)elapsed {
1880
-  [self sendEvent:FirstRemoteAudioFrameOfUid params:@{
1870
+  [self sendEvent:AGFirstRemoteAudioFrame params:@{
1881
                                                       @"uid": @(uid),
1871
                                                       @"uid": @(uid),
1882
                                                       @"elapsed": @(elapsed)
1872
                                                       @"elapsed": @(elapsed)
1883
                                                       }];
1873
                                                       }];
1884
 }
1874
 }
1885
 
1875
 
1886
 - (void)rtcEngineVideoDidStop:(AgoraRtcEngineKit *_Nonnull)engine {
1876
 - (void)rtcEngineVideoDidStop:(AgoraRtcEngineKit *_Nonnull)engine {
1887
-  [self sendEvent:VideoDidStop params:@{
1877
+  [self sendEvent:AGVideoStopped params:@{
1888
                                         @"message": @"VideoStopped"
1878
                                         @"message": @"VideoStopped"
1889
                                         }];
1879
                                         }];
1890
 }
1880
 }
1891
 
1881
 
1892
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstLocalVideoFrameWithSize:(CGSize)size elapsed:(NSInteger)elapsed {
1882
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstLocalVideoFrameWithSize:(CGSize)size elapsed:(NSInteger)elapsed {
1893
-  [self sendEvent:FirstLocalVideoFrameWithSize params:@{
1894
-                                                        @"size": @(size),
1883
+  [self sendEvent:AGFirstLocalVideoFrame params:@{
1884
+                                                        @"width": @(size.width),
1885
+                                                        @"height": @(size.height),
1895
                                                         @"elapsed": @(elapsed)
1886
                                                         @"elapsed": @(elapsed)
1896
                                                         }];
1887
                                                         }];
1897
 }
1888
 }
1898
 
1889
 
1899
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteVideoDecodedOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed {
1890
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteVideoDecodedOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed {
1900
-  [self sendEvent:FirstRemoteVideoDecodedOfUid params:@{
1891
+  [self sendEvent:AGFirstRemoteVideoDecoded params:@{
1901
                                                         @"uid": @(uid),
1892
                                                         @"uid": @(uid),
1902
-                                                        @"size": @(size),
1893
+                                                        @"width": @(size.width),
1894
+                                                        @"height": @(size.height),
1903
                                                         @"elapsed": @(elapsed)
1895
                                                         @"elapsed": @(elapsed)
1904
                                                         }];
1896
                                                         }];
1905
 }
1897
 }
1906
 
1898
 
1907
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteVideoFrameOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed {
1899
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine firstRemoteVideoFrameOfUid:(NSUInteger)uid size:(CGSize)size elapsed:(NSInteger)elapsed {
1908
-  [self sendEvent:FirstRemoteVideoFrameOfUid params:@{
1900
+  [self sendEvent:AGFirstRemoteVideoFrame params:@{
1909
                                                       @"uid": @(uid),
1901
                                                       @"uid": @(uid),
1910
-                                                      @"size": @(size),
1902
+                                                      @"width": @(size.width),
1903
+                                                      @"height": @(size.height),
1911
                                                       @"elapsed": @(elapsed)}];
1904
                                                       @"elapsed": @(elapsed)}];
1912
 }
1905
 }
1913
 
1906
 
1914
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didAudioMuted:(BOOL)muted byUid:(NSUInteger)uid {
1907
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didAudioMuted:(BOOL)muted byUid:(NSUInteger)uid {
1915
-  [self sendEvent:DidAudioMuted params:@{
1908
+  [self sendEvent:AGUserMuteAudio params:@{
1916
                                          @"muted": @(muted),
1909
                                          @"muted": @(muted),
1917
                                          @"uid": @(uid)
1910
                                          @"uid": @(uid)
1918
                                          }];
1911
                                          }];
1919
 }
1912
 }
1920
 
1913
 
1921
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didVideoMuted:(BOOL)muted byUid:(NSUInteger)uid {
1914
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didVideoMuted:(BOOL)muted byUid:(NSUInteger)uid {
1922
-  [self sendEvent:DidVideoMuted params:@{
1915
+  [self sendEvent:AGUserMuteVideo params:@{
1923
                                          @"muted": @(muted),
1916
                                          @"muted": @(muted),
1924
                                          @"uid": @(uid)
1917
                                          @"uid": @(uid)
1925
                                          }];
1918
                                          }];
1926
 }
1919
 }
1927
 
1920
 
1928
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid {
1921
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid {
1929
-  [self sendEvent:DidVideoEnabled params:@{
1922
+  [self sendEvent:AGUserEnableVideo params:@{
1930
                                            @"enabled": @(enabled),
1923
                                            @"enabled": @(enabled),
1931
                                            @"uid": @(uid)
1924
                                            @"uid": @(uid)
1932
                                            }];
1925
                                            }];
1933
 }
1926
 }
1934
 
1927
 
1935
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid {
1928
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLocalVideoEnabled:(BOOL)enabled byUid:(NSUInteger)uid {
1936
-  [self sendEvent:DidLocalVideoEnabled params:@{
1929
+  [self sendEvent:AGUserEnableLocalVideo params:@{
1937
                                                 @"enabled": @(enabled),
1930
                                                 @"enabled": @(enabled),
1938
                                                 @"uid": @(uid)
1931
                                                 @"uid": @(uid)
1939
                                                 }];
1932
                                                 }];
1940
 }
1933
 }
1941
 
1934
 
1942
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation {
1935
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine videoSizeChangedOfUid:(NSUInteger)uid size:(CGSize)size rotation:(NSInteger)rotation {
1943
-  [self sendEvent:VideoSizeChangedOfUid params:@{
1936
+  [self sendEvent:AGVideoSizeChanged params:@{
1944
                                                  @"uid": @(uid),
1937
                                                  @"uid": @(uid),
1945
-                                                 @"size": @{
1946
-                                                     @"width": @(size.width),
1947
-                                                     @"height": @(size.height)
1948
-                                                     },
1938
+                                                 @"width": @(size.width),
1939
+                                                 @"height": @(size.height),
1949
                                                  @"roration": @(rotation)
1940
                                                  @"roration": @(rotation)
1950
                                                  }];
1941
                                                  }];
1951
 }
1942
 }
1952
 
1943
 
1953
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state {
1944
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteVideoStateChangedOfUid:(NSUInteger)uid state:(AgoraVideoRemoteState)state {
1954
-  [self sendEvent:RemoteVideoStateChangedOfUid params:@{
1945
+  [self sendEvent:AGRemoteVideoStateChanged params:@{
1955
                                                         @"uid": @(uid),
1946
                                                         @"uid": @(uid),
1956
                                                         @"state": @(state)
1947
                                                         @"state": @(state)
1957
                                                         }];
1948
                                                         }];
1958
 }
1949
 }
1959
 
1950
 
1960
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLocalPublishFallbackToAudioOnly:(BOOL)isFallbackOrRecover {
1951
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didLocalPublishFallbackToAudioOnly:(BOOL)isFallbackOrRecover {
1961
-  [self sendEvent:DidLocalPublishFallbackToAudioOnly params:@{
1952
+  [self sendEvent:AGLocalPublishFallbackToAudioOnly params:@{
1962
                                                               @"isFallbackOrRecover": @(isFallbackOrRecover)
1953
                                                               @"isFallbackOrRecover": @(isFallbackOrRecover)
1963
                                                               }];
1954
                                                               }];
1964
 }
1955
 }
1965
 
1956
 
1966
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didRemoteSubscribeFallbackToAudioOnly:(BOOL)isFallbackOrRecover byUid:(NSUInteger)uid {
1957
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didRemoteSubscribeFallbackToAudioOnly:(BOOL)isFallbackOrRecover byUid:(NSUInteger)uid {
1967
-  [self sendEvent:DidRemoteSubscribeFallbackToAudioOnly params:@{
1958
+  [self sendEvent:AGRemoteSubscribeFallbackToAudioOnly params:@{
1968
                                                                  @"isFallbackOrRecover": @(isFallbackOrRecover),
1959
                                                                  @"isFallbackOrRecover": @(isFallbackOrRecover),
1969
                                                                  @"uid": @(uid)
1960
                                                                  @"uid": @(uid)
1970
                                                                  }];
1961
                                                                  }];
1971
 }
1962
 }
1972
 
1963
 
1973
-- (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine device:(NSString *_Nonnull)deviceId type:(AgoraMediaDeviceType)deviceType stateChanged:(NSInteger)state {
1974
-  [self sendEvent:DeviceTypeStateChanged params:@{
1975
-                                                  @"deviceId": deviceId,
1976
-                                                  @"deviceType": @(deviceType),
1977
-                                                  @"state": @(state)
1978
-                                                  }];
1979
-}
1980
-
1981
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didAudioRouteChanged:(AgoraAudioOutputRouting)routing {
1964
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didAudioRouteChanged:(AgoraAudioOutputRouting)routing {
1982
-  [self sendEvent:DidAudioRouteChanged params:@{
1965
+  [self sendEvent:AGAudioRouteChanged params:@{
1983
                                                 @"routing": @(routing)
1966
                                                 @"routing": @(routing)
1984
                                                 }];
1967
                                                 }];
1985
 }
1968
 }
1986
 
1969
 
1987
 - (void)rtcEngineCameraDidReady:(AgoraRtcEngineKit *_Nonnull)engine {
1970
 - (void)rtcEngineCameraDidReady:(AgoraRtcEngineKit *_Nonnull)engine {
1988
-  [self sendEvent:CameraDidReady params:@{
1971
+  [self sendEvent:AGCameraReady params:@{
1989
                                           @"message": @"CameraDidReady"
1972
                                           @"message": @"CameraDidReady"
1990
                                           }];
1973
                                           }];
1991
 }
1974
 }
1992
 
1975
 
1993
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine cameraFocusDidChangedToRect:(CGRect)rect {
1976
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine cameraFocusDidChangedToRect:(CGRect)rect {
1994
-  [self sendEvent:CameraFocusDidChangedToRect params:@{
1977
+  [self sendEvent:AGCameraFocusAreaChanged params:@{
1995
                                                        @"rect": @(rect)
1978
                                                        @"rect": @(rect)
1996
                                                        }];
1979
                                                        }];
1997
 }
1980
 }
1998
 
1981
 
1999
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine cameraExposureDidChangedToRect:(CGRect)rect {
1982
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine cameraExposureDidChangedToRect:(CGRect)rect {
2000
-  [self sendEvent:CameraExposureDidChangedToRect params:@{
1983
+  [self sendEvent:AGCameraExposureAreaChanged params:@{
2001
                                                           @"rect": @(rect)
1984
                                                           @"rect": @(rect)
2002
                                                           }];
1985
                                                           }];
2003
 }
1986
 }
2004
 
1987
 
2005
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteAudioStats:(AgoraRtcRemoteAudioStats *_Nonnull)stats {
1988
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteAudioStats:(AgoraRtcRemoteAudioStats *_Nonnull)stats {
2006
-  [self sendEvent:RemoteAudioStats params:@{
1989
+  [self sendEvent:AGRemoteAudioStats params:@{
2007
                                             @"stats": @{
1990
                                             @"stats": @{
2008
                                                 @"uid": @(stats.uid),
1991
                                                 @"uid": @(stats.uid),
2009
                                                 @"quality": @(stats.quality),
1992
                                                 @"quality": @(stats.quality),
2015
 }
1998
 }
2016
 
1999
 
2017
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine reportRtcStats:(AgoraChannelStats *_Nonnull)stats {
2000
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine reportRtcStats:(AgoraChannelStats *_Nonnull)stats {
2018
-  [self sendEvent:ReportRtcStats params:@{
2001
+  [self sendEvent:AGRtcStats params:@{
2019
                                           @"stats": @{
2002
                                           @"stats": @{
2020
                                               @"duration": @(stats.duration),
2003
                                               @"duration": @(stats.duration),
2021
                                               @"txBytes": @(stats.txBytes),
2004
                                               @"txBytes": @(stats.txBytes),
2033
 }
2016
 }
2034
 
2017
 
2035
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine lastmileQuality:(AgoraNetworkQuality)quality {
2018
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine lastmileQuality:(AgoraNetworkQuality)quality {
2036
-  [self sendEvent:LastmileQuality params:@{
2019
+  [self sendEvent:AGLastmileQuality params:@{
2037
                                            @"quality": @(quality)
2020
                                            @"quality": @(quality)
2038
                                            }];
2021
                                            }];
2039
 }
2022
 }
2040
 
2023
 
2041
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality {
2024
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine networkQuality:(NSUInteger)uid txQuality:(AgoraNetworkQuality)txQuality rxQuality:(AgoraNetworkQuality)rxQuality {
2042
-  [self sendEvent:NetworkQuality params:@{
2025
+  [self sendEvent:AGNetworkQuality params:@{
2043
                                           @"uid": @(uid),
2026
                                           @"uid": @(uid),
2044
                                           @"txQuality": @(txQuality),
2027
                                           @"txQuality": @(txQuality),
2045
                                           @"rxQuality": @(rxQuality)
2028
                                           @"rxQuality": @(rxQuality)
2047
 }
2030
 }
2048
 
2031
 
2049
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine localVideoStats:(AgoraRtcLocalVideoStats *_Nonnull)stats {
2032
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine localVideoStats:(AgoraRtcLocalVideoStats *_Nonnull)stats {
2050
-  [self sendEvent:LocalVideoStats params:@{
2033
+  [self sendEvent:AGLocalVideoStats params:@{
2051
                                            @"stats": @{
2034
                                            @"stats": @{
2052
                                                @"sentBitrate": @(stats.sentBitrate),
2035
                                                @"sentBitrate": @(stats.sentBitrate),
2053
                                                @"sentFrameRate": @(stats.sentFrameRate)
2036
                                                @"sentFrameRate": @(stats.sentFrameRate)
2056
 }
2039
 }
2057
 
2040
 
2058
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteVideoStats:(AgoraRtcRemoteVideoStats *_Nonnull)stats {
2041
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine remoteVideoStats:(AgoraRtcRemoteVideoStats *_Nonnull)stats {
2059
-  [self sendEvent:RemoteVideoStats params:@{
2042
+  [self sendEvent:AGRemoteVideoStats params:@{
2060
                                             @"stats": @{
2043
                                             @"stats": @{
2061
                                                 @"uid": @(stats.uid),
2044
                                                 @"uid": @(stats.uid),
2062
-                                                @"delay": @(stats.delay),
2063
                                                 @"width": @(stats.width),
2045
                                                 @"width": @(stats.width),
2064
                                                 @"height": @(stats.height),
2046
                                                 @"height": @(stats.height),
2065
                                                 @"receivedBitrate": @(stats.receivedBitrate),
2047
                                                 @"receivedBitrate": @(stats.receivedBitrate),
2070
 }
2052
 }
2071
 
2053
 
2072
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine audioTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate {
2054
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine audioTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate {
2073
-  [self sendEvent:AudioTransportStatsOfUid params:@{
2055
+  [self sendEvent:AGAudioTransportStatsOfUid params:@{
2074
                                                     @"uid": @(uid),
2056
                                                     @"uid": @(uid),
2075
                                                     @"delay": @(delay),
2057
                                                     @"delay": @(delay),
2076
                                                     @"lost": @(lost),
2058
                                                     @"lost": @(lost),
2079
 }
2061
 }
2080
 
2062
 
2081
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine videoTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate {
2063
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine videoTransportStatsOfUid:(NSUInteger)uid delay:(NSUInteger)delay lost:(NSUInteger)lost rxKBitRate:(NSUInteger)rxKBitRate {
2082
-  [self sendEvent:VideoTransportStatsOfUid params:@{
2064
+  [self sendEvent:AGVideoTransportStatsOfUid params:@{
2083
                                                     @"uid": @(uid),
2065
                                                     @"uid": @(uid),
2084
                                                     @"delay": @(delay),
2066
                                                     @"delay": @(delay),
2085
                                                     @"lost": @(lost),
2067
                                                     @"lost": @(lost),
2088
 }
2070
 }
2089
 
2071
 
2090
 - (void)rtcEngineLocalAudioMixingDidFinish:(AgoraRtcEngineKit *_Nonnull)engine {
2072
 - (void)rtcEngineLocalAudioMixingDidFinish:(AgoraRtcEngineKit *_Nonnull)engine {
2091
-  [self sendEvent:LocalAudioMixingDidFinish params:@{
2073
+  [self sendEvent:AGLocalAudioMixingFinish params:@{
2092
                                                      @"message": @"LocalAudioMixingSucceedFinish"
2074
                                                      @"message": @"LocalAudioMixingSucceedFinish"
2093
                                                      }];
2075
                                                      }];
2094
 }
2076
 }
2095
 
2077
 
2096
 - (void)rtcEngineRemoteAudioMixingDidStart:(AgoraRtcEngineKit *_Nonnull)engine {
2078
 - (void)rtcEngineRemoteAudioMixingDidStart:(AgoraRtcEngineKit *_Nonnull)engine {
2097
-  [self sendEvent:RemoteAudioMixingDidStart params:@{
2079
+  [self sendEvent:AGRemoteAudioMixingStart params:@{
2098
                                                      @"message": @"RemoteAudioMixingStarted"
2080
                                                      @"message": @"RemoteAudioMixingStarted"
2099
                                                      }];
2081
                                                      }];
2100
 }
2082
 }
2101
 
2083
 
2102
 - (void)rtcEngineRemoteAudioMixingDidFinish:(AgoraRtcEngineKit *_Nonnull)engine {
2084
 - (void)rtcEngineRemoteAudioMixingDidFinish:(AgoraRtcEngineKit *_Nonnull)engine {
2103
-  [self sendEvent:RemoteAudioMixingDidFinish params:@{
2085
+  [self sendEvent:AGRemoteAudioMixingFinish params:@{
2104
                                                       @"message": @"RemoteAudioMixingFinish"
2086
                                                       @"message": @"RemoteAudioMixingFinish"
2105
                                                       }];
2087
                                                       }];
2106
 }
2088
 }
2107
 
2089
 
2108
 - (void)rtcEngineDidAudioEffectFinish:(AgoraRtcEngineKit *_Nonnull)engine soundId:(NSInteger)soundId {
2090
 - (void)rtcEngineDidAudioEffectFinish:(AgoraRtcEngineKit *_Nonnull)engine soundId:(NSInteger)soundId {
2109
-  [self sendEvent:DidAudioEffectFinish params:@{
2091
+  [self sendEvent:AGAudioEffectFinish params:@{
2110
                                                 @"soundId": @(soundId)
2092
                                                 @"soundId": @(soundId)
2111
                                                 }];
2093
                                                 }];
2112
 }
2094
 }
2113
 
2095
 
2114
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamPublishedWithUrl:(NSString *_Nonnull)url errorCode:(AgoraErrorCode)errorCode {
2096
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamPublishedWithUrl:(NSString *_Nonnull)url errorCode:(AgoraErrorCode)errorCode {
2115
-  [self sendEvent:StreamPublished params:@{
2097
+  [self sendEvent:AGStreamPublished params:@{
2116
                                            @"url": url,
2098
                                            @"url": url,
2117
                                            @"code": @(errorCode)
2099
                                            @"code": @(errorCode)
2118
                                            }];
2100
                                            }];
2119
 }
2101
 }
2120
 
2102
 
2121
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamUnpublishedWithUrl:(NSString *_Nonnull)url {
2103
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamUnpublishedWithUrl:(NSString *_Nonnull)url {
2122
-  [self sendEvent:StreamUnpublish params:@{
2104
+  [self sendEvent:AGStreamUnpublish params:@{
2123
                                            @"url": url,
2105
                                            @"url": url,
2124
                                            }];
2106
                                            }];
2125
 }
2107
 }
2126
 
2108
 
2127
 - (void)rtcEngineTranscodingUpdated:(AgoraRtcEngineKit *_Nonnull)engine {
2109
 - (void)rtcEngineTranscodingUpdated:(AgoraRtcEngineKit *_Nonnull)engine {
2128
-  [self sendEvent:TranscodingUpdated params:@{
2129
-                                              @"message": @"TranscodingUpdated"
2110
+  [self sendEvent:AGTranscodingUpdate params:@{
2111
+                                              @"message": @"AGTranscodingUpdate"
2130
                                               }];
2112
                                               }];
2131
 }
2113
 }
2132
 
2114
 
2133
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status {
2115
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine streamInjectedStatusOfUrl:(NSString *_Nonnull)url uid:(NSUInteger)uid status:(AgoraInjectStreamStatus)status {
2134
-  [self sendEvent:StreamInjectedStatus params:@{
2116
+  [self sendEvent:AGStreamInjectedStatus params:@{
2135
                                                 @"uid": @(uid),
2117
                                                 @"uid": @(uid),
2136
                                                 @"url": url,
2118
                                                 @"url": url,
2137
                                                 @"status": @(status)
2119
                                                 @"status": @(status)
2139
 }
2121
 }
2140
 
2122
 
2141
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData *_Nonnull)data {
2123
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine receiveStreamMessageFromUid:(NSUInteger)uid streamId:(NSInteger)streamId data:(NSData *_Nonnull)data {
2142
-  [self sendEvent:ReceiveStreamMessage params:@{
2124
+  [self sendEvent:AGReceiveStreamMessage params:@{
2143
                                                 @"uid": @(uid),
2125
                                                 @"uid": @(uid),
2144
                                                 @"streamId": @(streamId),
2126
                                                 @"streamId": @(streamId),
2145
                                                 @"data": data
2127
                                                 @"data": data
2147
 }
2129
 }
2148
 
2130
 
2149
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached {
2131
 - (void)rtcEngine:(AgoraRtcEngineKit *_Nonnull)engine didOccurStreamMessageErrorFromUid:(NSUInteger)uid streamId:(NSInteger)streamId error:(NSInteger)error missed:(NSInteger)missed cached:(NSInteger)cached {
2150
-  [self sendEvent:DidOccurStreamMessageError params:@{
2132
+  [self sendEvent:AGOccurStreamMessageError params:@{
2151
                                                       @"uid": @(uid),
2133
                                                       @"uid": @(uid),
2152
                                                       @"streamId": @(streamId),
2134
                                                       @"streamId": @(streamId),
2153
                                                       @"error": @(error),
2135
                                                       @"error": @(error),
2157
 }
2139
 }
2158
 
2140
 
2159
 - (void)rtcEngineMediaEngineDidLoaded:(AgoraRtcEngineKit *_Nonnull)engine {
2141
 - (void)rtcEngineMediaEngineDidLoaded:(AgoraRtcEngineKit *_Nonnull)engine {
2160
-  [self sendEvent:MediaEngineDidLoaded params:@{
2142
+  [self sendEvent:AGMediaEngineLoaded params:@{
2161
                                                 @"message": @"MediaEngineLoaded"
2143
                                                 @"message": @"MediaEngineLoaded"
2162
                                                 }];
2144
                                                 }];
2163
 }
2145
 }
2164
 
2146
 
2165
 - (void)rtcEngineMediaEngineDidStartCall:(AgoraRtcEngineKit *_Nonnull)engine {
2147
 - (void)rtcEngineMediaEngineDidStartCall:(AgoraRtcEngineKit *_Nonnull)engine {
2166
-  [self sendEvent:MediaEngineDidStartCall params:@{
2167
-                                                   @"message": @"MediaEngineDidStartCall"
2148
+  [self sendEvent:AGMediaEngineStartCall params:@{
2149
+                                                   @"message": @"AGMediaEngineStartCall"
2168
                                                    }];
2150
                                                    }];
2169
 }
2151
 }
2170
 
2152
 

+ 31
- 283
lib/RtcEngine.native.js View File

6
 /**
6
 /**
7
  * @class RtcEngine
7
  * @class RtcEngine
8
  */
8
  */
9
-class RtcEngine {
9
+const RtcEngine = Object.assign({}, Agora, { eventTypes: new Set(), 
10
     /**
10
     /**
11
-     * init AgoraRtcEngine
11
+     * init agora rtc engine and begin subscribe event immediately
12
      * @param options: Option
12
      * @param options: Option
13
      */
13
      */
14
-    static init(options) {
15
-        this.removeEmitter();
14
+    init(options) {
16
         Agora.init(options);
15
         Agora.init(options);
17
-        this.listeners = [];
18
-    }
16
+    },
19
     /**
17
     /**
20
      * join channel
18
      * join channel
21
      * @param channelName String for channel name
19
      * @param channelName String for channel name
24
      * @param info Object extra info
22
      * @param info Object extra info
25
      * @return Promise
23
      * @return Promise
26
      */
24
      */
27
-    static joinChannel(channelName, uid, token, info) {
25
+    joinChannel(channelName, uid, token, info) {
28
         return Agora.joinChannel({ channelName, uid, token, info });
26
         return Agora.joinChannel({ channelName, uid, token, info });
29
-    }
27
+    },
30
     /**
28
     /**
31
-     * RtcEngine events register
32
-     * @param eventScheduler EventScheduler
29
+     * on - add event listener for react native event
30
+     * @param eventType String
31
+     * @param eventHandler Function
33
      */
32
      */
34
-    static eventEmitter(eventScheduler) {
35
-        this.removeEmitter();
36
-        // const events = EventSchedulerKeys;
37
-        const events = [
38
-            "onWarning",
39
-            "onError",
40
-            "onJoinChannelSuccess",
41
-            "onRejoinChannelSuccess",
42
-            "onLeaveChannel",
43
-            "onClientRoleChanged",
44
-            "onUserJoined",
45
-            "onUserOffline",
46
-            "onConnectionStateChanged",
47
-            "onConnectionInterrupted",
48
-            "onConnectionLost",
49
-            "onConnectionBanned",
50
-            "onApiCallExecuted",
51
-            "onTokenPrivilegeWillExpire",
52
-            "onRequestToken",
53
-            "onMicrophoneEnabled",
54
-            "onAudioVolumeIndication",
55
-            "onActiveSpeaker",
56
-            "onFirstLocalAudioFrame",
57
-            "onFirstRemoteAudioFrame",
58
-            "onVideoStopped",
59
-            "onFirstLocalVideoFrame",
60
-            "onFirstRemoteVideoDecoded",
61
-            "onFirstRemoteVideoFrame",
62
-            "onUserMuteAudio",
63
-            "onUserMuteVideo",
64
-            "onUserEnableVideo",
65
-            "onUserEnableLocalVideo",
66
-            "onVideoSizeChanged",
67
-            "onRemoteVideoStateChanged",
68
-            "onLocalPublishFallbackToAudioOnly",
69
-            "onRemoteSubscribeFallbackToAudioOnly",
70
-            "onAudioRouteChanged",
71
-            "onCameraReady",
72
-            "onCameraFocusAreaChanged",
73
-            "onCameraExposureAreaChanged",
74
-            "onAudioQuality",
75
-            "onRtcStats",
76
-            "onLastmileQuality",
77
-            "onNetworkQuality",
78
-            "onLocalVideoStats",
79
-            "onRemoteVideoStats",
80
-            "onRemoteAudioStats",
81
-            "onLocalVideoStat",
82
-            "onRemoteVideoStat",
83
-            "onRemoteAudioTransportStats",
84
-            "onRemoteVideoTransportStats",
85
-            "onAudioMixingFinished",
86
-            "onAudioEffectFinished",
87
-            "onStreamPublished",
88
-            "onStreamUnpublished",
89
-            "onTranscodingUpdated",
90
-            "onStreamInjectedStatus",
91
-            "onStreamMessage",
92
-            "onStreamMessageError",
93
-            "onMediaEngineLoadSuccess",
94
-            "onMediaEngineStartCallSuccess",
95
-        ];
96
-        for (let event of events) {
97
-            const functor = eventScheduler[event];
98
-            if (functor) {
99
-                this.listeners.push(AgoraEventEmitter.addListener(event, msg => {
100
-                    functor(msg);
101
-                }));
102
-            }
103
-        }
104
-    }
105
-    /**
106
-     * remove emitter
107
-     */
108
-    static removeEmitter() {
109
-        if (this.listeners && this.listeners.length > 0) {
110
-            for (let listener of this.listeners) {
111
-                listener.remove();
112
-                this.listeners = [];
113
-            }
114
-        }
115
-    }
33
+    on(eventType, listener) {
34
+        this.eventTypes.add(eventType);
35
+        AgoraEventEmitter.addListener(eventType, listener);
36
+    },
116
     /**
37
     /**
117
-     * enableLastmileTest
118
-     * @return Promise
38
+     * off - remove event listener for react native event
39
+     * @param eventType
40
+     * @param listener
119
      */
41
      */
120
-    static enableLastmileTest() {
121
-        return Agora.enableLastmileTest();
122
-    }
42
+    off(eventType) {
43
+        AgoraEventEmitter.removeAllListeners(eventType);
44
+        this.eventTypes.delete(eventType);
45
+    },
123
     /**
46
     /**
124
-     * disableLastmileTest
125
-     * @return Promise
47
+     * removeAllListeners
126
      */
48
      */
127
-    static disableLastmileTest() {
128
-        return Agora.disableLastmileTest();
129
-    }
130
-    /**
131
-     * leaveChannel
132
-     * @return Promise
133
-     */
134
-    static leaveChannel() {
135
-        return Agora.leaveChannel();
136
-    }
49
+    removeAllListeners() {
50
+        for (let eventType of this.eventTypes) {
51
+            this.off(eventType);
52
+        }
53
+        this.eventTypes.clear();
54
+    },
137
     /**
55
     /**
138
      * destroy AgoraRtcEngine
56
      * destroy AgoraRtcEngine
139
      */
57
      */
140
-    static destroy() {
58
+    destroy() {
141
         Agora.destroy();
59
         Agora.destroy();
142
-    }
143
-    /**
144
-     * setupLocalVideo
145
-     * @param options: VideoOption
146
-     */
147
-    static setupLocalVideo(options) {
148
-        Agora.setupLocalVideo(options);
149
-    }
150
-    /**
151
-     * setupRemoteVideo
152
-     * @param options: VideoOption
153
-     */
154
-    static setupRemoteVideo(options) {
155
-        Agora.setupRemoteVideo(options);
156
-    }
157
-    /**
158
-     * start AgoraRtcEngine preview
159
-     */
160
-    static startPreview() {
161
-        Agora.startPreview();
162
-    }
163
-    /**
164
-     * stop AgoraRtcEngine preview
165
-     */
166
-    static stopPreview() {
167
-        Agora.stopPreview();
168
-    }
169
-    /**
170
-     * start live trancoding
171
-     * @param options LiveTranscoding
172
-     */
173
-    static setLiveTranscoding(options) {
174
-        Agora.setLiveTranscoding(options);
175
-    }
176
-    /**
177
-     * setLocalRenderMode
178
-     * @param mode Number
179
-     */
180
-    static setLocalRenderMode(mode) {
181
-        Agora.setLocalRenderMode(mode);
182
-    }
183
-    /**
184
-     * setRemoteRenderMode
185
-     * @param uid Number
186
-     * @param mode Number
187
-     */
188
-    static setRemoteRenderMode(uid, mode) {
189
-        Agora.setRemoteRenderMode(uid, mode);
190
-    }
191
-    /**
192
-     * enableAudioVolumeIndication
193
-     * @param interval Number
194
-     * @param smooth Number
195
-     */
196
-    static enableAudioVolumeIndication(interval, smooth) {
197
-        Agora.enableAudioVolumeIndication(interval, smooth);
198
-    }
199
-    /**
200
-     * switch camera
201
-     * @return Promise
202
-     */
203
-    static switchCamera() {
204
-        return Agora.switchCamera();
205
-    }
206
-    static enableVideo() {
207
-        Agora.enableVideo();
208
-    }
209
-    static disableVideo() {
210
-        Agora.disableVideo();
211
-    }
212
-    /**
213
-     * setEnableSpeakerphone
214
-     * @param status Boolena
215
-     */
216
-    static setEnableSpeakerphone(status) {
217
-        Agora.setEnableSpeakerphone(status);
218
-    }
219
-    /**
220
-     * muteLocalAudioStream
221
-     * @param status Boolena
222
-     */
223
-    static muteLocalAudioStream(status) {
224
-        Agora.muteLocalAudioStream(status);
225
-    }
226
-    /**
227
-     * muteRemoteAudioStream
228
-     * @param uid Number
229
-     * @param status Boolean
230
-     */
231
-    static muteRemoteAudioStream(uid, status) {
232
-        Agora.muteRemoteAudioStream(uid, status);
233
-    }
234
-    /**
235
-     * muteAllRemoteAudioStreams
236
-     * @param status Boolean
237
-     */
238
-    static muteAllRemoteAudioStreams(status) {
239
-        Agora.muteAllRemoteAudioStreams(status);
240
-    }
241
-    /**
242
-     * setCameraTorchOn
243
-     * @param status Boolean
244
-     * @return Promise
245
-     */
246
-    static setCameraTorchOn(status) {
247
-        return Agora.setCameraTorchOn(status);
248
-    }
249
-    /**
250
-     * setCameraAutoFocusFaceModeEnabled
251
-     * @param status Boolean
252
-     * @return Promise
253
-     */
254
-    static setCameraAutoFocusFaceModeEnabled(status) {
255
-        return Agora.setCameraAutoFocusFaceModeEnabled(status);
256
-    }
257
-    /**
258
-     * setDefaultAudioRouteToSpeakerphone
259
-     * @param status Boolean
260
-     * @return Promise
261
-     */
262
-    static setDefaultAudioRouteToSpeakerphone(status) {
263
-        Agora.setDefaultAudioRouteToSpeakerphone(status);
264
-    }
265
-    /**
266
-     * muteLocalVideoStream
267
-     * @param status Boolean
268
-     */
269
-    static muteLocalVideoStream(status) {
270
-        Agora.muteLocalVideoStream(status);
271
-    }
272
-    /**
273
-     * enableLocalVideo
274
-     * @param status Boolean
275
-     */
276
-    static enableLocalVideo(status) {
277
-        Agora.enableLocalVideo(status);
278
-    }
279
-    /**
280
-     * muteAllRemoteVideoStreams
281
-     * @param status Boolean
282
-     */
283
-    static muteAllRemoteVideoStreams(status) {
284
-        Agora.muteAllRemoteVideoStreams(status);
285
-    }
286
-    /**
287
-     * muteRemoteVideoStream
288
-     * @param status Boolean
289
-     */
290
-    static muteRemoteVideoStream(uid, status) {
291
-        Agora.muteRemoteVideoStream(uid, status);
292
-    }
293
-    /**
294
-     * createDataStream
295
-     * @param reliable Boolean
296
-     * @param ordered Boolean
297
-     * @return Promise
298
-     */
299
-    static createDataStream(reliable, ordered) {
300
-        return Agora.createDataStream({ reliable, ordered });
301
-    }
302
-    /**
303
-     * sendStreamMessage
304
-     * @param reliable Boolean
305
-     * @param ordered Boolean
306
-     * @return Promise
307
-     */
308
-    static sendStreamMessage(streamId, data) {
309
-        return Agora.sendStreamMessage(streamId, data);
310
-    }
60
+    },
311
     /**
61
     /**
312
      * getSdkVersion
62
      * getSdkVersion
313
      * @param callback Function
63
      * @param callback Function
314
      */
64
      */
315
-    static getSdkVersion(callback) {
65
+    getSdkVersion(callback) {
316
         Agora.getSdkVersion().then(callback);
66
         Agora.getSdkVersion().then(callback);
317
-    }
318
-}
67
+    } });
319
 exports.default = RtcEngine;
68
 exports.default = RtcEngine;
320
-;
321
 //# sourceMappingURL=RtcEngine.native.js.map
69
 //# sourceMappingURL=RtcEngine.native.js.map

+ 1
- 1
lib/RtcEngine.native.js.map View File

1
-{"version":3,"file":"RtcEngine.native.js","sourceRoot":"","sources":["../src/RtcEngine.native.ts"],"names":[],"mappings":";;AAAA,+CAIsB;AAWtB,MAAM,EAAE,KAAK,EAAE,GAAG,4BAAa,CAAC;AAChC,MAAM,iBAAiB,GAAG,IAAI,iCAAkB,CAAC,KAAK,CAAC,CAAC;AAExD;;GAEG;AACH,MAAqB,SAAS;IAG1B;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,OAAe;QACvB,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;IACxB,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,WAAW,CAAC,WAAmB,EAAE,GAAY,EAAE,KAAc,EAAE,IAAa;QAC/E,OAAO,KAAK,CAAC,WAAW,CAAC,EAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,YAAY,CAAC,cAA8B;QAC9C,IAAI,CAAC,aAAa,EAAE,CAAC;QACrB,qCAAqC;QACrC,MAAM,MAAM,GAAG;YACX,WAAW;YACX,SAAS;YACT,sBAAsB;YACtB,wBAAwB;YACxB,gBAAgB;YAChB,qBAAqB;YACrB,cAAc;YACd,eAAe;YACf,0BAA0B;YAC1B,yBAAyB;YACzB,kBAAkB;YAClB,oBAAoB;YACpB,mBAAmB;YACnB,4BAA4B;YAC5B,gBAAgB;YAChB,qBAAqB;YACrB,yBAAyB;YACzB,iBAAiB;YACjB,wBAAwB;YACxB,yBAAyB;YACzB,gBAAgB;YAChB,wBAAwB;YACxB,2BAA2B;YAC3B,yBAAyB;YACzB,iBAAiB;YACjB,iBAAiB;YACjB,mBAAmB;YACnB,wBAAwB;YACxB,oBAAoB;YACpB,2BAA2B;YAC3B,mCAAmC;YACnC,sCAAsC;YACtC,qBAAqB;YACrB,eAAe;YACf,0BAA0B;YAC1B,6BAA6B;YAC7B,gBAAgB;YAChB,YAAY;YACZ,mBAAmB;YACnB,kBAAkB;YAClB,mBAAmB;YACnB,oBAAoB;YACpB,oBAAoB;YACpB,kBAAkB;YAClB,mBAAmB;YACnB,6BAA6B;YAC7B,6BAA6B;YAC7B,uBAAuB;YACvB,uBAAuB;YACvB,mBAAmB;YACnB,qBAAqB;YACrB,sBAAsB;YACtB,wBAAwB;YACxB,iBAAiB;YACjB,sBAAsB;YACtB,0BAA0B;YAC1B,+BAA+B;SAClC,CAAC;QACF,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE;YACtB,MAAM,OAAO,GAAI,cAAsB,CAAC,KAAK,CAAC,CAAC;YAC/C,IAAI,OAAO,EAAE;gBACT,IAAI,CAAC,SAAS,CAAC,IAAI,CACf,iBAAiB,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE;oBACvC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACjB,CAAC,CAAC,CACL,CAAC;aACL;SACJ;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,aAAa;QAChB,IAAI,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;YAC7C,KAAK,IAAI,QAAQ,IAAI,IAAI,CAAC,SAAS,EAAE;gBACjC,QAAQ,CAAC,MAAM,EAAE,CAAC;gBAClB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;aACvB;SACJ;IACL,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,kBAAkB;QACrB,OAAO,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACtC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,mBAAmB;QACtB,OAAO,KAAK,CAAC,mBAAmB,EAAE,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,YAAY;QACf,OAAO,KAAK,CAAC,YAAY,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,OAAoB;QACvC,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,OAAoB;QACxC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,YAAY;QACf,KAAK,CAAC,YAAY,EAAE,CAAC;IACzB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,WAAW;QACd,KAAK,CAAC,WAAW,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAwB;QAC9C,KAAK,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CAAC,IAAY;QAClC,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAW,EAAE,IAAY;QAChD,KAAK,CAAC,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACzC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,2BAA2B,CAAC,QAAgB,EAAE,MAAc;QAC/D,KAAK,CAAC,2BAA2B,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,YAAY;QACf,OAAO,KAAK,CAAC,YAAY,EAAE,CAAC;IAChC,CAAC;IAED,MAAM,CAAC,WAAW;QACd,KAAK,CAAC,WAAW,EAAE,CAAC;IACxB,CAAC;IAED,MAAM,CAAC,YAAY;QACf,KAAK,CAAC,YAAY,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,MAAe;QACxC,KAAK,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,MAAe;QACvC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,CAAC,GAAW,EAAE,MAAe;QACrD,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,yBAAyB,CAAC,MAAe;QAC5C,KAAK,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAe;QACnC,OAAO,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC1C,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,iCAAiC,CAAC,MAAe;QACpD,OAAO,KAAK,CAAC,iCAAiC,CAAC,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,kCAAkC,CAAC,MAAe;QACrD,KAAK,CAAC,kCAAkC,CAAC,MAAM,CAAC,CAAC;IACrD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,oBAAoB,CAAC,MAAe;QACvC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,MAAe;QACnC,KAAK,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,yBAAyB,CAAC,MAAe;QAC5C,KAAK,CAAC,yBAAyB,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,GAAW,EAAE,MAAe;QACrD,KAAK,CAAC,qBAAqB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAAC,QAAiB,EAAE,OAAgB;QACvD,OAAO,KAAK,CAAC,gBAAgB,CAAC,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAgB,EAAE,IAAS;QAChD,OAAO,KAAK,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IACnD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,QAAwB;QACzC,KAAK,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACJ;AAzVD,4BAyVC;AAAA,CAAC"}
1
+{"version":3,"file":"RtcEngine.native.js","sourceRoot":"","sources":["../src/RtcEngine.native.ts"],"names":[],"mappings":";;AAAA,+CAGsB;AAQtB,MAAM,EAAE,KAAK,EAAE,GAAG,4BAAa,CAAC;AAChC,MAAM,iBAAiB,GAAG,IAAI,iCAAkB,CAAC,KAAK,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,SAAS,qBAAQ,KAAK,IACxB,UAAU,EAAE,IAAI,GAAG,EAAE;IACrB;;;OAGG;IACH,IAAI,CAAC,OAAe;QAChB,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,WAAmB,EAAE,GAAY,EAAE,KAAc,EAAE,IAAa;QACxE,OAAO,KAAK,CAAC,WAAW,CAAC,EAAC,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACH,EAAE,CAAC,SAAiB,EAAE,QAAiC;QACnD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/B,iBAAiB,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACH,GAAG,CAAC,SAAiB;QACjB,iBAAiB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAChD,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACH,kBAAkB;QACd,KAAK,IAAI,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE;YACnC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;SACvB;QACD,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,OAAO;QACH,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;IAED;;;OAGG;IACH,aAAa,CAAC,QAAwB;QAClC,KAAK,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC,GACJ,CAAC;AAEF,kBAAe,SAAS,CAAC"}

+ 0
- 9967
package-lock.json
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

1
 {
1
 {
2
   "name": "react-native-agora",
2
   "name": "react-native-agora",
3
-  "version": "2.3.3-alpha.4",
3
+  "version": "2.3.3-alpha.5",
4
   "description": "声网Agora",
4
   "description": "声网Agora",
5
   "summary": "agora native sdk for react-native",
5
   "summary": "agora native sdk for react-native",
6
   "main": "lib/index.js",
6
   "main": "lib/index.js",

+ 7
- 2
samples/simpleDemo/babel.config.js View File

1
 module.exports = {
1
 module.exports = {
2
-  presets: ["module:metro-react-native-babel-preset"]
3
-}
2
+  presets: ['module:metro-react-native-babel-preset'],
3
+  env: {
4
+    production: {
5
+      plugins: ['react-native-paper/babel'],
6
+    },
7
+  },
8
+};

+ 41
- 42
samples/simpleDemo/components/agora.js View File

133
       clientRole: Host,
133
       clientRole: Host,
134
       audioProfile: AudioProfileDefault,
134
       audioProfile: AudioProfileDefault,
135
       audioScenario: AudioScenarioDefault
135
       audioScenario: AudioScenarioDefault
136
-    }
137
-    console.log("[CONFIG]", JSON.stringify(config));
138
-    console.log("[CONFIG.encoderConfig", config.videoEncoderConfig);
139
-    RtcEngine.init(config);
140
-    RtcEngine.eventEmitter({
141
-      onFirstRemoteVideoDecoded: (data) => {
142
-        console.log('[RtcEngine] onFirstRemoteVideoDecoded', data);
143
-      },
144
-      onUserJoined: (data) => {
145
-        console.log('[RtcEngine] onUserJoined', data);
146
-        const {peerIds} = this.state;
147
-        if (peerIds.indexOf(data.uid) === -1) {
148
-          this.setState({
149
-            peerIds: [...peerIds, data.uid]
150
-          })
151
-        }
152
-      },
153
-      onUserOffline: (data) => {
154
-        console.log('[RtcEngine] onUserOffline', data);
155
-        this.setState({
156
-            peerIds: this.state.peerIds.filter(uid => uid !== data.uid)
157
-        })
158
-      },
159
-      onJoinChannelSuccess: (data) => {
160
-        console.log('[RtcEngine] onJoinChannelSuccess', data);
161
-        RtcEngine.startPreview();
136
+    };
137
+    RtcEngine.on('firstRemoteVideoDecoded', (data) => {
138
+      console.log('[RtcEngine] onFirstRemoteVideoDecoded', data);
139
+    });
140
+    RtcEngine.on('userJoined', (data) => {
141
+      console.log('[RtcEngine] onUserJoined', data);
142
+      const {peerIds} = this.state;
143
+      if (peerIds.indexOf(data.uid) === -1) {
162
         this.setState({
144
         this.setState({
163
-          joinSucceed: true
145
+          peerIds: [...peerIds, data.uid]
164
         })
146
         })
165
-      },
166
-      onAudioVolumeIndication: (data) => {
167
-        console.log('[RtcEngine] onAudioVolumeIndication', data);
168
-      },
169
-      onClientRoleChanged: (data) => {
170
-        console.log("[RtcEngine] onClientRoleChanged", data);
171
-      },
172
-      onError: (data) => {
173
-        console.log('[RtcEngine] onError', data);
174
-        if (data.error === 17) {
175
-          RtcEngine.leaveChannel().then(_ => {
176
-            RtcEngine.destroy();
177
-            this.props.onCancel(data);
178
-          });
179
-        }
147
+      }
148
+    });
149
+    RtcEngine.on('userOffline', (data) => {
150
+      console.log('[RtcEngine] onUserOffline', data);
151
+      this.setState({
152
+          peerIds: this.state.peerIds.filter(uid => uid !== data.uid)
153
+      })
154
+    });
155
+    RtcEngine.on('joinChannelSuccess', (data) => {
156
+      console.log('[RtcEngine] onJoinChannelSuccess', data);
157
+      RtcEngine.startPreview();
158
+      this.setState({
159
+        joinSucceed: true
160
+      })
161
+    });
162
+    RtcEngine.on('audioVolumeIndication', (data) => {
163
+      console.log('[RtcEngine] onAudioVolumeIndication', data);
164
+    });
165
+    RtcEngine.on('clientRoleChanged', (data) => {
166
+      console.log("[RtcEngine] onClientRoleChanged", data);
167
+    })
168
+    RtcEngine.on('error', (data) => {
169
+      if (data.error === 17) {
170
+        RtcEngine.leaveChannel().then(_ => {
171
+          RtcEngine.destroy();
172
+          this.props.onCancel(data);
173
+        });
180
       }
174
       }
181
     })
175
     })
176
+    console.log("[CONFIG]", JSON.stringify(config));
177
+    console.log("[CONFIG.encoderConfig", config.videoEncoderConfig);
178
+    RtcEngine.init(config);
182
   }
179
   }
183
 
180
 
184
   componentDidMount () {
181
   componentDidMount () {
194
   componentWillUnmount () {
191
   componentWillUnmount () {
195
     if (this.state.joinSucceed) {
192
     if (this.state.joinSucceed) {
196
       RtcEngine.leaveChannel();
193
       RtcEngine.leaveChannel();
194
+      RtcEngine.removeAllListeners();
197
       RtcEngine.destroy();
195
       RtcEngine.destroy();
198
     }
196
     }
199
   }
197
   }
200
 
198
 
201
   handleCancel = () => {
199
   handleCancel = () => {
202
     RtcEngine.leaveChannel();
200
     RtcEngine.leaveChannel();
201
+    RtcEngine.removeAllListeners();
203
     RtcEngine.destroy();
202
     RtcEngine.destroy();
204
     this.props.onCancel();
203
     this.props.onCancel();
205
   }
204
   }

+ 4
- 4
samples/simpleDemo/ios/Podfile.lock View File

2
   - AgoraRtcEngine_iOS (2.3.3)
2
   - AgoraRtcEngine_iOS (2.3.3)
3
   - React (0.58.3):
3
   - React (0.58.3):
4
     - React/Core (= 0.58.3)
4
     - React/Core (= 0.58.3)
5
-  - react-native-agora (2.3.3):
5
+  - react-native-agora (2.3.3-alpha.4):
6
     - AgoraRtcEngine_iOS (= 2.3.3)
6
     - AgoraRtcEngine_iOS (= 2.3.3)
7
     - React
7
     - React
8
-    - react-native-agora/AgoraRtcCryptoLoader (= 2.3.3)
9
-  - react-native-agora/AgoraRtcCryptoLoader (2.3.3):
8
+    - react-native-agora/AgoraRtcCryptoLoader (= 2.3.3-alpha.4)
9
+  - react-native-agora/AgoraRtcCryptoLoader (2.3.3-alpha.4):
10
     - AgoraRtcEngine_iOS (= 2.3.3)
10
     - AgoraRtcEngine_iOS (= 2.3.3)
11
     - React
11
     - React
12
   - React/Core (0.58.3):
12
   - React/Core (0.58.3):
33
 SPEC CHECKSUMS:
33
 SPEC CHECKSUMS:
34
   AgoraRtcEngine_iOS: 8ad4b58dafed2cec5df03fa1f0ddbdad2c9ff958
34
   AgoraRtcEngine_iOS: 8ad4b58dafed2cec5df03fa1f0ddbdad2c9ff958
35
   React: 9b873b38b92ed8012d7cdf3b965477095ed364c4
35
   React: 9b873b38b92ed8012d7cdf3b965477095ed364c4
36
-  react-native-agora: ad538661771e745fac8920412002e0e90903bbc8
36
+  react-native-agora: 749ff4aadd5c8125139c82787c378de7e304805d
37
   yoga: 0885622311729a02c2bc02dca97167787a51488b
37
   yoga: 0885622311729a02c2bc02dca97167787a51488b
38
 
38
 
39
 PODFILE CHECKSUM: 20565f1fb8643e49a8e76b33da6bb4e2d188134a
39
 PODFILE CHECKSUM: 20565f1fb8643e49a8e76b33da6bb4e2d188134a

+ 71
- 71
samples/simpleDemo/ios/simpleDemo.xcodeproj/project.pbxproj View File

13
 		00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
13
 		00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; };
14
 		00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
14
 		00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; };
15
 		00E356F31AD99517003FC87E /* simpleDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* simpleDemoTests.m */; };
15
 		00E356F31AD99517003FC87E /* simpleDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* simpleDemoTests.m */; };
16
+		068EAAC85996A1A5C8217EAB /* libPods-simpleDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 951159A5104BF2D9AAB23983 /* libPods-simpleDemoTests.a */; };
16
 		0842E3912206D315003875AC /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0842E36A2206D315003875AC /* libc++.tbd */; };
17
 		0842E3912206D315003875AC /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0842E36A2206D315003875AC /* libc++.tbd */; };
17
 		0842E3932206D31B003875AC /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0842E3922206D31B003875AC /* libresolv.tbd */; };
18
 		0842E3932206D31B003875AC /* libresolv.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 0842E3922206D31B003875AC /* libresolv.tbd */; };
18
 		0842E3952206D320003875AC /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0842E3942206D320003875AC /* AVFoundation.framework */; };
19
 		0842E3952206D320003875AC /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0842E3942206D320003875AC /* AVFoundation.framework */; };
45
 		2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
46
 		2D16E6881FA4F8E400B85C8A /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D16E6891FA4F8E400B85C8A /* libReact.a */; };
46
 		2DCD954D1E0B4F2C00145EB5 /* simpleDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* simpleDemoTests.m */; };
47
 		2DCD954D1E0B4F2C00145EB5 /* simpleDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* simpleDemoTests.m */; };
47
 		2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
48
 		2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3DAD3EA31DF850E9000B6D8A /* libReact.a */; };
48
-		4D3FC919BA1ACFBD0D0EC6A1 /* libPods-simpleDemoTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ED1D799E3903895175F184F1 /* libPods-simpleDemoTests.a */; };
49
-		56F0265FA18A3B1951F48621 /* libPods-simpleDemo-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A85F37D8B40BE09C0F39D31 /* libPods-simpleDemo-tvOSTests.a */; };
49
+		3752A059FBE8E09075DA4AE1 /* libPods-simpleDemo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 370F79B8FF06A30AC0F9C3B5 /* libPods-simpleDemo-tvOS.a */; };
50
+		6793190DE86DEFCF49576B2B /* libPods-simpleDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5C46FE5A2E9627977A3B13E9 /* libPods-simpleDemo.a */; };
50
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
51
 		832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
51
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
52
 		ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
52
-		C3E022B94502A91EB1E0372C /* libPods-simpleDemo-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 299FC751E168E658B289864A /* libPods-simpleDemo-tvOS.a */; };
53
-		EC90B755EAB038945B70EFF8 /* libPods-simpleDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 66BD8A39FC5EF1269D9EF1A2 /* libPods-simpleDemo.a */; };
54
 		ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
53
 		ED297163215061F000B7C4FE /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ED297162215061F000B7C4FE /* JavaScriptCore.framework */; };
54
+		F36C97402B4845BDA6A2844C /* libPods-simpleDemo-tvOSTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F05F2972B345118AE7DEBA00 /* libPods-simpleDemo-tvOSTests.a */; };
55
 /* End PBXBuildFile section */
55
 /* End PBXBuildFile section */
56
 
56
 
57
 /* Begin PBXContainerItemProxy section */
57
 /* Begin PBXContainerItemProxy section */
347
 		00E356EE1AD99517003FC87E /* simpleDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = simpleDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
347
 		00E356EE1AD99517003FC87E /* simpleDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = simpleDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
348
 		00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
348
 		00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
349
 		00E356F21AD99517003FC87E /* simpleDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = simpleDemoTests.m; sourceTree = "<group>"; };
349
 		00E356F21AD99517003FC87E /* simpleDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = simpleDemoTests.m; sourceTree = "<group>"; };
350
+		03E6606B86246B0AE5C5BFC5 /* Pods-simpleDemo-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOSTests/Pods-simpleDemo-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
350
 		0842E36A2206D315003875AC /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
351
 		0842E36A2206D315003875AC /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
351
 		0842E3922206D31B003875AC /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
352
 		0842E3922206D31B003875AC /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
352
 		0842E3942206D320003875AC /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
353
 		0842E3942206D320003875AC /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
369
 		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = simpleDemo/Info.plist; sourceTree = "<group>"; };
370
 		13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = simpleDemo/Info.plist; sourceTree = "<group>"; };
370
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = simpleDemo/main.m; sourceTree = "<group>"; };
371
 		13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = simpleDemo/main.m; sourceTree = "<group>"; };
371
 		146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
372
 		146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
372
-		2518E82A5EEFEBCCB546686E /* Pods-simpleDemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemoTests/Pods-simpleDemoTests.debug.xcconfig"; sourceTree = "<group>"; };
373
-		299FC751E168E658B289864A /* libPods-simpleDemo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemo-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
373
+		2C28A102506C6EC8AEEADEBB /* Pods-simpleDemoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemoTests/Pods-simpleDemoTests.release.xcconfig"; sourceTree = "<group>"; };
374
 		2D02E47B1E0B4A5D006451C7 /* simpleDemo-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "simpleDemo-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
374
 		2D02E47B1E0B4A5D006451C7 /* simpleDemo-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "simpleDemo-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
375
 		2D02E4901E0B4A5D006451C7 /* simpleDemo-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "simpleDemo-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
375
 		2D02E4901E0B4A5D006451C7 /* simpleDemo-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "simpleDemo-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
376
 		2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
376
 		2D16E6891FA4F8E400B85C8A /* libReact.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libReact.a; sourceTree = BUILT_PRODUCTS_DIR; };
377
-		425DC21FE0AD7CF5497EBBAD /* Pods-simpleDemo-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOSTests/Pods-simpleDemo-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
378
-		45C3C66C498C5DD68AEA83DB /* Pods-simpleDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo/Pods-simpleDemo.debug.xcconfig"; sourceTree = "<group>"; };
379
-		49AF4131548CCDDCC8317F3A /* Pods-simpleDemo-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOS/Pods-simpleDemo-tvOS.release.xcconfig"; sourceTree = "<group>"; };
380
-		55F01DA43729E829E7920BE2 /* Pods-simpleDemo-tvOSTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOSTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOSTests/Pods-simpleDemo-tvOSTests.release.xcconfig"; sourceTree = "<group>"; };
381
-		5B50FE91740B45AD2B2FFA43 /* Pods-simpleDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo/Pods-simpleDemo.release.xcconfig"; sourceTree = "<group>"; };
377
+		370F79B8FF06A30AC0F9C3B5 /* libPods-simpleDemo-tvOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemo-tvOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
378
+		3FE905B2466BFABBAA8F09A8 /* Pods-simpleDemo-tvOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOS.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOS/Pods-simpleDemo-tvOS.release.xcconfig"; sourceTree = "<group>"; };
379
+		4562E79007DAB0C0D6F958BC /* Pods-simpleDemo-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOS/Pods-simpleDemo-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
380
+		5C46FE5A2E9627977A3B13E9 /* libPods-simpleDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
382
 		5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
381
 		5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
383
-		66BD8A39FC5EF1269D9EF1A2 /* libPods-simpleDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
384
-		670CBBAFD05743865934B941 /* Pods-simpleDemo-tvOS.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOS.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOS/Pods-simpleDemo-tvOS.debug.xcconfig"; sourceTree = "<group>"; };
382
+		61D6128EB7E59612F733FF02 /* Pods-simpleDemoTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemoTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemoTests/Pods-simpleDemoTests.debug.xcconfig"; sourceTree = "<group>"; };
385
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
383
 		78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
386
-		7A85F37D8B40BE09C0F39D31 /* libPods-simpleDemo-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemo-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
387
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
384
 		832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
385
+		951159A5104BF2D9AAB23983 /* libPods-simpleDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
388
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
386
 		ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
389
-		B3CA7DAF4D391036EC75502F /* Pods-simpleDemoTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemoTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemoTests/Pods-simpleDemoTests.release.xcconfig"; sourceTree = "<group>"; };
390
-		ED1D799E3903895175F184F1 /* libPods-simpleDemoTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemoTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
387
+		B8C83FE8120F5A8CA66DC95D /* Pods-simpleDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo/Pods-simpleDemo.debug.xcconfig"; sourceTree = "<group>"; };
388
+		D411D46516249CACE14D41DC /* Pods-simpleDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo/Pods-simpleDemo.release.xcconfig"; sourceTree = "<group>"; };
389
+		DCFC59650767B9DD307D635F /* Pods-simpleDemo-tvOSTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-simpleDemo-tvOSTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-simpleDemo-tvOSTests/Pods-simpleDemo-tvOSTests.debug.xcconfig"; sourceTree = "<group>"; };
391
 		ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
390
 		ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
391
+		F05F2972B345118AE7DEBA00 /* libPods-simpleDemo-tvOSTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-simpleDemo-tvOSTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
392
 /* End PBXFileReference section */
392
 /* End PBXFileReference section */
393
 
393
 
394
 /* Begin PBXFrameworksBuildPhase section */
394
 /* Begin PBXFrameworksBuildPhase section */
397
 			buildActionMask = 2147483647;
397
 			buildActionMask = 2147483647;
398
 			files = (
398
 			files = (
399
 				140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
399
 				140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
400
-				4D3FC919BA1ACFBD0D0EC6A1 /* libPods-simpleDemoTests.a in Frameworks */,
400
+				068EAAC85996A1A5C8217EAB /* libPods-simpleDemoTests.a in Frameworks */,
401
 			);
401
 			);
402
 			runOnlyForDeploymentPostprocessing = 0;
402
 			runOnlyForDeploymentPostprocessing = 0;
403
 		};
403
 		};
427
 				832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
427
 				832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
428
 				00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
428
 				00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
429
 				139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
429
 				139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
430
-				EC90B755EAB038945B70EFF8 /* libPods-simpleDemo.a in Frameworks */,
430
+				6793190DE86DEFCF49576B2B /* libPods-simpleDemo.a in Frameworks */,
431
 			);
431
 			);
432
 			runOnlyForDeploymentPostprocessing = 0;
432
 			runOnlyForDeploymentPostprocessing = 0;
433
 		};
433
 		};
443
 				2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,
443
 				2D02E4C61E0B4AEC006451C7 /* libRCTSettings-tvOS.a in Frameworks */,
444
 				2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,
444
 				2D02E4C71E0B4AEC006451C7 /* libRCTText-tvOS.a in Frameworks */,
445
 				2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,
445
 				2D02E4C81E0B4AEC006451C7 /* libRCTWebSocket-tvOS.a in Frameworks */,
446
-				C3E022B94502A91EB1E0372C /* libPods-simpleDemo-tvOS.a in Frameworks */,
446
+				3752A059FBE8E09075DA4AE1 /* libPods-simpleDemo-tvOS.a in Frameworks */,
447
 			);
447
 			);
448
 			runOnlyForDeploymentPostprocessing = 0;
448
 			runOnlyForDeploymentPostprocessing = 0;
449
 		};
449
 		};
452
 			buildActionMask = 2147483647;
452
 			buildActionMask = 2147483647;
453
 			files = (
453
 			files = (
454
 				2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */,
454
 				2DF0FFEE2056DD460020B375 /* libReact.a in Frameworks */,
455
-				56F0265FA18A3B1951F48621 /* libPods-simpleDemo-tvOSTests.a in Frameworks */,
455
+				F36C97402B4845BDA6A2844C /* libPods-simpleDemo-tvOSTests.a in Frameworks */,
456
 			);
456
 			);
457
 			runOnlyForDeploymentPostprocessing = 0;
457
 			runOnlyForDeploymentPostprocessing = 0;
458
 		};
458
 		};
606
 				0842E36A2206D315003875AC /* libc++.tbd */,
606
 				0842E36A2206D315003875AC /* libc++.tbd */,
607
 				ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
607
 				ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
608
 				2D16E6891FA4F8E400B85C8A /* libReact.a */,
608
 				2D16E6891FA4F8E400B85C8A /* libReact.a */,
609
-				66BD8A39FC5EF1269D9EF1A2 /* libPods-simpleDemo.a */,
610
-				299FC751E168E658B289864A /* libPods-simpleDemo-tvOS.a */,
611
-				7A85F37D8B40BE09C0F39D31 /* libPods-simpleDemo-tvOSTests.a */,
612
-				ED1D799E3903895175F184F1 /* libPods-simpleDemoTests.a */,
609
+				5C46FE5A2E9627977A3B13E9 /* libPods-simpleDemo.a */,
610
+				370F79B8FF06A30AC0F9C3B5 /* libPods-simpleDemo-tvOS.a */,
611
+				F05F2972B345118AE7DEBA00 /* libPods-simpleDemo-tvOSTests.a */,
612
+				951159A5104BF2D9AAB23983 /* libPods-simpleDemoTests.a */,
613
 			);
613
 			);
614
 			name = Frameworks;
614
 			name = Frameworks;
615
 			sourceTree = "<group>";
615
 			sourceTree = "<group>";
623
 			name = Products;
623
 			name = Products;
624
 			sourceTree = "<group>";
624
 			sourceTree = "<group>";
625
 		};
625
 		};
626
-		6E8B12A295B3F1943001B9D8 /* Pods */ = {
626
+		78C398B11ACF4ADC00677621 /* Products */ = {
627
 			isa = PBXGroup;
627
 			isa = PBXGroup;
628
 			children = (
628
 			children = (
629
-				45C3C66C498C5DD68AEA83DB /* Pods-simpleDemo.debug.xcconfig */,
630
-				5B50FE91740B45AD2B2FFA43 /* Pods-simpleDemo.release.xcconfig */,
631
-				670CBBAFD05743865934B941 /* Pods-simpleDemo-tvOS.debug.xcconfig */,
632
-				49AF4131548CCDDCC8317F3A /* Pods-simpleDemo-tvOS.release.xcconfig */,
633
-				425DC21FE0AD7CF5497EBBAD /* Pods-simpleDemo-tvOSTests.debug.xcconfig */,
634
-				55F01DA43729E829E7920BE2 /* Pods-simpleDemo-tvOSTests.release.xcconfig */,
635
-				2518E82A5EEFEBCCB546686E /* Pods-simpleDemoTests.debug.xcconfig */,
636
-				B3CA7DAF4D391036EC75502F /* Pods-simpleDemoTests.release.xcconfig */,
629
+				78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
630
+				3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */,
637
 			);
631
 			);
638
-			name = Pods;
632
+			name = Products;
639
 			sourceTree = "<group>";
633
 			sourceTree = "<group>";
640
 		};
634
 		};
641
-		78C398B11ACF4ADC00677621 /* Products */ = {
635
+		7E38130487AE81DA0F050D92 /* Pods */ = {
642
 			isa = PBXGroup;
636
 			isa = PBXGroup;
643
 			children = (
637
 			children = (
644
-				78C398B91ACF4ADC00677621 /* libRCTLinking.a */,
645
-				3DAD3E881DF850E9000B6D8A /* libRCTLinking-tvOS.a */,
638
+				B8C83FE8120F5A8CA66DC95D /* Pods-simpleDemo.debug.xcconfig */,
639
+				D411D46516249CACE14D41DC /* Pods-simpleDemo.release.xcconfig */,
640
+				4562E79007DAB0C0D6F958BC /* Pods-simpleDemo-tvOS.debug.xcconfig */,
641
+				3FE905B2466BFABBAA8F09A8 /* Pods-simpleDemo-tvOS.release.xcconfig */,
642
+				DCFC59650767B9DD307D635F /* Pods-simpleDemo-tvOSTests.debug.xcconfig */,
643
+				03E6606B86246B0AE5C5BFC5 /* Pods-simpleDemo-tvOSTests.release.xcconfig */,
644
+				61D6128EB7E59612F733FF02 /* Pods-simpleDemoTests.debug.xcconfig */,
645
+				2C28A102506C6EC8AEEADEBB /* Pods-simpleDemoTests.release.xcconfig */,
646
 			);
646
 			);
647
-			name = Products;
647
+			name = Pods;
648
 			sourceTree = "<group>";
648
 			sourceTree = "<group>";
649
 		};
649
 		};
650
 		832341AE1AAA6A7D00B99B32 /* Libraries */ = {
650
 		832341AE1AAA6A7D00B99B32 /* Libraries */ = {
685
 				83CBBA001A601CBA00E9B192 /* Products */,
685
 				83CBBA001A601CBA00E9B192 /* Products */,
686
 				2D16E6871FA4F8E400B85C8A /* Frameworks */,
686
 				2D16E6871FA4F8E400B85C8A /* Frameworks */,
687
 				0842E3102206D244003875AC /* Recovered References */,
687
 				0842E3102206D244003875AC /* Recovered References */,
688
-				6E8B12A295B3F1943001B9D8 /* Pods */,
688
+				7E38130487AE81DA0F050D92 /* Pods */,
689
 			);
689
 			);
690
 			indentWidth = 2;
690
 			indentWidth = 2;
691
 			sourceTree = "<group>";
691
 			sourceTree = "<group>";
719
 			isa = PBXNativeTarget;
719
 			isa = PBXNativeTarget;
720
 			buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "simpleDemoTests" */;
720
 			buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "simpleDemoTests" */;
721
 			buildPhases = (
721
 			buildPhases = (
722
-				EAF58240469798C6B16617A5 /* [CP] Check Pods Manifest.lock */,
722
+				4BEA691CDC159330D76026CC /* [CP] Check Pods Manifest.lock */,
723
 				00E356EA1AD99517003FC87E /* Sources */,
723
 				00E356EA1AD99517003FC87E /* Sources */,
724
 				00E356EB1AD99517003FC87E /* Frameworks */,
724
 				00E356EB1AD99517003FC87E /* Frameworks */,
725
 				00E356EC1AD99517003FC87E /* Resources */,
725
 				00E356EC1AD99517003FC87E /* Resources */,
738
 			isa = PBXNativeTarget;
738
 			isa = PBXNativeTarget;
739
 			buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "simpleDemo" */;
739
 			buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "simpleDemo" */;
740
 			buildPhases = (
740
 			buildPhases = (
741
-				BDA8D1EBEEE8A2517BA1F5A7 /* [CP] Check Pods Manifest.lock */,
741
+				3D4AA6A23B06F1B41AB5B58D /* [CP] Check Pods Manifest.lock */,
742
 				13B07F871A680F5B00A75B9A /* Sources */,
742
 				13B07F871A680F5B00A75B9A /* Sources */,
743
 				13B07F8C1A680F5B00A75B9A /* Frameworks */,
743
 				13B07F8C1A680F5B00A75B9A /* Frameworks */,
744
 				13B07F8E1A680F5B00A75B9A /* Resources */,
744
 				13B07F8E1A680F5B00A75B9A /* Resources */,
757
 			isa = PBXNativeTarget;
757
 			isa = PBXNativeTarget;
758
 			buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "simpleDemo-tvOS" */;
758
 			buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "simpleDemo-tvOS" */;
759
 			buildPhases = (
759
 			buildPhases = (
760
-				217E0836021B8C9E43808D99 /* [CP] Check Pods Manifest.lock */,
760
+				E79DD51971EBF6BE2FDAF290 /* [CP] Check Pods Manifest.lock */,
761
 				2D02E4771E0B4A5D006451C7 /* Sources */,
761
 				2D02E4771E0B4A5D006451C7 /* Sources */,
762
 				2D02E4781E0B4A5D006451C7 /* Frameworks */,
762
 				2D02E4781E0B4A5D006451C7 /* Frameworks */,
763
 				2D02E4791E0B4A5D006451C7 /* Resources */,
763
 				2D02E4791E0B4A5D006451C7 /* Resources */,
776
 			isa = PBXNativeTarget;
776
 			isa = PBXNativeTarget;
777
 			buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "simpleDemo-tvOSTests" */;
777
 			buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "simpleDemo-tvOSTests" */;
778
 			buildPhases = (
778
 			buildPhases = (
779
-				20C6BDC28229D769E1157E12 /* [CP] Check Pods Manifest.lock */,
779
+				9ABCD2800360B9BF14D66946 /* [CP] Check Pods Manifest.lock */,
780
 				2D02E48C1E0B4A5D006451C7 /* Sources */,
780
 				2D02E48C1E0B4A5D006451C7 /* Sources */,
781
 				2D02E48D1E0B4A5D006451C7 /* Frameworks */,
781
 				2D02E48D1E0B4A5D006451C7 /* Frameworks */,
782
 				2D02E48E1E0B4A5D006451C7 /* Resources */,
782
 				2D02E48E1E0B4A5D006451C7 /* Resources */,
1217
 			shellPath = /bin/sh;
1217
 			shellPath = /bin/sh;
1218
 			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
1218
 			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
1219
 		};
1219
 		};
1220
-		20C6BDC28229D769E1157E12 /* [CP] Check Pods Manifest.lock */ = {
1220
+		2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
1221
 			isa = PBXShellScriptBuildPhase;
1221
 			isa = PBXShellScriptBuildPhase;
1222
 			buildActionMask = 2147483647;
1222
 			buildActionMask = 2147483647;
1223
 			files = (
1223
 			files = (
1224
 			);
1224
 			);
1225
-			inputFileListPaths = (
1226
-			);
1227
 			inputPaths = (
1225
 			inputPaths = (
1228
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
1229
-				"${PODS_ROOT}/Manifest.lock",
1230
-			);
1231
-			name = "[CP] Check Pods Manifest.lock";
1232
-			outputFileListPaths = (
1233
 			);
1226
 			);
1227
+			name = "Bundle React Native Code And Images";
1234
 			outputPaths = (
1228
 			outputPaths = (
1235
-				"$(DERIVED_FILE_DIR)/Pods-simpleDemo-tvOSTests-checkManifestLockResult.txt",
1236
 			);
1229
 			);
1237
 			runOnlyForDeploymentPostprocessing = 0;
1230
 			runOnlyForDeploymentPostprocessing = 0;
1238
 			shellPath = /bin/sh;
1231
 			shellPath = /bin/sh;
1239
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1240
-			showEnvVarsInLog = 0;
1232
+			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
1241
 		};
1233
 		};
1242
-		217E0836021B8C9E43808D99 /* [CP] Check Pods Manifest.lock */ = {
1234
+		3D4AA6A23B06F1B41AB5B58D /* [CP] Check Pods Manifest.lock */ = {
1243
 			isa = PBXShellScriptBuildPhase;
1235
 			isa = PBXShellScriptBuildPhase;
1244
 			buildActionMask = 2147483647;
1236
 			buildActionMask = 2147483647;
1245
 			files = (
1237
 			files = (
1254
 			outputFileListPaths = (
1246
 			outputFileListPaths = (
1255
 			);
1247
 			);
1256
 			outputPaths = (
1248
 			outputPaths = (
1257
-				"$(DERIVED_FILE_DIR)/Pods-simpleDemo-tvOS-checkManifestLockResult.txt",
1249
+				"$(DERIVED_FILE_DIR)/Pods-simpleDemo-checkManifestLockResult.txt",
1258
 			);
1250
 			);
1259
 			runOnlyForDeploymentPostprocessing = 0;
1251
 			runOnlyForDeploymentPostprocessing = 0;
1260
 			shellPath = /bin/sh;
1252
 			shellPath = /bin/sh;
1261
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1253
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1262
 			showEnvVarsInLog = 0;
1254
 			showEnvVarsInLog = 0;
1263
 		};
1255
 		};
1264
-		2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
1256
+		4BEA691CDC159330D76026CC /* [CP] Check Pods Manifest.lock */ = {
1265
 			isa = PBXShellScriptBuildPhase;
1257
 			isa = PBXShellScriptBuildPhase;
1266
 			buildActionMask = 2147483647;
1258
 			buildActionMask = 2147483647;
1267
 			files = (
1259
 			files = (
1268
 			);
1260
 			);
1261
+			inputFileListPaths = (
1262
+			);
1269
 			inputPaths = (
1263
 			inputPaths = (
1264
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
1265
+				"${PODS_ROOT}/Manifest.lock",
1266
+			);
1267
+			name = "[CP] Check Pods Manifest.lock";
1268
+			outputFileListPaths = (
1270
 			);
1269
 			);
1271
-			name = "Bundle React Native Code And Images";
1272
 			outputPaths = (
1270
 			outputPaths = (
1271
+				"$(DERIVED_FILE_DIR)/Pods-simpleDemoTests-checkManifestLockResult.txt",
1273
 			);
1272
 			);
1274
 			runOnlyForDeploymentPostprocessing = 0;
1273
 			runOnlyForDeploymentPostprocessing = 0;
1275
 			shellPath = /bin/sh;
1274
 			shellPath = /bin/sh;
1276
-			shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
1275
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1276
+			showEnvVarsInLog = 0;
1277
 		};
1277
 		};
1278
-		BDA8D1EBEEE8A2517BA1F5A7 /* [CP] Check Pods Manifest.lock */ = {
1278
+		9ABCD2800360B9BF14D66946 /* [CP] Check Pods Manifest.lock */ = {
1279
 			isa = PBXShellScriptBuildPhase;
1279
 			isa = PBXShellScriptBuildPhase;
1280
 			buildActionMask = 2147483647;
1280
 			buildActionMask = 2147483647;
1281
 			files = (
1281
 			files = (
1290
 			outputFileListPaths = (
1290
 			outputFileListPaths = (
1291
 			);
1291
 			);
1292
 			outputPaths = (
1292
 			outputPaths = (
1293
-				"$(DERIVED_FILE_DIR)/Pods-simpleDemo-checkManifestLockResult.txt",
1293
+				"$(DERIVED_FILE_DIR)/Pods-simpleDemo-tvOSTests-checkManifestLockResult.txt",
1294
 			);
1294
 			);
1295
 			runOnlyForDeploymentPostprocessing = 0;
1295
 			runOnlyForDeploymentPostprocessing = 0;
1296
 			shellPath = /bin/sh;
1296
 			shellPath = /bin/sh;
1297
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1297
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
1298
 			showEnvVarsInLog = 0;
1298
 			showEnvVarsInLog = 0;
1299
 		};
1299
 		};
1300
-		EAF58240469798C6B16617A5 /* [CP] Check Pods Manifest.lock */ = {
1300
+		E79DD51971EBF6BE2FDAF290 /* [CP] Check Pods Manifest.lock */ = {
1301
 			isa = PBXShellScriptBuildPhase;
1301
 			isa = PBXShellScriptBuildPhase;
1302
 			buildActionMask = 2147483647;
1302
 			buildActionMask = 2147483647;
1303
 			files = (
1303
 			files = (
1312
 			outputFileListPaths = (
1312
 			outputFileListPaths = (
1313
 			);
1313
 			);
1314
 			outputPaths = (
1314
 			outputPaths = (
1315
-				"$(DERIVED_FILE_DIR)/Pods-simpleDemoTests-checkManifestLockResult.txt",
1315
+				"$(DERIVED_FILE_DIR)/Pods-simpleDemo-tvOS-checkManifestLockResult.txt",
1316
 			);
1316
 			);
1317
 			runOnlyForDeploymentPostprocessing = 0;
1317
 			runOnlyForDeploymentPostprocessing = 0;
1318
 			shellPath = /bin/sh;
1318
 			shellPath = /bin/sh;
1386
 /* Begin XCBuildConfiguration section */
1386
 /* Begin XCBuildConfiguration section */
1387
 		00E356F61AD99517003FC87E /* Debug */ = {
1387
 		00E356F61AD99517003FC87E /* Debug */ = {
1388
 			isa = XCBuildConfiguration;
1388
 			isa = XCBuildConfiguration;
1389
-			baseConfigurationReference = 2518E82A5EEFEBCCB546686E /* Pods-simpleDemoTests.debug.xcconfig */;
1389
+			baseConfigurationReference = 61D6128EB7E59612F733FF02 /* Pods-simpleDemoTests.debug.xcconfig */;
1390
 			buildSettings = {
1390
 			buildSettings = {
1391
 				BUNDLE_LOADER = "$(TEST_HOST)";
1391
 				BUNDLE_LOADER = "$(TEST_HOST)";
1392
 				DEVELOPMENT_TEAM = 56968F5P8G;
1392
 				DEVELOPMENT_TEAM = 56968F5P8G;
1411
 		};
1411
 		};
1412
 		00E356F71AD99517003FC87E /* Release */ = {
1412
 		00E356F71AD99517003FC87E /* Release */ = {
1413
 			isa = XCBuildConfiguration;
1413
 			isa = XCBuildConfiguration;
1414
-			baseConfigurationReference = B3CA7DAF4D391036EC75502F /* Pods-simpleDemoTests.release.xcconfig */;
1414
+			baseConfigurationReference = 2C28A102506C6EC8AEEADEBB /* Pods-simpleDemoTests.release.xcconfig */;
1415
 			buildSettings = {
1415
 			buildSettings = {
1416
 				BUNDLE_LOADER = "$(TEST_HOST)";
1416
 				BUNDLE_LOADER = "$(TEST_HOST)";
1417
 				COPY_PHASE_STRIP = NO;
1417
 				COPY_PHASE_STRIP = NO;
1433
 		};
1433
 		};
1434
 		13B07F941A680F5B00A75B9A /* Debug */ = {
1434
 		13B07F941A680F5B00A75B9A /* Debug */ = {
1435
 			isa = XCBuildConfiguration;
1435
 			isa = XCBuildConfiguration;
1436
-			baseConfigurationReference = 45C3C66C498C5DD68AEA83DB /* Pods-simpleDemo.debug.xcconfig */;
1436
+			baseConfigurationReference = B8C83FE8120F5A8CA66DC95D /* Pods-simpleDemo.debug.xcconfig */;
1437
 			buildSettings = {
1437
 			buildSettings = {
1438
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1438
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1439
 				CURRENT_PROJECT_VERSION = 1;
1439
 				CURRENT_PROJECT_VERSION = 1;
1466
 		};
1466
 		};
1467
 		13B07F951A680F5B00A75B9A /* Release */ = {
1467
 		13B07F951A680F5B00A75B9A /* Release */ = {
1468
 			isa = XCBuildConfiguration;
1468
 			isa = XCBuildConfiguration;
1469
-			baseConfigurationReference = 5B50FE91740B45AD2B2FFA43 /* Pods-simpleDemo.release.xcconfig */;
1469
+			baseConfigurationReference = D411D46516249CACE14D41DC /* Pods-simpleDemo.release.xcconfig */;
1470
 			buildSettings = {
1470
 			buildSettings = {
1471
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1471
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
1472
 				CURRENT_PROJECT_VERSION = 1;
1472
 				CURRENT_PROJECT_VERSION = 1;
1498
 		};
1498
 		};
1499
 		2D02E4971E0B4A5E006451C7 /* Debug */ = {
1499
 		2D02E4971E0B4A5E006451C7 /* Debug */ = {
1500
 			isa = XCBuildConfiguration;
1500
 			isa = XCBuildConfiguration;
1501
-			baseConfigurationReference = 670CBBAFD05743865934B941 /* Pods-simpleDemo-tvOS.debug.xcconfig */;
1501
+			baseConfigurationReference = 4562E79007DAB0C0D6F958BC /* Pods-simpleDemo-tvOS.debug.xcconfig */;
1502
 			buildSettings = {
1502
 			buildSettings = {
1503
 				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
1503
 				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
1504
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1504
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1527
 		};
1527
 		};
1528
 		2D02E4981E0B4A5E006451C7 /* Release */ = {
1528
 		2D02E4981E0B4A5E006451C7 /* Release */ = {
1529
 			isa = XCBuildConfiguration;
1529
 			isa = XCBuildConfiguration;
1530
-			baseConfigurationReference = 49AF4131548CCDDCC8317F3A /* Pods-simpleDemo-tvOS.release.xcconfig */;
1530
+			baseConfigurationReference = 3FE905B2466BFABBAA8F09A8 /* Pods-simpleDemo-tvOS.release.xcconfig */;
1531
 			buildSettings = {
1531
 			buildSettings = {
1532
 				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
1532
 				ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
1533
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1533
 				ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
1556
 		};
1556
 		};
1557
 		2D02E4991E0B4A5E006451C7 /* Debug */ = {
1557
 		2D02E4991E0B4A5E006451C7 /* Debug */ = {
1558
 			isa = XCBuildConfiguration;
1558
 			isa = XCBuildConfiguration;
1559
-			baseConfigurationReference = 425DC21FE0AD7CF5497EBBAD /* Pods-simpleDemo-tvOSTests.debug.xcconfig */;
1559
+			baseConfigurationReference = DCFC59650767B9DD307D635F /* Pods-simpleDemo-tvOSTests.debug.xcconfig */;
1560
 			buildSettings = {
1560
 			buildSettings = {
1561
 				BUNDLE_LOADER = "$(TEST_HOST)";
1561
 				BUNDLE_LOADER = "$(TEST_HOST)";
1562
 				CLANG_ANALYZER_NONNULL = YES;
1562
 				CLANG_ANALYZER_NONNULL = YES;
1584
 		};
1584
 		};
1585
 		2D02E49A1E0B4A5E006451C7 /* Release */ = {
1585
 		2D02E49A1E0B4A5E006451C7 /* Release */ = {
1586
 			isa = XCBuildConfiguration;
1586
 			isa = XCBuildConfiguration;
1587
-			baseConfigurationReference = 55F01DA43729E829E7920BE2 /* Pods-simpleDemo-tvOSTests.release.xcconfig */;
1587
+			baseConfigurationReference = 03E6606B86246B0AE5C5BFC5 /* Pods-simpleDemo-tvOSTests.release.xcconfig */;
1588
 			buildSettings = {
1588
 			buildSettings = {
1589
 				BUNDLE_LOADER = "$(TEST_HOST)";
1589
 				BUNDLE_LOADER = "$(TEST_HOST)";
1590
 				CLANG_ANALYZER_NONNULL = YES;
1590
 				CLANG_ANALYZER_NONNULL = YES;

+ 36
- 317
src/RtcEngine.native.ts View File

1
 import {
1
 import {
2
     NativeModules,
2
     NativeModules,
3
-    NativeEventEmitter,
4
-    EmitterSubscription
3
+    NativeEventEmitter
5
 } from 'react-native';
4
 } from 'react-native';
6
 
5
 
7
 import {
6
 import {
8
-    Option, VideoOption,
9
-    EventScheduler,
10
-    PublisherConfig,
11
-    LiveTranscoding, Callback,
7
+    Option, Callback,
12
     String, Number
8
     String, Number
13
 } from "./types.d";
9
 } from "./types.d";
14
 
10
 
19
 /**
15
 /**
20
  * @class RtcEngine
16
  * @class RtcEngine
21
  */
17
  */
22
-export default class RtcEngine {
23
-
24
-    private static listeners: Array<EmitterSubscription>;
18
+const RtcEngine = { ...Agora,
19
+    eventTypes: new Set(),
25
     /**
20
     /**
26
-     * init AgoraRtcEngine
21
+     * init agora rtc engine and begin subscribe event immediately
27
      * @param options: Option
22
      * @param options: Option
28
      */
23
      */
29
-    static init(options: Option): void {
30
-        this.removeEmitter();
24
+    init(options: Option): void {
31
         Agora.init(options);
25
         Agora.init(options);
32
-        this.listeners = [];
33
-    }
26
+    },
34
 
27
 
35
     /**
28
     /**
36
      * join channel
29
      * join channel
40
      * @param info Object extra info
33
      * @param info Object extra info
41
      * @return Promise
34
      * @return Promise
42
      */
35
      */
43
-    static joinChannel(channelName: String, uid?: Number, token?: String, info?: Object): void {
36
+    joinChannel(channelName: String, uid?: Number, token?: String, info?: Object): void {
44
         return Agora.joinChannel({channelName, uid, token, info});
37
         return Agora.joinChannel({channelName, uid, token, info});
45
-    }
38
+    },
46
 
39
 
47
     /**
40
     /**
48
-     * RtcEngine events register
49
-     * @param eventScheduler EventScheduler
41
+     * on - add event listener for react native event
42
+     * @param eventType String
43
+     * @param eventHandler Function
50
      */
44
      */
51
-    static eventEmitter(eventScheduler: EventScheduler) {
52
-        this.removeEmitter();
53
-        // const events = EventSchedulerKeys;
54
-        const events = [
55
-            "onWarning",
56
-            "onError",
57
-            "onJoinChannelSuccess",
58
-            "onRejoinChannelSuccess",
59
-            "onLeaveChannel",
60
-            "onClientRoleChanged",
61
-            "onUserJoined",
62
-            "onUserOffline",
63
-            "onConnectionStateChanged",
64
-            "onConnectionInterrupted",
65
-            "onConnectionLost",
66
-            "onConnectionBanned",
67
-            "onApiCallExecuted",
68
-            "onTokenPrivilegeWillExpire",
69
-            "onRequestToken",
70
-            "onMicrophoneEnabled",
71
-            "onAudioVolumeIndication",
72
-            "onActiveSpeaker",
73
-            "onFirstLocalAudioFrame",
74
-            "onFirstRemoteAudioFrame",
75
-            "onVideoStopped",
76
-            "onFirstLocalVideoFrame",
77
-            "onFirstRemoteVideoDecoded",
78
-            "onFirstRemoteVideoFrame",
79
-            "onUserMuteAudio",
80
-            "onUserMuteVideo",
81
-            "onUserEnableVideo",
82
-            "onUserEnableLocalVideo",
83
-            "onVideoSizeChanged",
84
-            "onRemoteVideoStateChanged",
85
-            "onLocalPublishFallbackToAudioOnly",
86
-            "onRemoteSubscribeFallbackToAudioOnly",
87
-            "onAudioRouteChanged",
88
-            "onCameraReady",
89
-            "onCameraFocusAreaChanged",
90
-            "onCameraExposureAreaChanged",
91
-            "onAudioQuality",
92
-            "onRtcStats",
93
-            "onLastmileQuality",
94
-            "onNetworkQuality",
95
-            "onLocalVideoStats",
96
-            "onRemoteVideoStats",
97
-            "onRemoteAudioStats",
98
-            "onLocalVideoStat",
99
-            "onRemoteVideoStat",
100
-            "onRemoteAudioTransportStats",
101
-            "onRemoteVideoTransportStats",
102
-            "onAudioMixingFinished",
103
-            "onAudioEffectFinished",
104
-            "onStreamPublished",
105
-            "onStreamUnpublished",
106
-            "onTranscodingUpdated",
107
-            "onStreamInjectedStatus",
108
-            "onStreamMessage",
109
-            "onStreamMessageError",
110
-            "onMediaEngineLoadSuccess",
111
-            "onMediaEngineStartCallSuccess",
112
-        ];
113
-        for (let event of events) {
114
-            const functor = (eventScheduler as any)[event];
115
-            if (functor) {
116
-                this.listeners.push(
117
-                    AgoraEventEmitter.addListener(event, msg => {
118
-                        functor(msg);
119
-                    })
120
-                );
121
-            }
122
-        }
123
-    }
45
+    on(eventType: string, listener: (...args: any[]) => any) {
46
+        this.eventTypes.add(eventType);
47
+        AgoraEventEmitter.addListener(eventType, listener);
48
+    },
124
 
49
 
125
     /**
50
     /**
126
-     * remove emitter
51
+     * off - remove event listener for react native event
52
+     * @param eventType 
53
+     * @param listener 
127
      */
54
      */
128
-    static removeEmitter() {
129
-        if (this.listeners && this.listeners.length > 0) {
130
-            for (let listener of this.listeners) {
131
-                listener.remove();
132
-                this.listeners = [];
133
-            }
134
-        }
135
-    }
55
+    off(eventType: string) {
56
+        AgoraEventEmitter.removeAllListeners(eventType);
57
+        this.eventTypes.delete(eventType);
58
+    },
136
 
59
 
137
     /**
60
     /**
138
-     * enableLastmileTest
139
-     * @return Promise
61
+     * removeAllListeners
140
      */
62
      */
141
-    static enableLastmileTest() {
142
-        return Agora.enableLastmileTest();
143
-    }
144
-
145
-    /**
146
-     * disableLastmileTest
147
-     * @return Promise
148
-     */
149
-    static disableLastmileTest() {
150
-        return Agora.disableLastmileTest();
151
-    }
152
-
153
-    /**
154
-     * leaveChannel
155
-     * @return Promise
156
-     */  
157
-    static leaveChannel() {
158
-        return Agora.leaveChannel();
159
-    }
63
+    removeAllListeners () {
64
+        for (let eventType of this.eventTypes) {
65
+            this.off(eventType);
66
+        }
67
+        this.eventTypes.clear();
68
+    },
160
 
69
 
161
     /**
70
     /**
162
      * destroy AgoraRtcEngine
71
      * destroy AgoraRtcEngine
163
-     */  
164
-    static destroy() {
165
-        Agora.destroy();
166
-    }
167
-    
168
-    /**
169
-     * setupLocalVideo
170
-     * @param options: VideoOption
171
-     */  
172
-    static setupLocalVideo(options: VideoOption) {
173
-        Agora.setupLocalVideo(options);
174
-    }
175
-
176
-    /**
177
-     * setupRemoteVideo
178
-     * @param options: VideoOption
179
-     */  
180
-    static setupRemoteVideo(options: VideoOption) {
181
-        Agora.setupRemoteVideo(options);
182
-    }
183
-
184
-    /**
185
-     * start AgoraRtcEngine preview
186
      */
72
      */
187
-    static startPreview() {
188
-        Agora.startPreview();
189
-    }
190
-
191
-    /**
192
-     * stop AgoraRtcEngine preview
193
-     */
194
-    static stopPreview() {
195
-        Agora.stopPreview();
196
-    }
197
-
198
-    /**
199
-     * start live trancoding
200
-     * @param options LiveTranscoding
201
-     */
202
-    static setLiveTranscoding(options: LiveTranscoding) {
203
-        Agora.setLiveTranscoding(options);
204
-    }
205
-
206
-    /**
207
-     * setLocalRenderMode
208
-     * @param mode Number
209
-     */
210
-    static setLocalRenderMode(mode: number) {
211
-        Agora.setLocalRenderMode(mode);
212
-    }
213
-
214
-    /**
215
-     * setRemoteRenderMode
216
-     * @param uid Number
217
-     * @param mode Number
218
-     */
219
-    static setRemoteRenderMode(uid: number, mode: number) {
220
-        Agora.setRemoteRenderMode(uid, mode);
221
-    }
222
-
223
-    /**
224
-     * enableAudioVolumeIndication
225
-     * @param interval Number
226
-     * @param smooth Number
227
-     */
228
-    static enableAudioVolumeIndication(interval: number, smooth: number) {
229
-        Agora.enableAudioVolumeIndication(interval, smooth);
230
-    }
231
-
232
-    /**
233
-     * switch camera
234
-     * @return Promise
235
-     */
236
-    static switchCamera() {
237
-        return Agora.switchCamera();
238
-    }
239
-
240
-    static enableVideo() {
241
-        Agora.enableVideo();
242
-    }
243
-
244
-    static disableVideo() {
245
-        Agora.disableVideo();
246
-    }
247
-
248
-    /**
249
-     * setEnableSpeakerphone
250
-     * @param status Boolena
251
-     */
252
-    static setEnableSpeakerphone(status: boolean) {
253
-        Agora.setEnableSpeakerphone(status);
254
-    }
255
-
256
-    /**
257
-     * muteLocalAudioStream
258
-     * @param status Boolena
259
-     */
260
-    static muteLocalAudioStream(status: boolean) {
261
-        Agora.muteLocalAudioStream(status);
262
-    }
263
-
264
-    /**
265
-     * muteRemoteAudioStream
266
-     * @param uid Number
267
-     * @param status Boolean
268
-     */
269
-    static muteRemoteAudioStream(uid: number, status: boolean) {
270
-        Agora.muteRemoteAudioStream(uid, status);
271
-    }
272
-
273
-    /**
274
-     * muteAllRemoteAudioStreams
275
-     * @param status Boolean
276
-     */
277
-    static muteAllRemoteAudioStreams(status: boolean) {
278
-        Agora.muteAllRemoteAudioStreams(status);
279
-    }
280
-
281
-    /**
282
-     * setCameraTorchOn
283
-     * @param status Boolean
284
-     * @return Promise
285
-     */
286
-    static setCameraTorchOn(status: boolean) {
287
-        return Agora.setCameraTorchOn(status);
288
-    }
289
-
290
-    /**
291
-     * setCameraAutoFocusFaceModeEnabled
292
-     * @param status Boolean
293
-     * @return Promise
294
-     */
295
-    static setCameraAutoFocusFaceModeEnabled(status: boolean) {
296
-        return Agora.setCameraAutoFocusFaceModeEnabled(status);
297
-    }
298
-
299
-    /**
300
-     * setDefaultAudioRouteToSpeakerphone
301
-     * @param status Boolean
302
-     * @return Promise
303
-     */
304
-    static setDefaultAudioRouteToSpeakerphone(status: boolean) {
305
-        Agora.setDefaultAudioRouteToSpeakerphone(status);
306
-    }
307
-
308
-    /**
309
-     * muteLocalVideoStream
310
-     * @param status Boolean
311
-     */
312
-    static muteLocalVideoStream(status: boolean) {
313
-        Agora.muteLocalVideoStream(status);
314
-    }
315
-
316
-    /**
317
-     * enableLocalVideo
318
-     * @param status Boolean
319
-     */
320
-    static enableLocalVideo(status: boolean) {
321
-        Agora.enableLocalVideo(status);
322
-    }
323
-
324
-    /**
325
-     * muteAllRemoteVideoStreams
326
-     * @param status Boolean
327
-     */
328
-    static muteAllRemoteVideoStreams(status: boolean) {
329
-        Agora.muteAllRemoteVideoStreams(status);
330
-    }
331
-
332
-    /**
333
-     * muteRemoteVideoStream
334
-     * @param status Boolean
335
-     */
336
-    static muteRemoteVideoStream(uid: number, status: boolean) {
337
-        Agora.muteRemoteVideoStream(uid, status);
338
-    }
339
-
340
-    /**
341
-     * createDataStream
342
-     * @param reliable Boolean
343
-     * @param ordered Boolean
344
-     * @return Promise
345
-     */
346
-    static createDataStream(reliable: boolean, ordered: boolean) {
347
-        return Agora.createDataStream({reliable, ordered});
348
-    }
349
-
350
-    /**
351
-     * sendStreamMessage
352
-     * @param reliable Boolean
353
-     * @param ordered Boolean
354
-     * @return Promise
355
-     */
356
-    static sendStreamMessage(streamId: number, data: any) {
357
-        return Agora.sendStreamMessage(streamId, data);
358
-    }
73
+    destroy() {
74
+        Agora.destroy();
75
+    },
359
 
76
 
360
     /**
77
     /**
361
      * getSdkVersion
78
      * getSdkVersion
362
      * @param callback Function
79
      * @param callback Function
363
      */
80
      */
364
-    static getSdkVersion(callback: Callback<void>) {
81
+    getSdkVersion(callback: Callback<void>) {
365
         Agora.getSdkVersion().then(callback);
82
         Agora.getSdkVersion().then(callback);
366
     }
83
     }
367
 };
84
 };
85
+
86
+export default RtcEngine;

+ 5
- 0
src/types.d.ts View File

91
   reactTag: number
91
   reactTag: number
92
 }
92
 }
93
 
93
 
94
+export interface AudioRecordingOption {
95
+  filePath: String,
96
+  quality: Number
97
+}
98
+
94
 export interface EventScheduler {
99
 export interface EventScheduler {
95
   onWarning: Function,
100
   onWarning: Function,
96
  
101