Browse Source

update. docs

matrixbirds 5 years ago
parent
commit
06ef99ca4b
3 changed files with 143 additions and 47 deletions
  1. 105
    12
      README.md
  2. 28
    14
      android/src/main/java/com/syan/agora/AgoraModule.java
  3. 10
    21
      ios/RCTAgora/RCTAgora.m

+ 105
- 12
README.md View File

@@ -46,18 +46,20 @@ Either way, then link with:
46 46
 
47 47
 [Agora.io API DOCS](https://docs.agora.io/en/Video/API%20Reference/java/index.html)
48 48
 
49
-##### RtcEngine方法
49
+##### RtcEngine Methods
50 50
 
51 51
 | Property                         | Arguments                                     | Description                           |
52 52
 | -------------------------------- | ---------------------------------------- | ------------------------------------- |
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 |
53
+| init | [Option](#Option) | create and initialize AgoraRtcEngine instance, notice: invoke this method, it will start subscribe events |
54
+| Promise<any> joinChannel | String channelName, Number uid, String? token, String? extraInfo | join channel|
55
+| on | [Events](#Events), Handler: Function | addEventListener for native module events |
56
+| off | [Events](#Events) | removeEventListeners for native module events |
57
+| removeAllListeners | void | remove all event listeners |
58
+| destroy | void | destroy AgoraRtcEngine instance |
59
+| getSdkVersion | Function: callback | get sdk version |
57 60
 | Promise<any> enableLastmileTest | void | enable network quality test |
58 61
 | Promise<any> disableLastmileTest | void | disable network quality test |
59 62
 | Promise<any> leaveChannel | void | quit channel |
60
-| destroy | void | destroy AgoraRtcEngine instance |
61 63
 | setupLocalVideo | Number: uid, Number: renderMode, Number: reactTag | setup local video |
62 64
 | setupRemoteVideo | Number: uid, Number: renderMode, Number: reactTag | setup remote video |
63 65
 | startPreview | void | open video preview |
@@ -70,9 +72,9 @@ Either way, then link with:
70 72
 | enableVideo | void | enable video  |
71 73
 | disableVideo | void | disable video |
72 74
 | setEnableSpeakerphone | Boolean: enabled | set enable speaker phone |
73
-| setCameraAutoFocusFaceModeEnabled | Boolean: enabled | set camera auto focus face mode |
75
+| Promise<any> setCameraAutoFocusFaceModeEnabled | Boolean: enabled | set camera auto focus face mode |
74 76
 | setDefaultAudioRouteToSpeakerphone | Boolean: enabled | set default audio route to speaker phone |
75
-| setCameraTorchOn  | Boolean: enabled | set camera torch on |
77
+| Promise<any> setCameraTorchOn  | Boolean: enabled | set camera torch on |
76 78
 | muteLocalAudioStream  | Boolean: enabled | mute/unmute local audio |
77 79
 | muteRemoteAudioStream  | Number: uid, Boolean: enabled | mute/unmute remote audio by uid |
78 80
 | muteAllRemoteAudioStreams | Boolean: enabled | mute/unmute all remote audio |
@@ -80,10 +82,82 @@ Either way, then link with:
80 82
 | enableLocalVideo | Boolean: enabled | set enabled status to local video |
81 83
 | muteAllRemoteVideoStreams | void | mute/unmute all remote videos |
82 84
 | 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
-
85
+| Promise<any> createDataStream | Boolean: reliable, Boolean: ordered | createDataStream |
86
+| Promise<any> renewToken | String: token | renew token |
87
+| Promise<any> getConnectionState | void | return connection state |
88
+| setClientRole | Number: role(1: host, 2: audience) | change client role |
89
+| enableAudio | void | enable audio |
90
+| disableAudio | void | disable audio |
91
+| enableLocalAudio | Boolean: enable | enable/disable local audio |
92
+| muteLocalAudioStream | Boolean: mute | enable/disable local audio stream |
93
+| muteAllRemoteAudioStreams | Boolean: mute | enable/disable all remote audio streams |
94
+| muteRemoteAudioStream | Number: uid, Boolean: mute | mute/unmute remote audio stream by uid |
95
+| adjustRecordingSignalVolume | Number: volume | Adjusts the recording volume. |
96
+| adjustPlaybackSignalVolume | Number: volume | Adjusts the playback volume. |
97
+| 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. |
98
+| Promise<any> startAudioRecording | {filePath: String, quality: int} | start audio recording |
99
+| Promise<any> stopAudioRecoding | void | stop audio recording |
100
+| methodisSpeakerphoneEnabled | void | Checks whether the speakerphone is enabled.|| enableInEarMonitoring | Boolean: enabled | enable/disable in-ear monitoring | 
101
+| setInEarMonitoringVolume | Number: volume | Sets the volume of the in-ear monitor. |
102
+| setLocalVoicePitch | Number(double): pitch | Changes the voice pitch of the local speaker. |
103
+| setLocalVoiceEqualization | Number: bandFrequency, Number: bandGain | Sets the local voice equalization effect. |
104
+| setLocalVoiceReverb | Number: reverbKey, Number: value | Sets the local voice reverberation.|
105
+| 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)
106
+ & [ios](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/startAudioMixing:loopback:replace:cycle:) |
107
+ | stopAudioMixing | void | stop audio mixing |
108
+ | 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) |
109
+ | resumeAudioMixing | void | resume audio mixing |
110
+ | adjustAudioMixingVolume | Number: volume | adjust audio mixing volume, call this method when you are in a channel |
111
+ | adjustAudioMixingPlayoutVolume | Number: volume | adjust audio mixing playout volume, call this method when you are in a channel |
112
+ | adjustAudioMixingPublishVolume | Number: volume | Adjusts the volume of audio mixing for publishing (sending to other users). call this method when you are in a channel. |
113
+ | Promise<any> getAudioMixingDuration | void | Gets the duration (ms) of the music file. Call this method when you are in a channel. |
114
+ | Promise<any> getAudioMixingCurrentPosition | void | Gets the playback position (ms) of the music file. Call this method when you are in a channel. |
115
+ | 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). |
116
+ | Promise<any> getEffectsVolume | void | Retrieves the volume of the audio effects. |
117
+ | Promise<any> setEffectsVolume | Number(double): volume | Sets the volume of the audio effects. |
118
+ | Promise<any> setVolumeOfEffect | Number: soundId, Number(double): volume | Sets the volume of a specified audio effect. |
119
+ | 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:) |
120
+ | Promise<any> stopEffect | Number: soundId | Stops playing a specified audio effect. |
121
+ | Promise<any> stopAllEffects | void | Stops all playing audio effects. |
122
+ | Promise<any> preloadEffect | Number: soundid, String: filepath | Preloads a specified audio effect file into the memory. Supported audio formats: mp3, aac, m4a, 3gp, wav.|
123
+ | Promise<any> unloadEffect | Number: soundId | Releases a specified preloaded audio effect from the memory. |
124
+ | Promise<any> pauseEffect | Number: soundId | Pauses a specified audio effect. |
125
+ | Promise<any> pauseAllEffects | void | Pauses all audio effects. |
126
+ | Promise<any> resumeEffect | void | Resumes playing a specified audio effect. |
127
+ | Promise<any> resumeAllEffects | void | Resumes playing all audio effects. |
128
+ | setAudioSessionOperationRestriction | void | [ios only](https://docs.agora.io/en/Voice/API%20Reference/oc/Classes/AgoraRtcEngineKit.html#//api/name/setAudioSessionOperationRestriction:) |
129
+ | Promise<any> startEchoTest | void | Starts an audio call test. |
130
+ | Promise<any> stopEchoTest | void | Stop the audio call test. |
131
+ | Promise<any> setRecordingAudioFrameParameters | {sampleRate: Number, channel: Number, mode: Number, samplesPerCall: Number } | Sets the audio recording format for the RecordFrame callback.  |
132
+ | Promise<any> setPlaybackAudioFrameParameters | {sampleRate: Number, channel: Number, mode: Number, samplesPerCall: Number } | Sets the audio playback format for the onPlaybackFrame callback. |
133
+ | Promise<any> addVideoWatermark | {url: String, x: Number, y: Number, width: Number, height: Number } | add video watermark |
134
+ | clearVideoWatermarks | void | remove the watermark image from the video stream added by addVideoWatermark |
135
+ | 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:) |
136
+ | 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:) |
137
+ | Promise<any> enableDualStreamMode | Boolean: enabled | Enables/disables dual-stream mode. |
138
+ | setRemoteVideoStreamType | { uid: Number, streamType: Number } | Sets the video stream type of the remotely subscribed video stream. |
139
+ | setRemoteDefaultVideoStreamType | { streamType: Number } | Sets the default video stream type of the remotely subscribed video stream. |
140
+ | Promise<any> addInjectStreamUrl | [InjectionStream](#InjectionStream) | Injects an online media stream to a live broadcast. |
141
+ | Promise<any> removePublishStreamUrl | String: url | Removes a CDN live stream URL address. |
142
+ | Promise<any> setVideoQualityParameters | Boolean: quality | 
143
+Sets the preference option for the video quality (Live broadcast only). |
144
+ | Promise<any> setLocalVideoMirrorMode | Number: mode | Sets the local video mirror mode. |
145
+ | Promise<any> switchCamera | void | Switches between front and rear cameras. | 
146
+ | Promise<any> isCameraZoomSupported | void | Checks whether the camera zoom function is supported. |
147
+ | Promise<any> isCameraTorchSupported	| void | Checks whether the camera flash function is supported. |
148
+ | Promise<any> isCameraFocusSupported	| void | Checks whether the camera manual focus function is supported. |
149
+ | Promise<any> isCameraExposurePositionSupported | void |Checks whether the camera exposure function is supported. |
150
+ | Promise<any> isCameraAutoFocusFaceModeSupported | void | Checks whether the camera face auto-focus function is supported. |
151
+ | Promise<any> setCameraZoomFactor | Number(float): zoomFactor |	Sets the camera zoom ratio. |
152
+ | 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) |
153
+ | Promise<any>  setCameraFocusPositionInPreview | {x: Number(double), y: Number(double) } | Sets the camera manual focus position.|
154
+ | Promise<any>  setCameraExposurePosition | {x: Number(double), y: Number(double) } |	Sets the camera exposure position.|
155
+ | Promise<any>  setCameraTorchOn | Boolean isOn | Enables the camera flash function. |
156
+ | Promise<any>  setCameraAutoFocusFaceModeEnabled | Boolean enabled | Enables the camera auto-face focus function. |
157
+ | Promise<any> getCallId | void | getcalll id |
158
+ | Promise<any> setLog | filePath: String, level: Number | specifies an SDK output log file. |
159
+ | addPublishStreamUrl | { url: String, enabled: Boolean } | Adds a CDN live stream URL address. it must be invoked after invoking setLiveTranscoding |
160
+ | removePublishStreamUrl | { url: String } | Removes a CDN live stream URL address. |
87 161
 
88 162
 #### Option
89 163
 ```typescript
@@ -126,6 +200,25 @@ export interface LiveTranscoding {
126 200
 }
127 201
 ```
128 202
 
203
+
204
+#### InjectionStream
205
+```typescript
206
+export interface InjectionStream {
207
+  config: {
208
+    size: {
209
+      width: Number,
210
+      height: Number,
211
+    },
212
+    videoGop: Number,
213
+    videoBitrate: Number,
214
+    audioBitrate: Number,
215
+    audioSampleRate: Number,
216
+    videoFrameRate: Number
217
+    audioChannels: Number
218
+  }
219
+}
220
+```
221
+
129 222
 #### Events
130 223
 
131 224
 ```javascript

+ 28
- 14
android/src/main/java/com/syan/agora/AgoraModule.java View File

@@ -1093,7 +1093,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
1093 1093
                            Promise promise) {
1094 1094
         try {
1095 1095
             int res = AgoraManager.getInstance().renewToken(token);
1096
-            if (res != 0) throw new ReactNativeAgoraException("renewToken Failed", res);
1096
+            if (res != 0) throw new ReactNativeAgoraException("renew token failed", res);
1097 1097
             WritableMap map = Arguments.createMap();
1098 1098
             map.putBoolean("success", true);
1099 1099
             promise.resolve(map);
@@ -1365,6 +1365,19 @@ public class AgoraModule extends ReactContextBaseJavaModule {
1365 1365
         }
1366 1366
     }
1367 1367
 
1368
+    @ReactMethod
1369
+    public void getCameraMaxZoomFactor(Promise promise) {
1370
+        try {
1371
+            int res = AgoraManager.getInstance().mRtcEngine.getCameraMaxZoomFactor();
1372
+            WritableMap map = Arguments.createMap();
1373
+            map.putBoolean("success", true);
1374
+            map.putInt("value", res);
1375
+            promise.resolve(map);
1376
+        } catch (Exception e) {
1377
+            promise.reject(e);
1378
+        }
1379
+    }
1380
+
1368 1381
     @ReactMethod
1369 1382
     public void setCameraFocusPositionInPreview(ReadableMap options, Promise promise) {
1370 1383
         try {
@@ -1417,7 +1430,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
1417 1430
     public void setCameraAutoFocusFaceModeEnabled(boolean enabled, Promise promise) {
1418 1431
         try {
1419 1432
             int res = AgoraManager.getInstance().mRtcEngine.setCameraAutoFocusFaceModeEnabled(enabled);
1420
-            if (res != 0) throw new ReactNativeAgoraException("setCameraTorchOn Failed", res);
1433
+            if (res != 0) throw new ReactNativeAgoraException("setCameraAutoFocusFaceModeEnabled Failed", res);
1421 1434
             WritableMap map = Arguments.createMap();
1422 1435
             map.putBoolean("success", true);
1423 1436
             map.putInt("value", res);
@@ -1833,7 +1846,7 @@ public class AgoraModule extends ReactContextBaseJavaModule {
1833 1846
     public void disableLastmileTest(Promise promise) {
1834 1847
         try {
1835 1848
             int res = AgoraManager.getInstance().mRtcEngine
1836
-                    .enableLastmileTest();
1849
+                    .disableLastmileTest();
1837 1850
             if (res != 0) throw new ReactNativeAgoraException("disableLastmileTest Failed", res);
1838 1851
             WritableMap map = Arguments.createMap();
1839 1852
             map.putBoolean("success", true);
@@ -2077,21 +2090,22 @@ public class AgoraModule extends ReactContextBaseJavaModule {
2077 2090
     @ReactMethod
2078 2091
     public void addInjectStreamUrl(ReadableMap options, Promise promise) {
2079 2092
         try {
2080
-            LiveInjectStreamConfig config = new LiveInjectStreamConfig();
2081
-            config.width = options.getInt("width");
2082
-            config.height = options.getInt("height");
2083
-            config.videoGop = options.getInt("videoGop");
2084
-            config.videoBitrate = options.getInt("videoBitrate");
2085
-            config.videoFramerate = options.getInt("videoFramerate");
2086
-            config.audioBitrate = options.getInt("audioBitrate");
2087
-            config.audioSampleRate = getAudioSampleRateEnum(options.getInt("audioSampleRate"));
2088
-            config.audioChannels = options.getInt("audioChannels");
2089
-
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");
2090 2104
 
2091 2105
             int res = AgoraManager.getInstance().mRtcEngine
2092 2106
                     .addInjectStreamUrl(
2093 2107
                             options.getString("url"),
2094
-                            config
2108
+                            injectstream
2095 2109
                     );
2096 2110
             if (res != 0) throw new ReactNativeAgoraException("addInjectStreamUrl Failed", res);
2097 2111
             WritableMap map = Arguments.createMap();

+ 10
- 21
ios/RCTAgora/RCTAgora.m View File

@@ -151,9 +151,9 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
151 151
   
152 152
   [AgoraConst share].rtcEngine = self.rtcEngine;
153 153
   
154
-  //频道模式
154
+  //channel mode
155 155
   [self.rtcEngine setChannelProfile:[options[@"channelProfile"] integerValue]];
156
-  //启用双流模式
156
+  //enable dual stream
157 157
   [self.rtcEngine enableDualStreamMode:YES];
158 158
   [self.rtcEngine enableVideo];
159 159
   
@@ -170,7 +170,7 @@ RCT_EXPORT_METHOD(init:(NSDictionary *)options) {
170 170
   [self.rtcEngine setAudioProfile:(AgoraAudioProfile)[options[@"audioProfile"] integerValue]
171 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 174
   [self.rtcEngine enableWebSdkInteroperability:YES];
175 175
 }
176 176
 
@@ -219,7 +219,7 @@ RCT_EXPORT_METHOD(getConnectionState
219 219
 }
220 220
 
221 221
 // set client role
222
-RCT_EXPORT_METHOD(setClientRole:(NSString *) role) {
222
+RCT_EXPORT_METHOD(setClientRole:(NSInteger) role) {
223 223
   [self.rtcEngine setClientRole:(AgoraClientRole)role];
224 224
 }
225 225
 
@@ -396,16 +396,6 @@ RCT_EXPORT_METHOD(muteRemoteAudioStream:(NSUInteger)uid muted:(BOOL)mute){
396 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 399
 // adjust recorcding signal volume
410 400
 RCT_EXPORT_METHOD(adjustRecordingSignalVolume: (NSInteger) volume){
411 401
   [self.rtcEngine adjustRecordingSignalVolume:volume];
@@ -692,7 +682,7 @@ RCT_EXPORT_METHOD(playEffect
692 682
                                    loopCount:(int)[options[@"loopCount"] integerValue]
693 683
                                        pitch:[options[@"pitch"] doubleValue]
694 684
                                          pan:[options[@"pan"] doubleValue]
695
-                                        gain:[options[@"gain"] boolValue]
685
+                                        gain:[options[@"gain"] doubleValue]
696 686
                                      publish:[options[@"publish"] boolValue]];
697 687
   if (res != 0) {
698 688
     reject(@"131010", @"playEffect failed", [self makeNSError:@{
@@ -1052,7 +1042,7 @@ RCT_EXPORT_METHOD(disableLastmileTest
1052 1042
 }
1053 1043
 
1054 1044
 // set recording audioframe parameters with samplerate
1055
-RCT_EXPORT_METHOD(setRecordingAudioFrameParametersWithSampleRate:(NSDictionary *) options
1045
+RCT_EXPORT_METHOD(setRecordingAudioFrameParameters:(NSDictionary *) options
1056 1046
                   resolve:(RCTPromiseResolveBlock)resolve
1057 1047
                   reject:(RCTPromiseRejectBlock)reject) {
1058 1048
   NSInteger res = [self.rtcEngine setRecordingAudioFrameParametersWithSampleRate:[options[@"sampleRate"] integerValue]
@@ -1061,7 +1051,7 @@ RCT_EXPORT_METHOD(setRecordingAudioFrameParametersWithSampleRate:(NSDictionary *
1061 1051
                                                                   samplesPerCall:[options[@"samplesPerCall"] integerValue]
1062 1052
                    ];
1063 1053
   if (res != 0) {
1064
-    reject(@"131023", @"setRecordingAudioFrameParametersWithSampleRate failed", [self makeNSError:@{
1054
+    reject(@"131023", @"setRecordingAudioFrameParameters failed", [self makeNSError:@{
1065 1055
                                                                                                     @"code": @(131023),
1066 1056
                                                                                                     @"message":@{
1067 1057
                                                                                                         @"success": @(NO),
@@ -1077,7 +1067,7 @@ RCT_EXPORT_METHOD(setRecordingAudioFrameParametersWithSampleRate:(NSDictionary *
1077 1067
 }
1078 1068
 
1079 1069
 // set playback audioframe parameters with samplerate
1080
-RCT_EXPORT_METHOD(setPlaybackAudioFrameParametersWithSampleRate:(NSDictionary *) options
1070
+RCT_EXPORT_METHOD(setPlaybackAudioFrameParameters:(NSDictionary *) options
1081 1071
                   resolve:(RCTPromiseResolveBlock)resolve
1082 1072
                   reject:(RCTPromiseRejectBlock)reject) {
1083 1073
   NSInteger res = [self.rtcEngine setPlaybackAudioFrameParametersWithSampleRate:[options[@"sampleRate"] integerValue]
@@ -1086,7 +1076,7 @@ RCT_EXPORT_METHOD(setPlaybackAudioFrameParametersWithSampleRate:(NSDictionary *)
1086 1076
                                                                  samplesPerCall:[options[@"samplesPerCall"] integerValue]
1087 1077
                    ];
1088 1078
   if (res != 0) {
1089
-    reject(@"131024", @"setPlaybackAudioFrameParametersWithSampleRate failed", [self makeNSError:@{
1079
+    reject(@"131024", @"setPlaybackAudioFrameParameters failed", [self makeNSError:@{
1090 1080
                                                                                                    @"code": @(131024),
1091 1081
                                                                                                    @"message":@{
1092 1082
                                                                                                        @"success":@(NO),
@@ -1472,7 +1462,7 @@ RCT_EXPORT_METHOD(setCameraFocusPositionInPreview
1472 1462
 RCT_EXPORT_METHOD(setCameraExposurePosition
1473 1463
                   :(NSDictionary *)options
1474 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 1466
   resolve(@{
1477 1467
             @"success": @(YES),
1478 1468
             @"value": @(res)
@@ -1579,7 +1569,6 @@ RCT_EXPORT_METHOD(getSdkVersion
1579 1569
 // add publish stream url
1580 1570
 RCT_EXPORT_METHOD(addPublishStreamUrl:(NSDictionary *)options) {
1581 1571
   [self.rtcEngine addPublishStreamUrl:options[@"url"] transcodingEnabled:[options[@"enable"] boolValue]];
1582
-  [self.rtcEngine setLiveTranscoding:AgoraLiveTranscoding.defaultTranscoding];
1583 1572
 }
1584 1573
 
1585 1574
 // remove publish stream url