Browse Source

release 2.3.3-alpha.4

matrixbirds 5 years ago
parent
commit
d3e92ad07b

+ 3
- 0
lib/AgoraView.native.js View File

@@ -4,6 +4,9 @@ const tslib_1 = require("tslib");
4 4
 const react_1 = tslib_1.__importDefault(require("react"));
5 5
 const react_native_1 = require("react-native");
6 6
 const RCTAgoraView = react_native_1.requireNativeComponent("RCTAgoraView");
7
+/**
8
+ * @class AgoraView
9
+ */
7 10
 class AgoraView extends react_1.default.Component {
8 11
     render() {
9 12
         return (react_1.default.createElement(RCTAgoraView, Object.assign({}, this.getHTMLProps())));

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

@@ -1 +1 @@
1
-{"version":3,"file":"AgoraView.native.js","sourceRoot":"","sources":["../src/AgoraView.native.tsx"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,+CAEqB;AAMrB,MAAM,YAAY,GAAG,qCAAsB,CAAC,cAAc,CAAC,CAAC;AAE5D,MAAqB,SAAU,SAAQ,eAAK,CAAC,SAAyB;IAC3D,MAAM;QACT,OAAO,CACH,8BAAC,YAAY,oBAAM,IAAI,CAAC,YAAY,EAAE,EAAK,CAC9C,CAAA;IACL,CAAC;IAEO,YAAY;QAChB,IAAI,SAAS,GAAG,EAAoB,CAAC;QACrC,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAdD,4BAcC"}
1
+{"version":3,"file":"AgoraView.native.js","sourceRoot":"","sources":["../src/AgoraView.native.tsx"],"names":[],"mappings":";;;AAAA,0DAA0B;AAC1B,+CAEqB;AAMrB,MAAM,YAAY,GAAG,qCAAsB,CAAC,cAAc,CAAC,CAAC;AAE5D;;GAEG;AACH,MAAqB,SAAU,SAAQ,eAAK,CAAC,SAAyB;IAC3D,MAAM;QACT,OAAO,CACH,8BAAC,YAAY,oBAAM,IAAI,CAAC,YAAY,EAAE,EAAK,CAC9C,CAAA;IACL,CAAC;IAEO,YAAY;QAChB,IAAI,SAAS,GAAG,EAAoB,CAAC;QACrC,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE;YACxB,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SACpC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ;AAdD,4BAcC"}

+ 139
- 2
lib/RtcEngine.native.js View File

@@ -3,15 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
3 3
 const react_native_1 = require("react-native");
4 4
 const { Agora } = react_native_1.NativeModules;
5 5
 const AgoraEventEmitter = new react_native_1.NativeEventEmitter(Agora);
6
+/**
7
+ * @class RtcEngine
8
+ */
6 9
 class RtcEngine {
10
+    /**
11
+     * init AgoraRtcEngine
12
+     * @param options: Option
13
+     */
7 14
     static init(options) {
8 15
         this.removeEmitter();
9 16
         Agora.init(options);
10 17
         this.listeners = [];
11 18
     }
19
+    /**
20
+     * join channel
21
+     * @param channelName String for channel name
22
+     * @param uid Number user id is optional
23
+     * @param token String secure token
24
+     * @param info Object extra info
25
+     * @return Promise
26
+     */
12 27
     static joinChannel(channelName, uid, token, info) {
13 28
         return Agora.joinChannel({ channelName, uid, token, info });
14 29
     }
30
+    /**
31
+     * RtcEngine events register
32
+     * @param eventScheduler EventScheduler
33
+     */
15 34
     static eventEmitter(eventScheduler) {
16 35
         this.removeEmitter();
17 36
         // const events = EventSchedulerKeys;
@@ -83,6 +102,9 @@ class RtcEngine {
83 102
             }
84 103
         }
85 104
     }
105
+    /**
106
+     * remove emitter
107
+     */
86 108
     static removeEmitter() {
87 109
         if (this.listeners && this.listeners.length > 0) {
88 110
             for (let listener of this.listeners) {
@@ -91,42 +113,93 @@ class RtcEngine {
91 113
             }
92 114
         }
93 115
     }
116
+    /**
117
+     * enableLastmileTest
118
+     * @return Promise
119
+     */
94 120
     static enableLastmileTest() {
95 121
         return Agora.enableLastmileTest();
96 122
     }
123
+    /**
124
+     * disableLastmileTest
125
+     * @return Promise
126
+     */
97 127
     static disableLastmileTest() {
98 128
         return Agora.disableLastmileTest();
99 129
     }
130
+    /**
131
+     * leaveChannel
132
+     * @return Promise
133
+     */
100 134
     static leaveChannel() {
101 135
         return Agora.leaveChannel();
102 136
     }
137
+    /**
138
+     * destroy AgoraRtcEngine
139
+     */
103 140
     static destroy() {
104 141
         Agora.destroy();
105 142
     }
143
+    /**
144
+     * setupLocalVideo
145
+     * @param options: VideoOption
146
+     */
106 147
     static setupLocalVideo(options) {
107 148
         Agora.setupLocalVideo(options);
108 149
     }
150
+    /**
151
+     * setupRemoteVideo
152
+     * @param options: VideoOption
153
+     */
109 154
     static setupRemoteVideo(options) {
110 155
         Agora.setupRemoteVideo(options);
111 156
     }
157
+    /**
158
+     * start AgoraRtcEngine preview
159
+     */
112 160
     static startPreview() {
113 161
         Agora.startPreview();
114 162
     }
163
+    /**
164
+     * stop AgoraRtcEngine preview
165
+     */
115 166
     static stopPreview() {
116 167
         Agora.stopPreview();
117 168
     }
169
+    /**
170
+     * start live trancoding
171
+     * @param options LiveTranscoding
172
+     */
118 173
     static setLiveTranscoding(options) {
119 174
         Agora.setLiveTranscoding(options);
120 175
     }
176
+    /**
177
+     * setLocalRenderMode
178
+     * @param mode Number
179
+     */
121 180
     static setLocalRenderMode(mode) {
122 181
         Agora.setLocalRenderMode(mode);
123 182
     }
183
+    /**
184
+     * setRemoteRenderMode
185
+     * @param uid Number
186
+     * @param mode Number
187
+     */
124 188
     static setRemoteRenderMode(uid, mode) {
125 189
         Agora.setRemoteRenderMode(uid, mode);
126 190
     }
191
+    /**
192
+     * enableAudioVolumeIndication
193
+     * @param interval Number
194
+     * @param smooth Number
195
+     */
127 196
     static enableAudioVolumeIndication(interval, smooth) {
128 197
         Agora.enableAudioVolumeIndication(interval, smooth);
129 198
     }
199
+    /**
200
+     * switch camera
201
+     * @return Promise
202
+     */
130 203
     static switchCamera() {
131 204
         return Agora.switchCamera();
132 205
     }
@@ -136,45 +209,109 @@ class RtcEngine {
136 209
     static disableVideo() {
137 210
         Agora.disableVideo();
138 211
     }
212
+    /**
213
+     * setEnableSpeakerphone
214
+     * @param status Boolena
215
+     */
139 216
     static setEnableSpeakerphone(status) {
140 217
         Agora.setEnableSpeakerphone(status);
141 218
     }
219
+    /**
220
+     * muteLocalAudioStream
221
+     * @param status Boolena
222
+     */
142 223
     static muteLocalAudioStream(status) {
143 224
         Agora.muteLocalAudioStream(status);
144 225
     }
226
+    /**
227
+     * muteRemoteAudioStream
228
+     * @param uid Number
229
+     * @param status Boolean
230
+     */
145 231
     static muteRemoteAudioStream(uid, status) {
146 232
         Agora.muteRemoteAudioStream(uid, status);
147 233
     }
234
+    /**
235
+     * muteAllRemoteAudioStreams
236
+     * @param status Boolean
237
+     */
148 238
     static muteAllRemoteAudioStreams(status) {
149 239
         Agora.muteAllRemoteAudioStreams(status);
150 240
     }
241
+    /**
242
+     * setCameraTorchOn
243
+     * @param status Boolean
244
+     * @return Promise
245
+     */
151 246
     static setCameraTorchOn(status) {
152 247
         return Agora.setCameraTorchOn(status);
153 248
     }
249
+    /**
250
+     * setCameraAutoFocusFaceModeEnabled
251
+     * @param status Boolean
252
+     * @return Promise
253
+     */
154 254
     static setCameraAutoFocusFaceModeEnabled(status) {
155 255
         return Agora.setCameraAutoFocusFaceModeEnabled(status);
156 256
     }
257
+    /**
258
+     * setDefaultAudioRouteToSpeakerphone
259
+     * @param status Boolean
260
+     * @return Promise
261
+     */
157 262
     static setDefaultAudioRouteToSpeakerphone(status) {
158 263
         Agora.setDefaultAudioRouteToSpeakerphone(status);
159 264
     }
265
+    /**
266
+     * muteLocalVideoStream
267
+     * @param status Boolean
268
+     */
160 269
     static muteLocalVideoStream(status) {
161 270
         Agora.muteLocalVideoStream(status);
162 271
     }
272
+    /**
273
+     * enableLocalVideo
274
+     * @param status Boolean
275
+     */
163 276
     static enableLocalVideo(status) {
164 277
         Agora.enableLocalVideo(status);
165 278
     }
279
+    /**
280
+     * muteAllRemoteVideoStreams
281
+     * @param status Boolean
282
+     */
166 283
     static muteAllRemoteVideoStreams(status) {
167 284
         Agora.muteAllRemoteVideoStreams(status);
168 285
     }
286
+    /**
287
+     * muteRemoteVideoStream
288
+     * @param status Boolean
289
+     */
169 290
     static muteRemoteVideoStream(uid, status) {
170 291
         Agora.muteRemoteVideoStream(uid, status);
171 292
     }
293
+    /**
294
+     * createDataStream
295
+     * @param reliable Boolean
296
+     * @param ordered Boolean
297
+     * @return Promise
298
+     */
172 299
     static createDataStream(reliable, ordered) {
173
-        return Agora.createDataStream(reliable, ordered);
174
-    }
300
+        return Agora.createDataStream({ reliable, ordered });
301
+    }
302
+    /**
303
+     * sendStreamMessage
304
+     * @param reliable Boolean
305
+     * @param ordered Boolean
306
+     * @return Promise
307
+     */
175 308
     static sendStreamMessage(streamId, data) {
176 309
         return Agora.sendStreamMessage(streamId, data);
177 310
     }
311
+    /**
312
+     * getSdkVersion
313
+     * @param callback Function
314
+     */
178 315
     static getSdkVersion(callback) {
179 316
         Agora.getSdkVersion().then(callback);
180 317
     }

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

@@ -1 +1 @@
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,MAAqB,SAAS;IAG1B,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,MAAM,CAAC,WAAW,CAAC,WAAmB,EAAE,GAAY,EAAE,KAAc,EA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AAa,CAAC,QAAwB;QACzC,KAAK,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;CACJ;AAzVD,4BAyVC;AAAA,CAAC"}

+ 1
- 1
package.json View File

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

+ 3
- 0
src/AgoraView.native.tsx View File

@@ -9,6 +9,9 @@ import {
9 9
 
10 10
 const RCTAgoraView = requireNativeComponent("RCTAgoraView");
11 11
 
12
+/**
13
+ * @class AgoraView
14
+ */
12 15
 export default class AgoraView extends React.Component<AgoraViewProps> {
13 16
     public render(): JSX.Element {
14 17
         return (

+ 138
- 1
src/RtcEngine.native.ts View File

@@ -16,19 +16,38 @@ import {
16 16
 const { Agora } = NativeModules;
17 17
 const AgoraEventEmitter = new NativeEventEmitter(Agora);
18 18
 
19
+/**
20
+ * @class RtcEngine
21
+ */
19 22
 export default class RtcEngine {
20 23
 
21 24
     private static listeners: Array<EmitterSubscription>;
25
+    /**
26
+     * init AgoraRtcEngine
27
+     * @param options: Option
28
+     */
22 29
     static init(options: Option): void {
23 30
         this.removeEmitter();
24 31
         Agora.init(options);
25 32
         this.listeners = [];
26 33
     }
27 34
 
35
+    /**
36
+     * join channel
37
+     * @param channelName String for channel name
38
+     * @param uid Number user id is optional
39
+     * @param token String secure token
40
+     * @param info Object extra info
41
+     * @return Promise
42
+     */
28 43
     static joinChannel(channelName: String, uid?: Number, token?: String, info?: Object): void {
29 44
         return Agora.joinChannel({channelName, uid, token, info});
30 45
     }
31 46
 
47
+    /**
48
+     * RtcEngine events register
49
+     * @param eventScheduler EventScheduler
50
+     */
32 51
     static eventEmitter(eventScheduler: EventScheduler) {
33 52
         this.removeEmitter();
34 53
         // const events = EventSchedulerKeys;
@@ -103,6 +122,9 @@ export default class RtcEngine {
103 122
         }
104 123
     }
105 124
 
125
+    /**
126
+     * remove emitter
127
+     */
106 128
     static removeEmitter() {
107 129
         if (this.listeners && this.listeners.length > 0) {
108 130
             for (let listener of this.listeners) {
@@ -112,54 +134,105 @@ export default class RtcEngine {
112 134
         }
113 135
     }
114 136
 
137
+    /**
138
+     * enableLastmileTest
139
+     * @return Promise
140
+     */
115 141
     static enableLastmileTest() {
116 142
         return Agora.enableLastmileTest();
117 143
     }
118 144
 
145
+    /**
146
+     * disableLastmileTest
147
+     * @return Promise
148
+     */
119 149
     static disableLastmileTest() {
120 150
         return Agora.disableLastmileTest();
121 151
     }
122 152
 
153
+    /**
154
+     * leaveChannel
155
+     * @return Promise
156
+     */  
123 157
     static leaveChannel() {
124 158
         return Agora.leaveChannel();
125 159
     }
126 160
 
161
+    /**
162
+     * destroy AgoraRtcEngine
163
+     */  
127 164
     static destroy() {
128 165
         Agora.destroy();
129 166
     }
130 167
     
168
+    /**
169
+     * setupLocalVideo
170
+     * @param options: VideoOption
171
+     */  
131 172
     static setupLocalVideo(options: VideoOption) {
132 173
         Agora.setupLocalVideo(options);
133 174
     }
134 175
 
176
+    /**
177
+     * setupRemoteVideo
178
+     * @param options: VideoOption
179
+     */  
135 180
     static setupRemoteVideo(options: VideoOption) {
136 181
         Agora.setupRemoteVideo(options);
137 182
     }
138 183
 
184
+    /**
185
+     * start AgoraRtcEngine preview
186
+     */
139 187
     static startPreview() {
140 188
         Agora.startPreview();
141 189
     }
142 190
 
191
+    /**
192
+     * stop AgoraRtcEngine preview
193
+     */
143 194
     static stopPreview() {
144 195
         Agora.stopPreview();
145 196
     }
146 197
 
198
+    /**
199
+     * start live trancoding
200
+     * @param options LiveTranscoding
201
+     */
147 202
     static setLiveTranscoding(options: LiveTranscoding) {
148 203
         Agora.setLiveTranscoding(options);
149 204
     }
150 205
 
206
+    /**
207
+     * setLocalRenderMode
208
+     * @param mode Number
209
+     */
151 210
     static setLocalRenderMode(mode: number) {
152 211
         Agora.setLocalRenderMode(mode);
153 212
     }
154 213
 
214
+    /**
215
+     * setRemoteRenderMode
216
+     * @param uid Number
217
+     * @param mode Number
218
+     */
155 219
     static setRemoteRenderMode(uid: number, mode: number) {
156 220
         Agora.setRemoteRenderMode(uid, mode);
157 221
     }
158 222
 
223
+    /**
224
+     * enableAudioVolumeIndication
225
+     * @param interval Number
226
+     * @param smooth Number
227
+     */
159 228
     static enableAudioVolumeIndication(interval: number, smooth: number) {
160 229
         Agora.enableAudioVolumeIndication(interval, smooth);
161 230
     }
162 231
 
232
+    /**
233
+     * switch camera
234
+     * @return Promise
235
+     */
163 236
     static switchCamera() {
164 237
         return Agora.switchCamera();
165 238
     }
@@ -172,58 +245,122 @@ export default class RtcEngine {
172 245
         Agora.disableVideo();
173 246
     }
174 247
 
248
+    /**
249
+     * setEnableSpeakerphone
250
+     * @param status Boolena
251
+     */
175 252
     static setEnableSpeakerphone(status: boolean) {
176 253
         Agora.setEnableSpeakerphone(status);
177 254
     }
178 255
 
256
+    /**
257
+     * muteLocalAudioStream
258
+     * @param status Boolena
259
+     */
179 260
     static muteLocalAudioStream(status: boolean) {
180 261
         Agora.muteLocalAudioStream(status);
181 262
     }
182 263
 
264
+    /**
265
+     * muteRemoteAudioStream
266
+     * @param uid Number
267
+     * @param status Boolean
268
+     */
183 269
     static muteRemoteAudioStream(uid: number, status: boolean) {
184 270
         Agora.muteRemoteAudioStream(uid, status);
185 271
     }
186 272
 
273
+    /**
274
+     * muteAllRemoteAudioStreams
275
+     * @param status Boolean
276
+     */
187 277
     static muteAllRemoteAudioStreams(status: boolean) {
188 278
         Agora.muteAllRemoteAudioStreams(status);
189 279
     }
190 280
 
281
+    /**
282
+     * setCameraTorchOn
283
+     * @param status Boolean
284
+     * @return Promise
285
+     */
191 286
     static setCameraTorchOn(status: boolean) {
192 287
         return Agora.setCameraTorchOn(status);
193 288
     }
194 289
 
290
+    /**
291
+     * setCameraAutoFocusFaceModeEnabled
292
+     * @param status Boolean
293
+     * @return Promise
294
+     */
195 295
     static setCameraAutoFocusFaceModeEnabled(status: boolean) {
196 296
         return Agora.setCameraAutoFocusFaceModeEnabled(status);
197 297
     }
198 298
 
299
+    /**
300
+     * setDefaultAudioRouteToSpeakerphone
301
+     * @param status Boolean
302
+     * @return Promise
303
+     */
199 304
     static setDefaultAudioRouteToSpeakerphone(status: boolean) {
200 305
         Agora.setDefaultAudioRouteToSpeakerphone(status);
201 306
     }
202 307
 
308
+    /**
309
+     * muteLocalVideoStream
310
+     * @param status Boolean
311
+     */
203 312
     static muteLocalVideoStream(status: boolean) {
204 313
         Agora.muteLocalVideoStream(status);
205 314
     }
206 315
 
316
+    /**
317
+     * enableLocalVideo
318
+     * @param status Boolean
319
+     */
207 320
     static enableLocalVideo(status: boolean) {
208 321
         Agora.enableLocalVideo(status);
209 322
     }
210 323
 
324
+    /**
325
+     * muteAllRemoteVideoStreams
326
+     * @param status Boolean
327
+     */
211 328
     static muteAllRemoteVideoStreams(status: boolean) {
212 329
         Agora.muteAllRemoteVideoStreams(status);
213 330
     }
214 331
 
332
+    /**
333
+     * muteRemoteVideoStream
334
+     * @param status Boolean
335
+     */
215 336
     static muteRemoteVideoStream(uid: number, status: boolean) {
216 337
         Agora.muteRemoteVideoStream(uid, status);
217 338
     }
218 339
 
340
+    /**
341
+     * createDataStream
342
+     * @param reliable Boolean
343
+     * @param ordered Boolean
344
+     * @return Promise
345
+     */
219 346
     static createDataStream(reliable: boolean, ordered: boolean) {
220
-        return Agora.createDataStream(reliable, ordered);
347
+        return Agora.createDataStream({reliable, ordered});
221 348
     }
222 349
 
350
+    /**
351
+     * sendStreamMessage
352
+     * @param reliable Boolean
353
+     * @param ordered Boolean
354
+     * @return Promise
355
+     */
223 356
     static sendStreamMessage(streamId: number, data: any) {
224 357
         return Agora.sendStreamMessage(streamId, data);
225 358
     }
226 359
 
360
+    /**
361
+     * getSdkVersion
362
+     * @param callback Function
363
+     */
227 364
     static getSdkVersion(callback: Callback<void>) {
228 365
         Agora.getSdkVersion().then(callback);
229 366
     }