Browse Source

release 2.3.3-alpha.4

matrixbirds 5 years ago
parent
commit
d3e92ad07b

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

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

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

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

+ 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,E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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
- 1
package.json View File

1
 {
1
 {
2
   "name": "react-native-agora",
2
   "name": "react-native-agora",
3
-  "version": "2.3.3-alpha.0",
3
+  "version": "2.3.3-alpha.4",
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",

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

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

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

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