@byteplus/rtc 4.38.0 → 4.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +799 -607
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +4 -1
package/index.d.ts
CHANGED
|
@@ -5,280 +5,373 @@ import { EventArgs, EventEmitter, EventNames, ValidEventTypes } from 'eventemitt
|
|
|
5
5
|
declare enum ErrorCode {
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Invalid argument of the `engine` object for calling destroyEngine
|
|
8
|
+
* @brief Invalid argument of the `engine` object for calling destroyEngine
|
|
9
9
|
*/
|
|
10
10
|
INVALID_ENGINE = "INVALID_ENGINE",
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Invalid argument
|
|
13
|
+
* @brief Invalid argument
|
|
14
14
|
*/
|
|
15
15
|
INVALID_PARAMS = "INVALID_PARAMS",
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* Token is invalid or has expired.
|
|
18
|
+
* @brief Token is invalid or has expired.
|
|
19
19
|
*/
|
|
20
20
|
INVALID_TOKEN = "INVALID_TOKEN",
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Failure of joining room
|
|
23
|
+
* @brief Failure of joining room
|
|
24
24
|
*/
|
|
25
25
|
JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* Join the same room repeatedly.
|
|
28
|
+
* @brief Join the same room repeatedly.
|
|
29
29
|
*/
|
|
30
30
|
REPEAT_JOIN = "REPEAT_JOIN",
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
|
-
* Publish media stream repeatedly.
|
|
33
|
+
* @brief Publish media stream repeatedly.
|
|
34
34
|
*/
|
|
35
35
|
REPEAT_PUBLISH = "REPEAT_PUBLISH",
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
|
-
* Publish before joining a room.
|
|
38
|
+
* @brief Publish before joining a room.
|
|
39
39
|
*/
|
|
40
40
|
PUBLISH_BEFORE_JOIN = "PUBLISH_BEFORE_JOIN",
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* Un-publish before joining a room.
|
|
43
|
+
* @brief Un-publish before joining a room.
|
|
44
44
|
*/
|
|
45
45
|
UNPUBLISH_BEFORE_JOIN = "UNPUBLISH_BEFORE_JOIN",
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Subscribe before joining a room.
|
|
48
|
+
* @brief Subscribe before joining a room.
|
|
49
49
|
*/
|
|
50
50
|
SUBSCRIBE_BEFORE_JOIN = "SUBSCRIBE_BEFORE_JOIN",
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Unsubscribe before joining a room.
|
|
53
|
+
* @brief Unsubscribe before joining a room.
|
|
54
54
|
*/
|
|
55
55
|
UNSUBSCRIBE_BEFORE_JOIN = "UNSUBSCRIBE_BEFORE_JOIN",
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* Request to publish media stream as an invisible user.
|
|
58
|
+
* @brief Request to publish media stream as an invisible user.
|
|
59
59
|
*/
|
|
60
60
|
NO_PUBLISH_PERMISSION = "NO_PUBLISH_PERMISSION",
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Request to subscribe or unsubscribe a stream that doesn't exist.
|
|
63
|
+
* @brief Request to subscribe or unsubscribe a stream that doesn't exist.
|
|
64
64
|
*/
|
|
65
65
|
STREAM_NOT_EXIST = "STREAM_NOT_EXIST",
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
* Request to publish an empty stream.
|
|
68
|
+
* @brief Request to publish an empty stream.
|
|
69
69
|
*/
|
|
70
70
|
EMPTY_STREAM = "EMPTY_STREAM",
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Network disconnected. RTC SDk will emit this error code if you call publish, subscribe or the other related methods while the user has not joined a room.
|
|
73
|
+
* @brief Network disconnected. RTC SDk will emit this error code if you call publish, subscribe or the other related methods while the user has not joined a room.
|
|
74
74
|
*/
|
|
75
75
|
NOT_CONNECTED_YET = "NOT_CONNECTED_YET",
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
|
-
* Request to send message before the user has joined a room.
|
|
78
|
+
* @brief Request to send message before the user has joined a room.
|
|
79
79
|
*/
|
|
80
80
|
IM_BEFORE_JOIN = "IM_BEFORE_JOIN",
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
|
-
* The user does not exist.
|
|
83
|
+
* @brief The user does not exist.
|
|
84
84
|
*/
|
|
85
85
|
USER_NOT_EXIST = "USER_NOT_EXIST",
|
|
86
86
|
|
|
87
87
|
/**
|
|
88
|
-
* The user has joined the room.
|
|
88
|
+
* @brief The user has joined the room.
|
|
89
89
|
*/
|
|
90
90
|
ALREADY_IN_ROOM = "ALREADY_IN_ROOM",
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* @hidden
|
|
94
|
+
* @brief The user has been remove from the room by the administrator via a OpenAPI call.
|
|
95
|
+
*/
|
|
96
|
+
KICKED_OUT = "KICKED_OUT",
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @hidden
|
|
100
|
+
* @brief Users have been removed from the room because the administrator dismissed the room by calling OpenAPI.
|
|
101
|
+
*/
|
|
102
|
+
ROOM_DISMISS = "ROOM_DISMISS",
|
|
103
|
+
/** Token过期被踢出房间 */
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* @brief Token expired. Call `joinRoom` to rejoin with a valid Token.
|
|
107
|
+
*/
|
|
108
|
+
TOKEN_EXPIRED = "TOKEN_EXPIRED",
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @brief The user has been removed from the room because the same user joined the room on the other client.
|
|
94
112
|
*/
|
|
95
113
|
DUPLICATE_LOGIN = "DUPLICATE_LOGIN",
|
|
96
114
|
|
|
97
115
|
/**
|
|
98
|
-
* Enable capture repeatedly.
|
|
116
|
+
* @brief Enable capture repeatedly.
|
|
99
117
|
*/
|
|
100
118
|
REPEAT_CAPTURE = "REPEAT_CAPTURE",
|
|
101
119
|
|
|
102
120
|
/**
|
|
103
|
-
* Failure of video capture
|
|
121
|
+
* @brief Failure of video capture
|
|
104
122
|
*/
|
|
105
123
|
GET_VIDEO_TRACK_FAILED = "GET_VIDEO_TRACK_FAILED",
|
|
106
124
|
|
|
107
125
|
/**
|
|
108
|
-
* Failure of getting audio track
|
|
126
|
+
* @brief Failure of getting audio track
|
|
109
127
|
*/
|
|
110
128
|
GET_AUDIO_TRACK_FAILED = "GET_AUDIO_TRACK_FAILED",
|
|
111
129
|
|
|
112
130
|
/**
|
|
113
|
-
* Failure of getting screen track
|
|
131
|
+
* @brief Failure of getting screen track
|
|
114
132
|
*/
|
|
115
133
|
GET_SCREEN_TRACK_FAILED = "GET_SCREEN_TRACK_FAILED",
|
|
116
134
|
|
|
117
135
|
/**
|
|
118
|
-
* Stream type mismatched. RTC SDK will emit this error code when you enable the local media device after enabling the custom video module.
|
|
136
|
+
* @brief Stream type mismatched. RTC SDK will emit this error code when you enable the local media device after enabling the custom video module.
|
|
119
137
|
*/
|
|
120
138
|
STREAM_TYPE_NOT_MATCH = "STREAM_TYPE_NOT_MATCH",
|
|
121
139
|
|
|
122
140
|
/**
|
|
123
|
-
* Cannot find the DOM specified to play the video.
|
|
141
|
+
* @brief Cannot find the DOM specified to play the video.
|
|
124
142
|
*/
|
|
125
143
|
CANT_FIND_DOM = "CANT_FIND_DOM",
|
|
126
144
|
|
|
127
145
|
/**
|
|
128
|
-
* Invalid device ID
|
|
146
|
+
* @brief Invalid device ID
|
|
129
147
|
*/
|
|
130
148
|
INVALID_DEVICE_ID = "INVALID_DEVICE_ID",
|
|
131
149
|
|
|
132
150
|
/**
|
|
133
|
-
* No permission for capture
|
|
151
|
+
* @brief No permission for capture
|
|
134
152
|
*/
|
|
135
153
|
NO_PERMISSION = "NO_PERMISSION",
|
|
136
154
|
|
|
137
155
|
/**
|
|
138
|
-
* The browser does not support capture.
|
|
156
|
+
* @brief The browser does not support capture.
|
|
139
157
|
*/
|
|
140
158
|
NOT_SUPPORTED = "NOT_SUPPORTED",
|
|
141
159
|
|
|
142
160
|
/**
|
|
143
|
-
* Failure of requesting an ICE node
|
|
161
|
+
* @brief Failure of requesting an ICE node
|
|
144
162
|
*/
|
|
145
163
|
ICE_SERVER_WRONG = "ICE_SERVER_WRONG",
|
|
146
164
|
|
|
147
165
|
/**
|
|
148
|
-
* Failure of establishing a datachannel
|
|
166
|
+
* @brief Failure of establishing a datachannel
|
|
149
167
|
*/
|
|
150
168
|
ESTABLISH_DATACHANNEL_FAILED = "ESTABLISH_DATACHANNEL_FAILED",
|
|
151
169
|
|
|
152
170
|
/**
|
|
153
|
-
* Failure of loading network resource
|
|
171
|
+
* @brief Failure of loading network resource
|
|
154
172
|
*/
|
|
155
173
|
LOAD_RESOURCES_FAILED = "LOAD_RESOURCES_FAILED",
|
|
156
174
|
|
|
157
175
|
/**
|
|
158
|
-
* Failure of building the signal channel
|
|
176
|
+
* @brief Failure of building the signal channel
|
|
159
177
|
*/
|
|
160
178
|
SIGNALING_CHANNEL_NOT_OPEN = "SIGNALING_CHANNEL_NOT_OPEN",
|
|
161
179
|
|
|
162
180
|
/**
|
|
163
|
-
* Request timeout
|
|
181
|
+
* @brief Request timeout
|
|
164
182
|
*/
|
|
165
183
|
TIME_OUT = "TIME_OUT",
|
|
166
184
|
|
|
167
185
|
/**
|
|
168
|
-
* Request is denied for the reason of network disconnected.
|
|
186
|
+
* @brief Request is denied for the reason of network disconnected.
|
|
169
187
|
*/
|
|
170
188
|
REFUSE_OPERATION_IN_DISCONNECT = "REFUSE_OPERATION_IN_DISCONNECT",
|
|
171
189
|
|
|
172
190
|
/**
|
|
173
|
-
* Failure of building a peer-connection to the signal server for the failure of building transceiver
|
|
191
|
+
* @brief Failure of building a peer-connection to the signal server for the failure of building transceiver
|
|
174
192
|
*/
|
|
175
193
|
ADD_TRANSCEIVER_FAILED = "ADD_TRANSCEIVER_FAILED",
|
|
176
194
|
|
|
177
195
|
/**
|
|
178
|
-
* Failure of updating media track
|
|
196
|
+
* @brief Failure of updating media track
|
|
179
197
|
*/
|
|
180
198
|
UPDATE_TRACK_FAILED = "UPDATE_TRACK_FAILED",
|
|
181
199
|
|
|
182
200
|
/**
|
|
183
|
-
* Failure of publishing a media stream
|
|
201
|
+
* @brief Failure of publishing a media stream
|
|
184
202
|
*/
|
|
185
203
|
PUBLISH_FAILED = "PUBLISH_FAILED",
|
|
186
204
|
|
|
187
205
|
/**
|
|
188
|
-
* Failure of un-publishing a media stream
|
|
206
|
+
* @brief Failure of un-publishing a media stream
|
|
189
207
|
*/
|
|
190
208
|
UNPUBLISH_FAILED = "UNPUBLISH_FAILED",
|
|
191
209
|
|
|
192
210
|
/**
|
|
193
|
-
* Failure of subscribing a media stream
|
|
211
|
+
* @brief Failure of subscribing a media stream
|
|
194
212
|
*/
|
|
195
213
|
SUBSCRIBE_FAILED = "SUBSCRIBE_FAILED",
|
|
196
214
|
|
|
197
215
|
/**
|
|
198
|
-
* Failure of unsubscribing a media stream
|
|
216
|
+
* @brief Failure of unsubscribing a media stream
|
|
199
217
|
*/
|
|
200
218
|
UNSUBSCRIBE_FAILED = "UNSUBSCRIBE_FAILED",
|
|
201
219
|
|
|
202
220
|
/**
|
|
203
|
-
* Call [leaveRoom](#leaveroom)Process of publishing and subscribing will
|
|
221
|
+
* @brief Call [leaveRoom](#leaveroom)Process of publishing and subscribing will
|
|
204
222
|
* RTC SDK will emit this error code when you call the [leaveRoom](#leaveroom) during the process of publishing or subscribing.
|
|
205
223
|
*/
|
|
206
224
|
OPERATION_CANCEL = "OPERATION_CANCEL",
|
|
207
225
|
|
|
208
226
|
/**
|
|
209
|
-
* Unknown error
|
|
227
|
+
* @brief Unknown error
|
|
210
228
|
*/
|
|
211
229
|
UNEXPECTED_ERROR = "UNEXPECTED_ERROR",
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @brief The user has already logged in.
|
|
233
|
+
*/
|
|
212
234
|
ALREADY_LOGIN = "ALREADY_LOGIN",
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @brief Login failed.
|
|
238
|
+
*/
|
|
213
239
|
LOGIN_FAILED = "LOGIN_FAILED",
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @brief The user has not logged in.
|
|
243
|
+
*/
|
|
214
244
|
NOT_LOGIN = "NOT_LOGIN",
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @brief Login to the RTM server repeatedly.
|
|
248
|
+
*/
|
|
215
249
|
RTM_DUPLICATE_LOGIN = "RTM_DUPLICATE_LOGIN",
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* @brief Invalid Token during the reconnection to the RTM server
|
|
253
|
+
*/
|
|
216
254
|
RTM_TOKEN_ERROR = "RTM_TOKEN_ERROR",
|
|
217
|
-
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @brief Timeout
|
|
258
|
+
*/
|
|
218
259
|
USER_MESSAGE_TIMEOUT = "USER_MESSAGE_TIMEOUT",
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @brief Failure of sending the message due to broken channel.
|
|
263
|
+
*/
|
|
219
264
|
USER_MESSAGE_BROKEN = "USER_MESSAGE_BROKEN",
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @brief No receiver
|
|
268
|
+
*/
|
|
220
269
|
USER_MESSAGE_NO_RECEIVER = "USER_MESSAGE_NO_RECEIVER",
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* @brief No relay path
|
|
273
|
+
*/
|
|
221
274
|
USER_MESSAGE_NO_RELAYPATH = "USER_MESSAGE_NO_RELAYPATH",
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @brief No response after sending messages to a server probably due to Http request failure
|
|
278
|
+
*/
|
|
222
279
|
USER_MESSAGE_SEND_TO_SERVER_ERROR = "USER_MESSAGE_SEND_TO_SERVER_ERROR",
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @brief Failure of sending messages to a server. Response status code is not 200.
|
|
283
|
+
*/
|
|
223
284
|
USER_MESSAGE_SERVER_RESPONSE_ERROR = "USER_MESSAGE_SERVER_RESPONSE_ERROR",
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* @brief The user has not joined any room.
|
|
288
|
+
*/
|
|
224
289
|
USER_MESSAGE_NOT_JOIN = "USER_MESSAGE_NOT_JOIN",
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* @brief Connection has not initiated.
|
|
293
|
+
*/
|
|
225
294
|
USER_MESSAGE_INIT = "USER_MESSAGE_INIT",
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* @brief No available data connection
|
|
298
|
+
*/
|
|
226
299
|
USER_MESSAGE_NO_CONNECTION = "USER_MESSAGE_NO_CONNECTION",
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* @brief Length of the message exceeds the size limit which is 64 KB.
|
|
303
|
+
*/
|
|
227
304
|
USER_MESSAGE_EXCEED_MAX_LENGTH = "USER_MESSAGE_EXCEED_MAX_LENGTH",
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @brief userId of the receiver is empty.
|
|
308
|
+
*/
|
|
228
309
|
USER_MESSAGE_EMPTY_USER = "USER_MESSAGE_EMPTY_USER",
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* @brief Sending a message before login to the IM server
|
|
313
|
+
*/
|
|
229
314
|
USER_MESSAGE_NOT_LOGIN = "USER_MESSAGE_NOT_LOGIN",
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* @brief Lack of params of the IM server
|
|
318
|
+
*/
|
|
230
319
|
USER_MESSAGE_SERVER_PARAMS_NOTSET = "USER_MESSAGE_SERVER_PARAMS_NOTSET",
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @brief Unknown error of messaging
|
|
323
|
+
*/
|
|
231
324
|
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN"
|
|
232
325
|
}
|
|
233
326
|
declare enum AudioMixingError {
|
|
234
327
|
|
|
235
328
|
/**
|
|
236
|
-
* Normal
|
|
329
|
+
* @brief Normal
|
|
237
330
|
*/
|
|
238
331
|
AUDIO_MIXING_ERROR_OK = 0,
|
|
239
332
|
|
|
240
333
|
/**
|
|
241
|
-
* Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
334
|
+
* @brief Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
242
335
|
*/
|
|
243
336
|
AUDIO_MIXING_ERROR_PRELOAD_FAILED = 1,
|
|
244
337
|
|
|
245
338
|
/**
|
|
246
|
-
* Audio mixing starts fails because of missing audio file or failure of reading the audio file.
|
|
339
|
+
* @brief Audio mixing starts fails because of missing audio file or failure of reading the audio file.
|
|
247
340
|
*/
|
|
248
341
|
AUDIO_MIXING_ERROR_START_FAILED = 2,
|
|
249
342
|
|
|
250
343
|
/**
|
|
251
|
-
* Invalid audio mixing ID
|
|
344
|
+
* @brief Invalid audio mixing ID
|
|
252
345
|
*/
|
|
253
346
|
AUDIO_MIXING_ERROR_ID_NOT_FOUND = 3,
|
|
254
347
|
|
|
255
348
|
/**
|
|
256
|
-
* Invalid start position
|
|
349
|
+
* @brief Invalid start position
|
|
257
350
|
*/
|
|
258
351
|
AUDIO_MIXING_ERROR_SET_POSITION_FAILED = 4,
|
|
259
352
|
|
|
260
353
|
/**
|
|
261
|
-
* Invalid volume argument. The volume value ranges [0, 400].
|
|
354
|
+
* @brief Invalid volume argument. The volume value ranges [0, 400].
|
|
262
355
|
*/
|
|
263
356
|
AUDIO_MIXING_ERROR_INVALID_VOLUME = 5,
|
|
264
357
|
|
|
265
358
|
/**
|
|
266
|
-
* The audio file to be played does not match to the preload one. Call `unloadAudioMixing` to unload file and proceed.
|
|
359
|
+
* @brief The audio file to be played does not match to the preload one. Call `unloadAudioMixing` to unload file and proceed.
|
|
267
360
|
*/
|
|
268
361
|
AUDIO_MIXING_ERROR_LOAD_CONFLICT = 6,
|
|
269
362
|
|
|
270
363
|
/**
|
|
271
|
-
* Type of the audio file to be played is not supported.
|
|
364
|
+
* @brief Type of the audio file to be played is not supported.
|
|
272
365
|
*/
|
|
273
366
|
AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH = 7,
|
|
274
367
|
|
|
275
368
|
/**
|
|
276
|
-
* Invalid audio pitch
|
|
369
|
+
* @brief Invalid audio pitch
|
|
277
370
|
*/
|
|
278
371
|
AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH = 8,
|
|
279
372
|
|
|
280
373
|
/**
|
|
281
|
-
* Invalid audio track
|
|
374
|
+
* @brief Invalid audio track
|
|
282
375
|
*/
|
|
283
376
|
AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK = 9
|
|
284
377
|
}
|
|
@@ -293,75 +386,71 @@ declare enum AudioMixingError {
|
|
|
293
386
|
export interface IAudioMixingManager {
|
|
294
387
|
|
|
295
388
|
/**
|
|
296
|
-
* Start playing audio files and mixes. <br>
|
|
297
|
-
* This method can be called many times by passing in different IDs and filepath to realize simultaneous playback of multiple mixing files and mixing overlay
|
|
389
|
+
* @brief Start playing audio files and mixes. <br>
|
|
390
|
+
* This method can be called many times by passing in different IDs and filepath to realize simultaneous playback of multiple mixing files and mixing overlay.<br>
|
|
298
391
|
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
|
|
299
392
|
* If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
|
|
300
393
|
* @param filePath Specify the file path either the absolute path of a local file or the url of online audio. Files with the extension of mp3 and aac are supported.
|
|
301
394
|
* @param config Mix Sound configuration <br>
|
|
302
395
|
* You can set the number of times the mix is played, whether the mix is played locally, and whether the mix is sent to the remote end. For details.
|
|
303
396
|
* @return
|
|
304
|
-
* @notes
|
|
305
|
-
* +
|
|
306
|
-
* +
|
|
307
|
-
* + The mixing data of this method comes from an external file, while the mixing data of enableAudioMixingFrame{@link #enableAudioMixingFrame} comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
|
|
397
|
+
* @notes + If you have already loaded the sound effect into memory through [preloadAudioMixing](#preloadaudiomixing), make sure that the ID here is the same as the ID set by [preloadAudioMixing](#preloadaudiomixing). <br>
|
|
398
|
+
* + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file. <br>
|
|
399
|
+
* + The mixing data of this method comes from an external file, while the mixing data of [enableAudioMixingFrame](#enableAudioMixingFrame) comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
|
|
308
400
|
* @region Advanced Feature
|
|
309
401
|
*/
|
|
310
402
|
startAudioMixing(id: number, filePath: string, options: MixOption): Promise<void>;
|
|
311
403
|
|
|
312
404
|
/**
|
|
313
|
-
* Stop playing audio files and mixes
|
|
405
|
+
* @brief Stop playing audio files and mixes
|
|
314
406
|
* @param id ID of the mixing
|
|
315
|
-
* @notes
|
|
316
|
-
* + After calling startAudioMixing{@link #startAudioMixing} method to start playing audio files and mixes, you can call this method to stop playing audio files and mixes. <br>
|
|
407
|
+
* @notes + After calling [startAudioMixing](#startaudiomixing) method to start playing audio files and mixes, you can call this method to stop playing audio files and mixes. <br>
|
|
317
408
|
* + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
|
|
318
409
|
* @region Advanced Feature
|
|
319
410
|
*/
|
|
320
411
|
stopAudioMixing(id: number): void;
|
|
321
412
|
|
|
322
413
|
/**
|
|
323
|
-
* Pause playing audio files and mixes
|
|
414
|
+
* @brief Pause playing audio files and mixes
|
|
324
415
|
* @param id ID of the mixing
|
|
325
|
-
* @notes
|
|
326
|
-
* + After calling
|
|
327
|
-
* + After calling this method to pause playing audio files and mixing, you can call the resumeAudioMixing{@link #resumeAudioMixing} method to resume playing and mixing. <br>
|
|
416
|
+
* @notes + After calling [startAudioMixing](#startaudiomixing) method to start playing audio files and mixes, you can call this method to pause playing audio files and mixes. <br>
|
|
417
|
+
* + After calling this method to pause playing audio files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing. <br>
|
|
328
418
|
* @region Advanced Feature
|
|
329
419
|
*/
|
|
330
420
|
pauseAudioMixing(id: number): void;
|
|
331
421
|
|
|
332
422
|
/**
|
|
333
|
-
* Resume playing audio files and mixing
|
|
423
|
+
* @brief Resume playing audio files and mixing
|
|
334
424
|
* @param id Mixing ID
|
|
335
|
-
* @notes After calling the pauseAudioMixing
|
|
425
|
+
* @notes After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing audio files and mixing, you can resume playing and mixing by calling this method. <br>
|
|
336
426
|
* @region Advanced Feature
|
|
337
427
|
*/
|
|
338
428
|
resumeAudioMixing(id: number): void;
|
|
339
429
|
|
|
340
430
|
/**
|
|
341
|
-
* Preload the specified audio file into memory
|
|
431
|
+
* @brief Preload the specified audio file into memory
|
|
342
432
|
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
|
|
343
433
|
* If this method is called repeatedly with the same ID, the latter overrides the previous. <br>
|
|
344
|
-
* If you call startAudioMixing
|
|
345
|
-
* After calling this method with an ID to preload A.mp3, if you need to call startAudioMixing
|
|
434
|
+
* If you call [startAudioMixing](#startaudiomixing) and then call this method with the same ID, the previous mix stopped, and then the next mix was loaded. <br>
|
|
435
|
+
* After calling this method with an ID to preload A.mp3, if you need to call [startAudioMixing](#startaudiomixing) to play B.mp3 with the same ID, please call [unloadAudioMixing](#unloadaudiomixing) to uninstall A.mp3 first, otherwise you will report an error AUDIO_MIXING_ERROR_LOAD_CONFLICT.
|
|
346
436
|
* @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio. <br>
|
|
347
437
|
* @return
|
|
348
|
-
* @notes
|
|
349
|
-
* +
|
|
350
|
-
* +
|
|
351
|
-
* + The specified audio file preloaded by calling this method can be unloaded through unloadAudioMixing{@link #unloadAudioMixing}.
|
|
438
|
+
* @notes + When you need to play an audio file frequently, call this method to preload the file. When playing, you can only load the file once to reduce CPU usage. <br>
|
|
439
|
+
* + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file. <br>
|
|
440
|
+
* + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
|
|
352
441
|
* @region Advanced Feature
|
|
353
442
|
*/
|
|
354
443
|
preloadAudioMixing(id: number, filePath: string): Promise<void>;
|
|
355
444
|
|
|
356
445
|
/**
|
|
357
|
-
* Uninstall the specified audio file
|
|
446
|
+
* @brief Uninstall the specified audio file
|
|
358
447
|
* @param id Mix ID
|
|
359
448
|
* @region Advanced Feature
|
|
360
449
|
*/
|
|
361
450
|
unloadAudioMixing(id: number): void;
|
|
362
451
|
|
|
363
452
|
/**
|
|
364
|
-
* Adjust the volume of audio mixing, including audio files and PCM data.
|
|
453
|
+
* @brief Adjust the volume of audio mixing, including audio files and PCM data.
|
|
365
454
|
* @param id Mixing ID
|
|
366
455
|
* @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`. <br>
|
|
367
456
|
* + 0: Mute <br>
|
|
@@ -372,7 +461,7 @@ export interface IAudioMixingManager {
|
|
|
372
461
|
setAudioMixingVolume(id: number, volume: number): void;
|
|
373
462
|
|
|
374
463
|
/**
|
|
375
|
-
* Get volume of the audio files.
|
|
464
|
+
* @brief Get volume of the audio files.
|
|
376
465
|
* @param id Audio mix id
|
|
377
466
|
* @return <br>
|
|
378
467
|
* + `0`: Failure<br>
|
|
@@ -382,110 +471,107 @@ export interface IAudioMixingManager {
|
|
|
382
471
|
getAudioMixingVolume(id: number): number;
|
|
383
472
|
|
|
384
473
|
/**
|
|
385
|
-
*
|
|
474
|
+
* @brief Get audio file duration
|
|
386
475
|
* @param id Mix ID
|
|
387
476
|
* @return <br>
|
|
388
477
|
* + > 0: Success, audio file duration, in milliseconds. <br>
|
|
389
478
|
* + < 0: Failure
|
|
390
|
-
* @notes Before calling this method to obtain the length of the audio file, you need to call preloadAudioMixing
|
|
479
|
+
* @notes Before calling this method to obtain the length of the audio file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing).
|
|
391
480
|
* @region Advanced Feature
|
|
392
481
|
*/
|
|
393
482
|
getAudioMixingDuration(id: number): number;
|
|
394
483
|
|
|
395
484
|
/**
|
|
396
|
-
*
|
|
485
|
+
* @brief Get audio file playback progress
|
|
397
486
|
* @param id Mix ID
|
|
398
487
|
* @return <br>
|
|
399
488
|
* + > 0: Success, audio file playback progress, in milliseconds. <br>
|
|
400
489
|
* + < 0: Failed
|
|
401
|
-
* @notes Before calling this method to get the audio file playback progress, you need to call startAudioMixing
|
|
490
|
+
* @notes Before calling this method to get the audio file playback progress, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
|
|
402
491
|
* @region Advanced Feature
|
|
403
492
|
*/
|
|
404
493
|
getAudioMixingCurrentPosition(id: number): number;
|
|
405
494
|
|
|
406
495
|
/**
|
|
407
|
-
* Set the starting playback position of the audio file
|
|
496
|
+
* @brief Set the starting playback position of the audio file
|
|
408
497
|
* @param id Mixing ID
|
|
409
|
-
* @param position The starting playback position of the audio file in milliseconds
|
|
410
|
-
*
|
|
411
|
-
*
|
|
412
|
-
* + Before calling this method to set the playback position of the audio file, you need to call startAudioMixing
|
|
498
|
+
* @param position The starting playback position of the audio file in milliseconds.<br>
|
|
499
|
+
* Call [getAudioMixingDuration](#getAudioMixingDuration) to get the duration of the audio file. The value of `position` must not be greater than the duration of the audio file.
|
|
500
|
+
* @notes + This method allows you to play an audio file from a specified position as appropriate, without having to play an audio file in its entirety from the beginning to finish. <br>
|
|
501
|
+
* + Before calling this method to set the playback position of the audio file, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
|
|
413
502
|
* @region Advanced Feature
|
|
414
503
|
*/
|
|
415
504
|
setAudioMixingPosition(id: number, position: number): void;
|
|
416
505
|
|
|
417
506
|
/**
|
|
418
|
-
*
|
|
507
|
+
* @brief Start PCM mixing. <br>
|
|
419
508
|
* To mix multiple PCM audio data, call this API multiple times with different ids.
|
|
420
509
|
* @param type Mixing type <br>
|
|
421
510
|
* Whether the PCM data is mixed locally and sent to the remotes.
|
|
422
|
-
* @notes
|
|
423
|
-
* +
|
|
424
|
-
* + To end PCM mixing, use disableAudioMixingFrame{@link #disableAudioMixingFrame}.
|
|
511
|
+
* @notes + After this API, you must call [pushAudioMixingFrame](#pushaudiomixingframe) to start mixing. <br>
|
|
512
|
+
* + To end PCM mixing, use [disableAudioMixingFrame](#disableaudiomixingframe).
|
|
425
513
|
* @region Advanced Feature
|
|
426
514
|
*/
|
|
427
515
|
enableAudioMixingBuffer(type: AudioMixingType): void;
|
|
428
516
|
|
|
429
517
|
/**
|
|
430
|
-
* Disable PCM mixing.
|
|
518
|
+
* @brief Disable PCM mixing.
|
|
431
519
|
* @region Advanced Feature
|
|
432
520
|
*/
|
|
433
521
|
disableAudioMixingBuffer(): void;
|
|
434
522
|
|
|
435
523
|
/**
|
|
436
|
-
* Push PCM audio frame data for mixing
|
|
524
|
+
* @brief Push PCM audio frame data for mixing
|
|
437
525
|
* @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
|
|
438
|
-
* @notes Before calling this method, you must start the external audio stream mixing through enableAudioMixingFrame
|
|
526
|
+
* @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingFrame](#enableaudiomixingframe). <br>
|
|
439
527
|
* @region Advanced Feature
|
|
440
528
|
*/
|
|
441
529
|
pushAudioMixingBuffer(buffer: AudioBuffer): void;
|
|
442
530
|
}
|
|
443
531
|
|
|
444
532
|
/**
|
|
445
|
-
* @type
|
|
446
|
-
* Mix playback channel type
|
|
533
|
+
* @brief Mix playback channel type
|
|
447
534
|
*/
|
|
448
535
|
export declare enum AudioMixingDualMonoMode {
|
|
449
536
|
|
|
450
537
|
/**
|
|
451
|
-
*
|
|
538
|
+
* @brief Consistent with audio files
|
|
452
539
|
*/
|
|
453
540
|
AUTO = 0,
|
|
454
541
|
|
|
455
542
|
/**
|
|
456
|
-
*
|
|
543
|
+
* @brief Only the left channel audio in the audio file can be heard
|
|
457
544
|
*/
|
|
458
545
|
MODE_L = 1,
|
|
459
546
|
|
|
460
547
|
/**
|
|
461
|
-
*
|
|
548
|
+
* @brief Only the right channel audio in the audio file can be heard
|
|
462
549
|
*/
|
|
463
550
|
MODE_R = 2,
|
|
464
551
|
|
|
465
552
|
/**
|
|
466
|
-
*
|
|
553
|
+
* @brief Can hear the left and right audio channels in the audio file at the same time
|
|
467
554
|
*/
|
|
468
555
|
MODE_MIX = 3
|
|
469
556
|
}
|
|
470
557
|
|
|
471
558
|
/**
|
|
472
|
-
* @type
|
|
473
|
-
* Mixing type
|
|
559
|
+
* @brief Mixing type
|
|
474
560
|
*/
|
|
475
561
|
export declare enum AudioMixingType {
|
|
476
562
|
|
|
477
563
|
/**
|
|
478
|
-
*
|
|
564
|
+
* @brief Played at the local device only
|
|
479
565
|
*/
|
|
480
566
|
PLAYOUT = 0,
|
|
481
567
|
|
|
482
568
|
/**
|
|
483
|
-
*
|
|
569
|
+
* @brief Sent to the remote devices only
|
|
484
570
|
*/
|
|
485
571
|
PUBLISH = 1,
|
|
486
572
|
|
|
487
573
|
/**
|
|
488
|
-
*
|
|
574
|
+
* @brief Played at the local device and sent to the remote devices.
|
|
489
575
|
*/
|
|
490
576
|
PLAYOUT_AND_PUBLISH = 2
|
|
491
577
|
}
|
|
@@ -509,22 +595,20 @@ declare enum AudioMixingState {
|
|
|
509
595
|
}
|
|
510
596
|
|
|
511
597
|
/**
|
|
512
|
-
* @
|
|
513
|
-
* Mixing configuration
|
|
598
|
+
* @brief Mixing configuration
|
|
514
599
|
*/
|
|
515
600
|
export interface MixOption {
|
|
516
601
|
|
|
517
602
|
/**
|
|
518
|
-
*
|
|
519
|
-
* @notes
|
|
520
|
-
* + Play_count < = 0: Infinite loop <br>
|
|
603
|
+
* @brief Mix playback times
|
|
604
|
+
* @notes + Play_count < = 0: Infinite loop <br>
|
|
521
605
|
* + Play_count == 1: Play once (default) <br>
|
|
522
606
|
* + Play_count > 1: Play play_count times
|
|
523
607
|
*/
|
|
524
608
|
playCount: number;
|
|
525
609
|
|
|
526
610
|
/**
|
|
527
|
-
*
|
|
611
|
+
* @brief For mixing playback types. Refer to [AudioMixingType](#audiomixingtype).
|
|
528
612
|
*/
|
|
529
613
|
type?: AudioMixingType;
|
|
530
614
|
}
|
|
@@ -535,36 +619,36 @@ declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string |
|
|
|
535
619
|
}
|
|
536
620
|
|
|
537
621
|
/**
|
|
538
|
-
* Information of media device
|
|
622
|
+
* @brief Information of media device
|
|
539
623
|
*/
|
|
540
624
|
export interface RTCDevice {
|
|
541
625
|
|
|
542
626
|
/**
|
|
543
|
-
* Device ID
|
|
627
|
+
* @brief Device ID
|
|
544
628
|
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
545
629
|
*/
|
|
546
630
|
deviceId: MediaDeviceInfo["deviceId"];
|
|
547
631
|
|
|
548
632
|
/**
|
|
549
|
-
* Device type
|
|
633
|
+
* @brief Device type
|
|
550
634
|
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
551
635
|
*/
|
|
552
636
|
deviceType: MediaDeviceInfo["kind"];
|
|
553
637
|
|
|
554
638
|
/**
|
|
555
|
-
* Device information
|
|
639
|
+
* @brief Device information
|
|
556
640
|
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
557
641
|
*/
|
|
558
642
|
deviceInfo: MediaDeviceInfo;
|
|
559
643
|
|
|
560
644
|
/**
|
|
561
|
-
* Device label
|
|
645
|
+
* @brief Device label
|
|
562
646
|
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
563
647
|
*/
|
|
564
648
|
deviceName: MediaDeviceInfo["label"];
|
|
565
649
|
|
|
566
650
|
/**
|
|
567
|
-
* Device state
|
|
651
|
+
* @brief Device state
|
|
568
652
|
*/
|
|
569
653
|
deviceState: "active" | "inactive";
|
|
570
654
|
}
|
|
@@ -575,7 +659,7 @@ export interface RTCDevice {
|
|
|
575
659
|
export interface onUserJoinedEvent {
|
|
576
660
|
|
|
577
661
|
/**
|
|
578
|
-
* userId of the user who is joining the room
|
|
662
|
+
* @brief userId of the user who is joining the room
|
|
579
663
|
*/
|
|
580
664
|
userInfo: UserInfo;
|
|
581
665
|
}
|
|
@@ -586,16 +670,14 @@ export interface onUserJoinedEvent {
|
|
|
586
670
|
export interface onUserLeaveEvent {
|
|
587
671
|
|
|
588
672
|
/**
|
|
589
|
-
* User information
|
|
673
|
+
* @brief User information
|
|
590
674
|
*/
|
|
591
675
|
userInfo: UserInfo;
|
|
592
676
|
|
|
593
677
|
/**
|
|
594
|
-
* The reason the user left the room
|
|
595
|
-
* 0: The remote user calls leaveRoom to actively exit the room
|
|
596
|
-
* 1: The remote user is disconnected due to network problems, or switches to an invisible state
|
|
678
|
+
* @brief The reason why the remote user left the room
|
|
597
679
|
*/
|
|
598
|
-
reason:
|
|
680
|
+
reason: UserOfflineReason;
|
|
599
681
|
}
|
|
600
682
|
|
|
601
683
|
/**
|
|
@@ -604,7 +686,7 @@ export interface onUserLeaveEvent {
|
|
|
604
686
|
export interface onStreamAddEvent {
|
|
605
687
|
|
|
606
688
|
/**
|
|
607
|
-
* Stream properties
|
|
689
|
+
* @brief Stream properties
|
|
608
690
|
*/
|
|
609
691
|
stream: RTCStream;
|
|
610
692
|
}
|
|
@@ -615,12 +697,12 @@ export interface onStreamAddEvent {
|
|
|
615
697
|
export interface onStreamRemoveEvent {
|
|
616
698
|
|
|
617
699
|
/**
|
|
618
|
-
* Stream properties
|
|
700
|
+
* @brief Stream properties
|
|
619
701
|
*/
|
|
620
702
|
stream: RTCStream;
|
|
621
703
|
|
|
622
704
|
/**
|
|
623
|
-
* Reason of un-publishing
|
|
705
|
+
* @brief Reason of un-publishing
|
|
624
706
|
*/
|
|
625
707
|
reason: StreamRemoveReason;
|
|
626
708
|
}
|
|
@@ -631,7 +713,7 @@ export interface onStreamRemoveEvent {
|
|
|
631
713
|
export interface onConnectionStateEvent {
|
|
632
714
|
|
|
633
715
|
/**
|
|
634
|
-
* Events related to the connection state of the SDK and the signal server
|
|
716
|
+
* @brief Events related to the connection state of the SDK and the signal server
|
|
635
717
|
*/
|
|
636
718
|
state: ConnectionState;
|
|
637
719
|
}
|
|
@@ -642,17 +724,17 @@ export interface onConnectionStateEvent {
|
|
|
642
724
|
export interface onVideoFirstFrameRenderedEvent {
|
|
643
725
|
|
|
644
726
|
/**
|
|
645
|
-
* userId of the user published the video stream
|
|
727
|
+
* @brief userId of the user published the video stream
|
|
646
728
|
*/
|
|
647
729
|
userId: string;
|
|
648
730
|
|
|
649
731
|
/**
|
|
650
|
-
* Height
|
|
732
|
+
* @brief Height
|
|
651
733
|
*/
|
|
652
734
|
height: number;
|
|
653
735
|
|
|
654
736
|
/**
|
|
655
|
-
* Width
|
|
737
|
+
* @brief Width
|
|
656
738
|
*/
|
|
657
739
|
width: number;
|
|
658
740
|
}
|
|
@@ -663,17 +745,17 @@ export interface onVideoFirstFrameRenderedEvent {
|
|
|
663
745
|
export interface onVideoFirstFrameDecodedEvent {
|
|
664
746
|
|
|
665
747
|
/**
|
|
666
|
-
* userId of the user published the video stream
|
|
748
|
+
* @brief userId of the user published the video stream
|
|
667
749
|
*/
|
|
668
750
|
userId: string;
|
|
669
751
|
|
|
670
752
|
/**
|
|
671
|
-
* Height
|
|
753
|
+
* @brief Height
|
|
672
754
|
*/
|
|
673
755
|
height: number;
|
|
674
756
|
|
|
675
757
|
/**
|
|
676
|
-
* Width
|
|
758
|
+
* @brief Width
|
|
677
759
|
*/
|
|
678
760
|
width: number;
|
|
679
761
|
}
|
|
@@ -684,7 +766,7 @@ export interface onVideoFirstFrameDecodedEvent {
|
|
|
684
766
|
export interface onAudioFirstFrameDecodedEvent {
|
|
685
767
|
|
|
686
768
|
/**
|
|
687
|
-
* userId of the user published the video stream
|
|
769
|
+
* @brief userId of the user published the video stream
|
|
688
770
|
*/
|
|
689
771
|
userId: string;
|
|
690
772
|
}
|
|
@@ -695,17 +777,17 @@ export interface onAudioFirstFrameDecodedEvent {
|
|
|
695
777
|
export interface onMediaDeviceStateChangeEvent {
|
|
696
778
|
|
|
697
779
|
/**
|
|
698
|
-
* Device identification
|
|
780
|
+
* @brief Device identification
|
|
699
781
|
*/
|
|
700
782
|
device_id: string;
|
|
701
783
|
|
|
702
784
|
/**
|
|
703
|
-
* Device type, including audio capture device. audio playback device, and video capture device.
|
|
785
|
+
* @brief Device type, including audio capture device. audio playback device, and video capture device.
|
|
704
786
|
*/
|
|
705
787
|
device_type: string;
|
|
706
788
|
|
|
707
789
|
/**
|
|
708
|
-
* Device state
|
|
790
|
+
* @brief Device state
|
|
709
791
|
*/
|
|
710
792
|
device_state: "ACTIVE" | "INACTIVE";
|
|
711
793
|
}
|
|
@@ -716,12 +798,12 @@ export interface onMediaDeviceStateChangeEvent {
|
|
|
716
798
|
export interface onSEIMessageEvent {
|
|
717
799
|
|
|
718
800
|
/**
|
|
719
|
-
* Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message. Refer to [RemoteStreamKey](#remotestreamkey) for more information.
|
|
801
|
+
* @brief Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message. Refer to [RemoteStreamKey](#remotestreamkey) for more information.
|
|
720
802
|
*/
|
|
721
803
|
remoteStreamKey: RemoteStreamKey;
|
|
722
804
|
|
|
723
805
|
/**
|
|
724
|
-
* SEI message received
|
|
806
|
+
* @brief SEI message received
|
|
725
807
|
*/
|
|
726
808
|
sei: Uint8Array;
|
|
727
809
|
}
|
|
@@ -732,37 +814,37 @@ export interface onSEIMessageEvent {
|
|
|
732
814
|
export interface LocalAudioStats {
|
|
733
815
|
|
|
734
816
|
/**
|
|
735
|
-
* Audio loss rate
|
|
817
|
+
* @brief Audio loss rate
|
|
736
818
|
*/
|
|
737
819
|
audioLossRate: number;
|
|
738
820
|
|
|
739
821
|
/**
|
|
740
|
-
* Bitrate of sending, unit: kbps
|
|
822
|
+
* @brief Bitrate of sending, unit: kbps
|
|
741
823
|
*/
|
|
742
824
|
sendKBitrate: number;
|
|
743
825
|
|
|
744
826
|
/**
|
|
745
|
-
* Sample rate of audio capturing
|
|
827
|
+
* @brief Sample rate of audio capturing
|
|
746
828
|
*/
|
|
747
829
|
recordSampleRate: number;
|
|
748
830
|
|
|
749
831
|
/**
|
|
750
|
-
* Interval of each states
|
|
832
|
+
* @brief Interval of each states
|
|
751
833
|
*/
|
|
752
834
|
statsInterval: number;
|
|
753
835
|
|
|
754
836
|
/**
|
|
755
|
-
* Round trip time, unit: ms
|
|
837
|
+
* @brief Round trip time, unit: ms
|
|
756
838
|
*/
|
|
757
839
|
rtt: number;
|
|
758
840
|
|
|
759
841
|
/**
|
|
760
|
-
* number of the signal channels
|
|
842
|
+
* @brief number of the signal channels
|
|
761
843
|
*/
|
|
762
844
|
numChannels: number;
|
|
763
845
|
|
|
764
846
|
/**
|
|
765
|
-
* Sample rate of sending
|
|
847
|
+
* @brief Sample rate of sending
|
|
766
848
|
*/
|
|
767
849
|
sentSampleRate?: number;
|
|
768
850
|
}
|
|
@@ -773,82 +855,82 @@ export interface LocalAudioStats {
|
|
|
773
855
|
export interface LocalVideoStats {
|
|
774
856
|
|
|
775
857
|
/**
|
|
776
|
-
* Bitrate of sending, unit: kbps
|
|
858
|
+
* @brief Bitrate of sending, unit: kbps
|
|
777
859
|
*/
|
|
778
860
|
sentKBitrate: number;
|
|
779
861
|
|
|
780
862
|
/**
|
|
781
|
-
* Frame rate of the source video
|
|
863
|
+
* @brief Frame rate of the source video
|
|
782
864
|
*/
|
|
783
865
|
inputFrameRate?: number;
|
|
784
866
|
|
|
785
867
|
/**
|
|
786
|
-
* Frame rate of sending
|
|
868
|
+
* @brief Frame rate of sending
|
|
787
869
|
*/
|
|
788
870
|
sentFrameRate: number;
|
|
789
871
|
|
|
790
872
|
/**
|
|
791
|
-
* Frame rate of encoding
|
|
873
|
+
* @brief Frame rate of encoding
|
|
792
874
|
*/
|
|
793
875
|
encoderOutputFrameRate: number;
|
|
794
876
|
|
|
795
877
|
/**
|
|
796
|
-
* Frame rate of rendering
|
|
878
|
+
* @brief Frame rate of rendering
|
|
797
879
|
*/
|
|
798
880
|
rendererOutputFrameRate?: number;
|
|
799
881
|
|
|
800
882
|
/**
|
|
801
|
-
* Target bitrate
|
|
883
|
+
* @brief Target bitrate
|
|
802
884
|
*/
|
|
803
885
|
targetKBitrate?: number;
|
|
804
886
|
|
|
805
887
|
/**
|
|
806
|
-
* Target frame rate
|
|
888
|
+
* @brief Target frame rate
|
|
807
889
|
*/
|
|
808
890
|
targetFrameRate?: number;
|
|
809
891
|
|
|
810
892
|
/**
|
|
811
|
-
* Interval of each states
|
|
893
|
+
* @brief Interval of each states
|
|
812
894
|
*/
|
|
813
895
|
statsInterval: number;
|
|
814
896
|
|
|
815
897
|
/**
|
|
816
|
-
* Loss rate of video package
|
|
898
|
+
* @brief Loss rate of video package
|
|
817
899
|
*/
|
|
818
900
|
videoLossRate: number;
|
|
819
901
|
|
|
820
902
|
/**
|
|
821
|
-
* Round trip time, unit: ms
|
|
903
|
+
* @brief Round trip time, unit: ms
|
|
822
904
|
*/
|
|
823
905
|
rtt: number;
|
|
824
906
|
|
|
825
907
|
/**
|
|
826
|
-
* Bitrate of encoding
|
|
908
|
+
* @brief Bitrate of encoding
|
|
827
909
|
*/
|
|
828
910
|
encodedBitrate?: number;
|
|
829
911
|
|
|
830
912
|
/**
|
|
831
|
-
* Frame rate of encoding
|
|
913
|
+
* @brief Frame rate of encoding
|
|
832
914
|
*/
|
|
833
915
|
encodedFrameWidth: number;
|
|
834
916
|
|
|
835
917
|
/**
|
|
836
|
-
* Height of the encoded video frame
|
|
918
|
+
* @brief Height of the encoded video frame
|
|
837
919
|
*/
|
|
838
920
|
encodedFrameHeight: number;
|
|
839
921
|
|
|
840
922
|
/**
|
|
841
|
-
* Number of encoded frames
|
|
923
|
+
* @brief Number of encoded frames
|
|
842
924
|
*/
|
|
843
925
|
encodedFrameCount: number;
|
|
844
926
|
|
|
845
927
|
/**
|
|
846
|
-
* Encoding type
|
|
928
|
+
* @brief Encoding type
|
|
847
929
|
*/
|
|
848
930
|
codecType: string;
|
|
849
931
|
|
|
850
932
|
/**
|
|
851
|
-
* Whether it is a screen-sharing stream
|
|
933
|
+
* @brief Whether it is a screen-sharing stream
|
|
852
934
|
*/
|
|
853
935
|
isScreen: boolean;
|
|
854
936
|
}
|
|
@@ -859,29 +941,29 @@ export interface LocalVideoStats {
|
|
|
859
941
|
export interface LocalStreamStats {
|
|
860
942
|
|
|
861
943
|
/**
|
|
862
|
-
* State of the local audio stream
|
|
944
|
+
* @brief State of the local audio stream
|
|
863
945
|
*/
|
|
864
946
|
audioStats: LocalAudioStats;
|
|
865
947
|
|
|
866
948
|
/**
|
|
867
|
-
* State of the local video stream
|
|
949
|
+
* @brief State of the local video stream
|
|
868
950
|
*/
|
|
869
951
|
videoStats: LocalVideoStats;
|
|
870
952
|
|
|
871
953
|
/**
|
|
872
|
-
* Whether it is a screen-sharing stream
|
|
954
|
+
* @brief Whether it is a screen-sharing stream
|
|
873
955
|
*/
|
|
874
956
|
isScreen: boolean;
|
|
875
957
|
|
|
876
958
|
/**
|
|
877
959
|
* @hidden
|
|
878
|
-
* Quality of the uplink network
|
|
960
|
+
* @brief Quality of the uplink network
|
|
879
961
|
*/
|
|
880
962
|
txQuality?: number;
|
|
881
963
|
|
|
882
964
|
/**
|
|
883
965
|
* @hidden
|
|
884
|
-
* Quality of the downlink network
|
|
966
|
+
* @brief Quality of the downlink network
|
|
885
967
|
*/
|
|
886
968
|
rxQuality?: number;
|
|
887
969
|
}
|
|
@@ -892,88 +974,88 @@ export interface LocalStreamStats {
|
|
|
892
974
|
export interface RemoteAudioStats {
|
|
893
975
|
|
|
894
976
|
/**
|
|
895
|
-
* Loss rate of the audio packages
|
|
977
|
+
* @brief Loss rate of the audio packages
|
|
896
978
|
*/
|
|
897
979
|
audioLossRate: number;
|
|
898
980
|
|
|
899
981
|
/**
|
|
900
|
-
* Bitrate of receiving
|
|
982
|
+
* @brief Bitrate of receiving
|
|
901
983
|
*/
|
|
902
984
|
receivedKBitrate: number;
|
|
903
985
|
|
|
904
986
|
/**
|
|
905
|
-
* Number of video stalls
|
|
987
|
+
* @brief Number of video stalls
|
|
906
988
|
*/
|
|
907
989
|
stallCount?: number;
|
|
908
990
|
|
|
909
991
|
/**
|
|
910
|
-
* Duration of a video stall
|
|
992
|
+
* @brief Duration of a video stall
|
|
911
993
|
*/
|
|
912
994
|
stallDuration?: number;
|
|
913
995
|
|
|
914
996
|
/**
|
|
915
|
-
* End-to-end delay, unit: ms
|
|
997
|
+
* @brief End-to-end delay, unit: ms
|
|
916
998
|
*/
|
|
917
999
|
e2eDelay: number;
|
|
918
1000
|
|
|
919
1001
|
/**
|
|
920
|
-
* Sample rate of the playback
|
|
1002
|
+
* @brief Sample rate of the playback
|
|
921
1003
|
*/
|
|
922
1004
|
playoutSampleRate?: number;
|
|
923
1005
|
|
|
924
1006
|
/**
|
|
925
|
-
* Interval of each report of states
|
|
1007
|
+
* @brief Interval of each report of states
|
|
926
1008
|
*/
|
|
927
1009
|
statsInterval: number;
|
|
928
1010
|
|
|
929
1011
|
/**
|
|
930
|
-
* Round trip time, unit: ms
|
|
1012
|
+
* @brief Round trip time, unit: ms
|
|
931
1013
|
*/
|
|
932
1014
|
rtt: number;
|
|
933
1015
|
|
|
934
1016
|
/**
|
|
935
1017
|
* @hidden
|
|
936
|
-
* Quality of the media stream
|
|
1018
|
+
* @brief Quality of the media stream
|
|
937
1019
|
*/
|
|
938
1020
|
quality?: number;
|
|
939
1021
|
|
|
940
1022
|
/**
|
|
941
|
-
* Jitter buffer delay, unit: ms
|
|
1023
|
+
* @brief Jitter buffer delay, unit: ms
|
|
942
1024
|
*/
|
|
943
1025
|
jitterBufferDelay: number;
|
|
944
1026
|
|
|
945
1027
|
/**
|
|
946
|
-
* Number of channels
|
|
1028
|
+
* @brief Number of channels
|
|
947
1029
|
*/
|
|
948
1030
|
numChannels: number;
|
|
949
1031
|
|
|
950
1032
|
/**
|
|
951
|
-
* Sample rate of the received stream
|
|
1033
|
+
* @brief Sample rate of the received stream
|
|
952
1034
|
*/
|
|
953
1035
|
receivedSampleRate: number;
|
|
954
1036
|
|
|
955
1037
|
/**
|
|
956
|
-
* Video frozen rate
|
|
1038
|
+
* @brief Video frozen rate
|
|
957
1039
|
*/
|
|
958
1040
|
frozenRate?: number;
|
|
959
1041
|
|
|
960
1042
|
/**
|
|
961
|
-
* Concealed samples
|
|
1043
|
+
* @brief Concealed samples
|
|
962
1044
|
*/
|
|
963
1045
|
concealedSamples: number;
|
|
964
1046
|
|
|
965
1047
|
/**
|
|
966
|
-
* Concealment events
|
|
1048
|
+
* @brief Concealment events
|
|
967
1049
|
*/
|
|
968
1050
|
concealmentEvent: number;
|
|
969
1051
|
|
|
970
1052
|
/**
|
|
971
|
-
* Sample rate of decoding
|
|
1053
|
+
* @brief Sample rate of decoding
|
|
972
1054
|
*/
|
|
973
1055
|
decSampleRate?: number;
|
|
974
1056
|
|
|
975
1057
|
/**
|
|
976
|
-
* Decoding duration, unit: s
|
|
1058
|
+
* @brief Decoding duration, unit: s
|
|
977
1059
|
*/
|
|
978
1060
|
decDuration?: number;
|
|
979
1061
|
}
|
|
@@ -984,72 +1066,72 @@ export interface RemoteAudioStats {
|
|
|
984
1066
|
export interface RemoteVideoStats {
|
|
985
1067
|
|
|
986
1068
|
/**
|
|
987
|
-
* Width
|
|
1069
|
+
* @brief Width
|
|
988
1070
|
*/
|
|
989
1071
|
width: number;
|
|
990
1072
|
|
|
991
1073
|
/**
|
|
992
|
-
* Height
|
|
1074
|
+
* @brief Height
|
|
993
1075
|
*/
|
|
994
1076
|
height: number;
|
|
995
1077
|
|
|
996
1078
|
/**
|
|
997
|
-
* Loss rate of the video packages
|
|
1079
|
+
* @brief Loss rate of the video packages
|
|
998
1080
|
*/
|
|
999
1081
|
videoLossRate: number;
|
|
1000
1082
|
|
|
1001
1083
|
/**
|
|
1002
|
-
* Bitrate of the received video stream
|
|
1084
|
+
* @brief Bitrate of the received video stream
|
|
1003
1085
|
*/
|
|
1004
1086
|
receivedKBitrate: number;
|
|
1005
1087
|
|
|
1006
1088
|
/**
|
|
1007
|
-
* Frame rate of decoding
|
|
1089
|
+
* @brief Frame rate of decoding
|
|
1008
1090
|
*/
|
|
1009
1091
|
decoderOutputFrameRate: number;
|
|
1010
1092
|
|
|
1011
1093
|
/**
|
|
1012
|
-
* Frame rate of rendering
|
|
1094
|
+
* @brief Frame rate of rendering
|
|
1013
1095
|
*/
|
|
1014
1096
|
rendererOutputFrameRate?: number;
|
|
1015
1097
|
|
|
1016
1098
|
/**
|
|
1017
|
-
* Number of video stalls
|
|
1099
|
+
* @brief Number of video stalls
|
|
1018
1100
|
*/
|
|
1019
1101
|
stallCount?: number;
|
|
1020
1102
|
|
|
1021
1103
|
/**
|
|
1022
|
-
* Duration of a video stall
|
|
1104
|
+
* @brief Duration of a video stall
|
|
1023
1105
|
*/
|
|
1024
1106
|
stallDuration?: number;
|
|
1025
1107
|
|
|
1026
1108
|
/**
|
|
1027
|
-
* End-to-end delay, unit: ms
|
|
1109
|
+
* @brief End-to-end delay, unit: ms
|
|
1028
1110
|
*/
|
|
1029
1111
|
e2eDelay: number;
|
|
1030
1112
|
|
|
1031
1113
|
/**
|
|
1032
|
-
* Whether it is a screen-sharing stream
|
|
1114
|
+
* @brief Whether it is a screen-sharing stream
|
|
1033
1115
|
*/
|
|
1034
1116
|
isScreen: boolean;
|
|
1035
1117
|
|
|
1036
1118
|
/**
|
|
1037
|
-
* Interval of each states
|
|
1119
|
+
* @brief Interval of each states
|
|
1038
1120
|
*/
|
|
1039
1121
|
statsInterval: number;
|
|
1040
1122
|
|
|
1041
1123
|
/**
|
|
1042
|
-
* Round trip time, unit: ms
|
|
1124
|
+
* @brief Round trip time, unit: ms
|
|
1043
1125
|
*/
|
|
1044
1126
|
rtt: number;
|
|
1045
1127
|
|
|
1046
1128
|
/**
|
|
1047
|
-
* Video frozen rate
|
|
1129
|
+
* @brief Video frozen rate
|
|
1048
1130
|
*/
|
|
1049
1131
|
frozenRate?: number;
|
|
1050
1132
|
|
|
1051
1133
|
/**
|
|
1052
|
-
* Video index
|
|
1134
|
+
* @brief Video index
|
|
1053
1135
|
*/
|
|
1054
1136
|
videoIndex?: number;
|
|
1055
1137
|
}
|
|
@@ -1060,171 +1142,171 @@ export interface RemoteVideoStats {
|
|
|
1060
1142
|
export interface RemoteStreamStats {
|
|
1061
1143
|
|
|
1062
1144
|
/**
|
|
1063
|
-
* userId of the user who is joining the room
|
|
1145
|
+
* @brief userId of the user who is joining the room
|
|
1064
1146
|
*/
|
|
1065
1147
|
userId?: string;
|
|
1066
1148
|
|
|
1067
1149
|
/**
|
|
1068
|
-
* State of the remote audio stream
|
|
1150
|
+
* @brief State of the remote audio stream
|
|
1069
1151
|
*/
|
|
1070
1152
|
audioStats: RemoteAudioStats;
|
|
1071
1153
|
|
|
1072
1154
|
/**
|
|
1073
|
-
* State of the remote video stream
|
|
1155
|
+
* @brief State of the remote video stream
|
|
1074
1156
|
*/
|
|
1075
1157
|
videoStats: RemoteVideoStats;
|
|
1076
1158
|
|
|
1077
1159
|
/**
|
|
1078
|
-
* Whether it is a screen-sharing stream
|
|
1160
|
+
* @brief Whether it is a screen-sharing stream
|
|
1079
1161
|
*/
|
|
1080
1162
|
isScreen: boolean;
|
|
1081
1163
|
|
|
1082
1164
|
/**
|
|
1083
|
-
* Quality of the transmitting stream
|
|
1165
|
+
* @brief Quality of the transmitting stream
|
|
1084
1166
|
*/
|
|
1085
1167
|
txQuality?: number;
|
|
1086
1168
|
|
|
1087
1169
|
/**
|
|
1088
|
-
* Quality of the receiving stream
|
|
1170
|
+
* @brief Quality of the receiving stream
|
|
1089
1171
|
*/
|
|
1090
1172
|
rxQuality?: number;
|
|
1091
1173
|
}
|
|
1092
1174
|
declare enum EngineEventsTypes {
|
|
1093
1175
|
|
|
1094
1176
|
/**
|
|
1095
|
-
* The media track ends.
|
|
1177
|
+
* @brief The media track ends.
|
|
1096
1178
|
*/
|
|
1097
1179
|
onTrackEnded = "onTrackEnded",
|
|
1098
1180
|
|
|
1099
1181
|
/**
|
|
1100
|
-
* Player event
|
|
1182
|
+
* @brief Player event
|
|
1101
1183
|
*/
|
|
1102
1184
|
onPlayerEvent = "onPlayerEvent",
|
|
1103
1185
|
|
|
1104
1186
|
/**
|
|
1105
|
-
* Streams fails to play automatically.
|
|
1187
|
+
* @brief Streams fails to play automatically.
|
|
1106
1188
|
*/
|
|
1107
1189
|
onAutoplayFailed = "onAutoplayFailed",
|
|
1108
1190
|
|
|
1109
1191
|
/**
|
|
1110
|
-
* A user joins the room.
|
|
1192
|
+
* @brief A user joins the room.
|
|
1111
1193
|
*/
|
|
1112
1194
|
onUserJoined = "onUserJoined",
|
|
1113
1195
|
|
|
1114
1196
|
/**
|
|
1115
|
-
* A user leaves the room.
|
|
1197
|
+
* @brief A user leaves the room.
|
|
1116
1198
|
*/
|
|
1117
1199
|
onUserLeave = "onUserLeave",
|
|
1118
1200
|
|
|
1119
1201
|
/**
|
|
1120
|
-
* Connection state changes.
|
|
1202
|
+
* @brief Connection state changes.
|
|
1121
1203
|
*/
|
|
1122
1204
|
onConnectionStateChanged = "onConnectionStateChanged",
|
|
1123
1205
|
|
|
1124
1206
|
/**
|
|
1125
|
-
* A new media stream in the room
|
|
1207
|
+
* @brief A new media stream in the room
|
|
1126
1208
|
*/
|
|
1127
1209
|
onStreamAdd = "onStreamAdd",
|
|
1128
1210
|
|
|
1129
1211
|
/**
|
|
1130
|
-
* A media stream in the room has been stopped.
|
|
1212
|
+
* @brief A media stream in the room has been stopped.
|
|
1131
1213
|
*/
|
|
1132
1214
|
onStreamRemove = "onStreamRemove",
|
|
1133
1215
|
|
|
1134
1216
|
/**
|
|
1135
|
-
* Receiving a broadcasting message in the room
|
|
1217
|
+
* @brief Receiving a broadcasting message in the room
|
|
1136
1218
|
*/
|
|
1137
1219
|
onRoomMessageReceived = "onRoomMessageReceived",
|
|
1138
1220
|
|
|
1139
1221
|
/**
|
|
1140
|
-
* Receiving a broadcasting binary message in the room
|
|
1222
|
+
* @brief Receiving a broadcasting binary message in the room
|
|
1141
1223
|
*/
|
|
1142
1224
|
onRoomBinaryMessageReceived = "onRoomBinaryMessageReceived",
|
|
1143
1225
|
|
|
1144
1226
|
/**
|
|
1145
|
-
* Receiving a point-to-point text message
|
|
1227
|
+
* @brief Receiving a point-to-point text message
|
|
1146
1228
|
*/
|
|
1147
1229
|
onUserMessageReceived = "onUserMessageReceived",
|
|
1148
1230
|
|
|
1149
1231
|
/**
|
|
1150
|
-
* Receiving a point-to-point binary message
|
|
1232
|
+
* @brief Receiving a point-to-point binary message
|
|
1151
1233
|
*/
|
|
1152
1234
|
onUserBinaryMessageReceived = "onUserBinaryMessageReceived",
|
|
1153
1235
|
|
|
1154
1236
|
/**
|
|
1155
|
-
* A visible user in the room mutes his/her audio.
|
|
1237
|
+
* @brief A visible user in the room mutes his/her audio.
|
|
1156
1238
|
*/
|
|
1157
1239
|
onUserMuteAudio = "onUserMuteAudio",
|
|
1158
1240
|
|
|
1159
1241
|
/**
|
|
1160
|
-
* A visible user in the room mutes his/her video.
|
|
1242
|
+
* @brief A visible user in the room mutes his/her video.
|
|
1161
1243
|
*/
|
|
1162
1244
|
onUserMuteVideo = "onUserMuteVideo",
|
|
1163
1245
|
|
|
1164
1246
|
/**
|
|
1165
|
-
* The first video frame has been rendered successfully.
|
|
1247
|
+
* @brief The first video frame has been rendered successfully.
|
|
1166
1248
|
*/
|
|
1167
1249
|
onVideoFirstFrameRendered = "onVideoFirstFrameRendered",
|
|
1168
1250
|
|
|
1169
1251
|
/**
|
|
1170
|
-
* The first video frame has been decoded successfully.
|
|
1252
|
+
* @brief The first video frame has been decoded successfully.
|
|
1171
1253
|
*/
|
|
1172
1254
|
onVideoFirstFrameDecoded = "onVideoFirstFrameDecoded",
|
|
1173
1255
|
|
|
1174
1256
|
/**
|
|
1175
|
-
* The first audio frame has been decoded successfully.
|
|
1257
|
+
* @brief The first audio frame has been decoded successfully.
|
|
1176
1258
|
*/
|
|
1177
1259
|
onAudioFirstFrameDecoded = "onAudioFirstFrameDecoded",
|
|
1178
1260
|
|
|
1179
1261
|
/**
|
|
1180
|
-
* The state of the media device changes.
|
|
1262
|
+
* @brief The state of the media device changes.
|
|
1181
1263
|
*/
|
|
1182
1264
|
onMediaDeviceStateChanged = "onMediaDeviceStateChanged",
|
|
1183
1265
|
|
|
1184
1266
|
/**
|
|
1185
|
-
* Callback including the state of the remote media stream
|
|
1267
|
+
* @brief Callback including the state of the remote media stream
|
|
1186
1268
|
*/
|
|
1187
1269
|
onRemoteStreamStats = "onRemoteStreamStats",
|
|
1188
1270
|
|
|
1189
1271
|
/**
|
|
1190
|
-
* Callback including the state of the local media stream
|
|
1272
|
+
* @brief Callback including the state of the local media stream
|
|
1191
1273
|
*/
|
|
1192
1274
|
onLocalStreamStats = "onLocalStreamStats",
|
|
1193
1275
|
|
|
1194
1276
|
/**
|
|
1195
|
-
* Indication of audio volume
|
|
1277
|
+
* @brief Indication of audio volume
|
|
1196
1278
|
*/
|
|
1197
1279
|
onAudioVolumeIndication = "onAudioVolumeIndication",
|
|
1198
1280
|
|
|
1199
1281
|
/**
|
|
1200
|
-
* Callback of the state changing of audio playback devices
|
|
1282
|
+
* @brief Callback of the state changing of audio playback devices
|
|
1201
1283
|
*/
|
|
1202
1284
|
onAudioPlaybackDeviceChanged = "onAudioPlaybackDeviceChanged",
|
|
1203
1285
|
|
|
1204
1286
|
/**
|
|
1205
|
-
* A publisher starts video capture.
|
|
1287
|
+
* @brief A publisher starts video capture.
|
|
1206
1288
|
*/
|
|
1207
1289
|
onUserStartVideoCapture = "onUserStartVideoCapture",
|
|
1208
1290
|
|
|
1209
1291
|
/**
|
|
1210
|
-
* A publisher stops video capture.
|
|
1292
|
+
* @brief A publisher stops video capture.
|
|
1211
1293
|
*/
|
|
1212
1294
|
onUserStopVideoCapture = "onUserStopVideoCapture",
|
|
1213
1295
|
|
|
1214
1296
|
/**
|
|
1215
|
-
* A publisher starts audio capture.
|
|
1297
|
+
* @brief A publisher starts audio capture.
|
|
1216
1298
|
*/
|
|
1217
1299
|
onUserStartAudioCapture = "onUserStartAudioCapture",
|
|
1218
1300
|
|
|
1219
1301
|
/**
|
|
1220
|
-
* A publisher stops audio capture.
|
|
1302
|
+
* @brief A publisher stops audio capture.
|
|
1221
1303
|
*/
|
|
1222
1304
|
onUserStopAudioCapture = "onUserStopAudioCapture",
|
|
1223
1305
|
onAutoPublishResult = "onAutoPublishResult",
|
|
1224
1306
|
onAutoSubscribeResult = "onAutoSubscribeResult",
|
|
1225
1307
|
|
|
1226
1308
|
/**
|
|
1227
|
-
* The state of pushing streams to CDN
|
|
1309
|
+
* @brief The state of pushing streams to CDN
|
|
1228
1310
|
*/
|
|
1229
1311
|
onLiveTranscodingResult = "onLiveTranscodingResult",
|
|
1230
1312
|
onSEIMessageReceived = "onSEIMessageReceived",
|
|
@@ -1240,7 +1322,7 @@ declare enum EngineEventsTypes {
|
|
|
1240
1322
|
export interface UserConnectionEvent {
|
|
1241
1323
|
|
|
1242
1324
|
/**
|
|
1243
|
-
* User information, refer to [UserInfo](#userinfo) for more details.
|
|
1325
|
+
* @brief User information, refer to [UserInfo](#userinfo) for more details.
|
|
1244
1326
|
*/
|
|
1245
1327
|
userInfo: UserInfo;
|
|
1246
1328
|
}
|
|
@@ -1251,91 +1333,91 @@ export interface UserConnectionEvent {
|
|
|
1251
1333
|
export interface UserDisconnectionEvent {
|
|
1252
1334
|
|
|
1253
1335
|
/**
|
|
1254
|
-
* User information, refer to [UserInfo](#userinfo) for more details.
|
|
1336
|
+
* @brief User information, refer to [UserInfo](#userinfo) for more details.
|
|
1255
1337
|
*/
|
|
1256
1338
|
userInfo: UserInfo;
|
|
1257
1339
|
|
|
1258
1340
|
/**
|
|
1259
|
-
* Reason of disconnection
|
|
1341
|
+
* @brief Reason of disconnection
|
|
1260
1342
|
*/
|
|
1261
1343
|
reason: string;
|
|
1262
1344
|
}
|
|
1263
1345
|
|
|
1264
1346
|
/**
|
|
1265
|
-
* Receiving video frames carrying SEI message
|
|
1347
|
+
* @brief Receiving video frames carrying SEI message
|
|
1266
1348
|
*/
|
|
1267
1349
|
export interface onSEIMessageReceivedEvent {
|
|
1268
1350
|
|
|
1269
1351
|
/**
|
|
1270
|
-
* Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message.
|
|
1352
|
+
* @brief Including userId of the user who sent the message, roomId of the current room, and the media stream carrying this SEI message.
|
|
1271
1353
|
*/
|
|
1272
1354
|
remoteStreamKey: RemoteStreamKey;
|
|
1273
1355
|
}
|
|
1274
1356
|
|
|
1275
1357
|
/**
|
|
1276
|
-
* User mutes audio or video.
|
|
1358
|
+
* @brief User mutes audio or video.
|
|
1277
1359
|
*/
|
|
1278
1360
|
export interface UserMuteEvent {
|
|
1279
1361
|
|
|
1280
1362
|
/**
|
|
1281
|
-
* User information, refer to [UserInfo](#userinfo) for more details.
|
|
1363
|
+
* @brief User information, refer to [UserInfo](#userinfo) for more details.
|
|
1282
1364
|
*/
|
|
1283
1365
|
userInfo: UserInfo;
|
|
1284
1366
|
|
|
1285
1367
|
/**
|
|
1286
|
-
* Details of disabling audio or video.
|
|
1368
|
+
* @brief Details of disabling audio or video.
|
|
1287
1369
|
*/
|
|
1288
1370
|
muteState: MuteState;
|
|
1289
1371
|
}
|
|
1290
1372
|
|
|
1291
1373
|
/**
|
|
1292
|
-
* The connection state changes.
|
|
1374
|
+
* @brief The connection state changes.
|
|
1293
1375
|
*/
|
|
1294
1376
|
export interface ConnectionStateChangeEvent {
|
|
1295
1377
|
|
|
1296
1378
|
/**
|
|
1297
|
-
* The internal connection state
|
|
1379
|
+
* @brief The internal connection state
|
|
1298
1380
|
*/
|
|
1299
1381
|
state: ConnectionState;
|
|
1300
1382
|
}
|
|
1301
1383
|
|
|
1302
1384
|
/**
|
|
1303
|
-
* Event related to the player
|
|
1385
|
+
* @brief Event related to the player
|
|
1304
1386
|
*/
|
|
1305
1387
|
export interface PlayerEvent {
|
|
1306
1388
|
|
|
1307
1389
|
/**
|
|
1308
|
-
* Type of the player
|
|
1390
|
+
* @brief Type of the player
|
|
1309
1391
|
*/
|
|
1310
1392
|
type: "video" | "audio";
|
|
1311
1393
|
|
|
1312
1394
|
/**
|
|
1313
|
-
* Event name
|
|
1395
|
+
* @brief Event name
|
|
1314
1396
|
*/
|
|
1315
1397
|
eventName: string;
|
|
1316
1398
|
|
|
1317
1399
|
/**
|
|
1318
|
-
* Play event. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event) for more details.
|
|
1400
|
+
* @brief Play event. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play_event) for more details.
|
|
1319
1401
|
*/
|
|
1320
1402
|
rawEvent: Event;
|
|
1321
1403
|
|
|
1322
1404
|
/**
|
|
1323
|
-
* userId of the user who is joining the room
|
|
1405
|
+
* @brief userId of the user who is joining the room
|
|
1324
1406
|
*/
|
|
1325
1407
|
userId: string;
|
|
1326
1408
|
|
|
1327
1409
|
/**
|
|
1328
|
-
* Readies state of the medias. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState)
|
|
1410
|
+
* @brief Readies state of the medias. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState)
|
|
1329
1411
|
*/
|
|
1330
1412
|
readyState: number;
|
|
1331
1413
|
|
|
1332
1414
|
/**
|
|
1333
|
-
* The current time
|
|
1415
|
+
* @brief The current time
|
|
1334
1416
|
*/
|
|
1335
1417
|
currentTime: number;
|
|
1336
1418
|
|
|
1337
1419
|
/**
|
|
1338
|
-
* Whether it is a screen-sharing stream
|
|
1420
|
+
* @brief Whether it is a screen-sharing stream
|
|
1339
1421
|
*/
|
|
1340
1422
|
isScreen?: boolean;
|
|
1341
1423
|
}
|
|
@@ -1346,17 +1428,17 @@ export interface PlayerEvent {
|
|
|
1346
1428
|
export interface AudioMixingStateChangedEvent {
|
|
1347
1429
|
|
|
1348
1430
|
/**
|
|
1349
|
-
* Audio mixing ID
|
|
1431
|
+
* @brief Audio mixing ID
|
|
1350
1432
|
*/
|
|
1351
1433
|
mixId: number;
|
|
1352
1434
|
|
|
1353
1435
|
/**
|
|
1354
|
-
* State of the audio mixing
|
|
1436
|
+
* @brief State of the audio mixing
|
|
1355
1437
|
*/
|
|
1356
1438
|
state: AudioMixingState;
|
|
1357
1439
|
|
|
1358
1440
|
/**
|
|
1359
|
-
* Error of the audio mixing
|
|
1441
|
+
* @brief Error of the audio mixing
|
|
1360
1442
|
*/
|
|
1361
1443
|
error: AudioMixingError;
|
|
1362
1444
|
}
|
|
@@ -1368,36 +1450,36 @@ export interface AudioMixingStateChangedEvent {
|
|
|
1368
1450
|
export interface IEngineEvents {
|
|
1369
1451
|
|
|
1370
1452
|
/**
|
|
1371
|
-
* Player event
|
|
1453
|
+
* @brief Player event
|
|
1372
1454
|
* @param event
|
|
1373
1455
|
* @region Video Management Event
|
|
1374
1456
|
*/
|
|
1375
1457
|
[EngineEventsTypes.onPlayerEvent]: (event: PlayerEvent) => void;
|
|
1376
1458
|
|
|
1377
1459
|
/**
|
|
1378
|
-
* The user joined.
|
|
1460
|
+
* @brief The user joined.
|
|
1379
1461
|
* @param event
|
|
1380
1462
|
* @region Room Management Event
|
|
1381
1463
|
*/
|
|
1382
1464
|
[EngineEventsTypes.onUserJoined]: (event: onUserJoinedEvent) => void;
|
|
1383
1465
|
|
|
1384
1466
|
/**
|
|
1385
|
-
* The user leaved.
|
|
1467
|
+
* @brief The user leaved.
|
|
1386
1468
|
* @param event
|
|
1387
1469
|
* @region Room Management Event
|
|
1388
1470
|
*/
|
|
1389
1471
|
[EngineEventsTypes.onUserLeave]: (event: onUserLeaveEvent) => void;
|
|
1390
1472
|
|
|
1391
1473
|
/**
|
|
1392
|
-
* Connection state changed
|
|
1474
|
+
* @brief Connection state changed
|
|
1393
1475
|
* @param event
|
|
1394
1476
|
* @region Network Event
|
|
1395
1477
|
*/
|
|
1396
1478
|
[EngineEventsTypes.onConnectionStateChanged]: (event: ConnectionStateChangeEvent) => void;
|
|
1397
1479
|
|
|
1398
1480
|
/**
|
|
1399
|
-
* A new stream added into the room.
|
|
1400
|
-
* @param event `stream` object.
|
|
1481
|
+
* @brief A new stream added into the room.
|
|
1482
|
+
* @param event `stream` object.
|
|
1401
1483
|
* @region Room Management Event
|
|
1402
1484
|
*/
|
|
1403
1485
|
[EngineEventsTypes.onStreamAdd]: (event: {
|
|
@@ -1405,22 +1487,22 @@ export interface IEngineEvents {
|
|
|
1405
1487
|
}) => void;
|
|
1406
1488
|
|
|
1407
1489
|
/**
|
|
1408
|
-
* Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
|
|
1490
|
+
* @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
|
|
1409
1491
|
* @param event
|
|
1410
1492
|
* @region Room Management Event
|
|
1411
1493
|
*/
|
|
1412
1494
|
[EngineEventsTypes.onUserMuteAudio]: (event: UserMuteEvent) => void;
|
|
1413
1495
|
|
|
1414
1496
|
/**
|
|
1415
|
-
* Users will receive this event when a user in the room pauses/ resumes publishing video stream.
|
|
1497
|
+
* @brief Users will receive this event when a user in the room pauses/ resumes publishing video stream.
|
|
1416
1498
|
* @region Room Management Event
|
|
1417
1499
|
* @param event
|
|
1418
1500
|
*/
|
|
1419
1501
|
[EngineEventsTypes.onUserMuteVideo]: (event: UserMuteEvent) => void;
|
|
1420
1502
|
|
|
1421
1503
|
/**
|
|
1422
|
-
* Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
|
|
1423
|
-
* @param event <li>stream:
|
|
1504
|
+
* @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
|
|
1505
|
+
* @param event <li>stream: media stream</li><li>reason</li>.
|
|
1424
1506
|
* @region Room Management Event
|
|
1425
1507
|
*/
|
|
1426
1508
|
[EngineEventsTypes.onStreamRemove]: (event: {
|
|
@@ -1429,43 +1511,42 @@ export interface IEngineEvents {
|
|
|
1429
1511
|
}) => void;
|
|
1430
1512
|
|
|
1431
1513
|
/**
|
|
1432
|
-
* Rendering of the first video frame
|
|
1514
|
+
* @brief Rendering of the first video frame
|
|
1433
1515
|
* @param event
|
|
1434
1516
|
* @region Video Management Event
|
|
1435
1517
|
*/
|
|
1436
1518
|
[EngineEventsTypes.onVideoFirstFrameRendered]: (event: onVideoFirstFrameRenderedEvent) => void;
|
|
1437
1519
|
|
|
1438
1520
|
/**
|
|
1439
|
-
* Decoding of the first video frame
|
|
1521
|
+
* @brief Decoding of the first video frame
|
|
1440
1522
|
* @param event
|
|
1441
1523
|
* @region Video Management Event
|
|
1442
1524
|
*/
|
|
1443
1525
|
[EngineEventsTypes.onVideoFirstFrameDecoded]: (event: onVideoFirstFrameDecodedEvent) => void;
|
|
1444
1526
|
|
|
1445
1527
|
/**
|
|
1446
|
-
* Decoding of the first audio frame
|
|
1528
|
+
* @brief Decoding of the first audio frame
|
|
1447
1529
|
* @param event
|
|
1448
1530
|
* @region Audio Management Event
|
|
1449
1531
|
*/
|
|
1450
1532
|
[EngineEventsTypes.onAudioFirstFrameDecoded]: (event: onAudioFirstFrameDecodedEvent) => void;
|
|
1451
1533
|
|
|
1452
1534
|
/**
|
|
1453
|
-
* Event of device state changing
|
|
1454
|
-
* @param event
|
|
1535
|
+
* @brief Event of media device state changing
|
|
1536
|
+
* @param event Media device and its state
|
|
1455
1537
|
* @region Engine Management Event
|
|
1456
1538
|
*/
|
|
1457
1539
|
[EngineEventsTypes.onMediaDeviceStateChanged]: (event: RTCDevice) => void;
|
|
1458
|
-
/**
|
|
1459
1540
|
|
|
1460
1541
|
/**
|
|
1461
|
-
* Failure of automatically playing
|
|
1542
|
+
* @brief Failure of automatically playing
|
|
1462
1543
|
* @param event
|
|
1463
1544
|
* @region Video Management Event
|
|
1464
1545
|
*/
|
|
1465
1546
|
[EngineEventsTypes.onAutoplayFailed]: (event: PlayerEvent) => void;
|
|
1466
1547
|
|
|
1467
1548
|
/**
|
|
1468
|
-
* Event of media track ending
|
|
1549
|
+
* @brief Event of media track ending
|
|
1469
1550
|
* @param event <li>kind: string Type of the track</li><li>isScreen: boolean Whether it is a screen-sharing stream</li>
|
|
1470
1551
|
* @region Video Management Event
|
|
1471
1552
|
*/
|
|
@@ -1475,7 +1556,7 @@ export interface IEngineEvents {
|
|
|
1475
1556
|
}) => void;
|
|
1476
1557
|
|
|
1477
1558
|
/**
|
|
1478
|
-
* Event of receiving a broadcast text message in the room
|
|
1559
|
+
* @brief Event of receiving a broadcast text message in the room
|
|
1479
1560
|
* @param event <li>userId: string userID of the message sender</li><li>message: Contents of the message</li>
|
|
1480
1561
|
* @region Message Event
|
|
1481
1562
|
*/
|
|
@@ -1485,7 +1566,7 @@ export interface IEngineEvents {
|
|
|
1485
1566
|
}) => void;
|
|
1486
1567
|
|
|
1487
1568
|
/**
|
|
1488
|
-
* Event of receiving a broadcast binary message in the room
|
|
1569
|
+
* @brief Event of receiving a broadcast binary message in the room
|
|
1489
1570
|
* @param event <li>userId: string userID of the message sender</li><li>message: any Contents of the message</li>
|
|
1490
1571
|
* @region Message Event
|
|
1491
1572
|
*/
|
|
@@ -1495,37 +1576,37 @@ export interface IEngineEvents {
|
|
|
1495
1576
|
}) => void;
|
|
1496
1577
|
|
|
1497
1578
|
/**
|
|
1498
|
-
* Receiving a point-to-point text message from one of the users in the room by calling [sendUserMessage](104478#sendUserMessage)
|
|
1579
|
+
* @brief Receiving a point-to-point text message from one of the users in the room by calling [sendUserMessage](104478#sendUserMessage)
|
|
1499
1580
|
* @param event
|
|
1500
1581
|
* @region Message Event
|
|
1501
1582
|
*/
|
|
1502
1583
|
[EngineEventsTypes.onUserMessageReceived]: (event: UserMessageEvent) => void;
|
|
1503
1584
|
|
|
1504
1585
|
/**
|
|
1505
|
-
* Receiving a point-to-point binary message from one of the users in the room
|
|
1586
|
+
* @brief Receiving a point-to-point binary message from one of the users in the room
|
|
1506
1587
|
* @param event
|
|
1507
1588
|
* @region Message Event
|
|
1508
1589
|
*/
|
|
1509
1590
|
[EngineEventsTypes.onUserBinaryMessageReceived]: (event: UserBinaryMessageEvent) => void;
|
|
1510
1591
|
|
|
1511
1592
|
/**
|
|
1512
|
-
* Statistics of subscribed media streams and network states in a cycle of 2s
|
|
1593
|
+
* @brief Statistics of subscribed media streams and network states in a cycle of 2s
|
|
1513
1594
|
* @param stats
|
|
1514
1595
|
* @region Room Event
|
|
1515
1596
|
*/
|
|
1516
1597
|
[EngineEventsTypes.onRemoteStreamStats]: (stats: RemoteStreamStats) => void;
|
|
1517
1598
|
|
|
1518
1599
|
/**
|
|
1519
|
-
* Statistics of local media streams and network states in a cycle of 2s
|
|
1600
|
+
* @brief Statistics of local media streams and network states in a cycle of 2s
|
|
1520
1601
|
* @param stats
|
|
1521
1602
|
* @region Room Event
|
|
1522
1603
|
*/
|
|
1523
1604
|
[EngineEventsTypes.onLocalStreamStats]: (stats: LocalStreamStats) => void;
|
|
1524
1605
|
|
|
1525
1606
|
/**
|
|
1526
|
-
* Volume of each of the users in the room
|
|
1607
|
+
* @brief Volume of each of the users in the room
|
|
1527
1608
|
* If the user has not joined a room, the list will only include volume of `local_user`.
|
|
1528
|
-
* @param event Active user in the room and his/her volume.
|
|
1609
|
+
* @param event Active user in the room and his/her volume.
|
|
1529
1610
|
* @region Room Event
|
|
1530
1611
|
*/
|
|
1531
1612
|
[EngineEventsTypes.onAudioVolumeIndication]: (event: {
|
|
@@ -1533,14 +1614,14 @@ export interface IEngineEvents {
|
|
|
1533
1614
|
}) => void;
|
|
1534
1615
|
|
|
1535
1616
|
/**
|
|
1536
|
-
* The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
|
|
1617
|
+
* @brief The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
|
|
1537
1618
|
* @param event Information of the media devices. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) for more details.
|
|
1538
1619
|
* @region Audio Management Event
|
|
1539
1620
|
*/
|
|
1540
1621
|
[EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: RTCDevice) => void;
|
|
1541
1622
|
|
|
1542
1623
|
/**
|
|
1543
|
-
* The remote clients in the room will be informed of the state change via this event after the publisher starts audio capture by calling [startAudioCapture](104478#startAudioCapture).
|
|
1624
|
+
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts audio capture by calling [startAudioCapture](104478#startAudioCapture).
|
|
1544
1625
|
* @param event `userId: string` The publisher who starts the internal audio capture
|
|
1545
1626
|
* @region Audio Management Event
|
|
1546
1627
|
*/
|
|
@@ -1549,7 +1630,7 @@ export interface IEngineEvents {
|
|
|
1549
1630
|
}) => void;
|
|
1550
1631
|
|
|
1551
1632
|
/**
|
|
1552
|
-
* The remote clients in the room will be informed of the state change via this event after the publisher stops audio capture by calling [stopAudioCapture](104478#stopAudioCapture).
|
|
1633
|
+
* @brief The remote clients in the room will be informed of the state change via this event after the publisher stops audio capture by calling [stopAudioCapture](104478#stopAudioCapture).
|
|
1553
1634
|
* @param event `userId: string` userId of the publisher who stops the internal audio capture
|
|
1554
1635
|
* @region Room Management Event
|
|
1555
1636
|
*/
|
|
@@ -1558,7 +1639,7 @@ export interface IEngineEvents {
|
|
|
1558
1639
|
}) => void;
|
|
1559
1640
|
|
|
1560
1641
|
/**
|
|
1561
|
-
* The remote clients in the room will be informed of the state change via this event after the publisher starts video capture by calling [startVideoCapture](104478#startVideoCapture).
|
|
1642
|
+
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts video capture by calling [startVideoCapture](104478#startVideoCapture).
|
|
1562
1643
|
* @param event `userId: string` userId of the publisher who starts the internal video capture
|
|
1563
1644
|
* @region Room Management Event
|
|
1564
1645
|
*/
|
|
@@ -1576,15 +1657,15 @@ export interface IEngineEvents {
|
|
|
1576
1657
|
}) => void;
|
|
1577
1658
|
|
|
1578
1659
|
/**
|
|
1579
|
-
* Event of receiving SEI data from video frames
|
|
1660
|
+
* @brief Event of receiving SEI data from video frames
|
|
1580
1661
|
* @param event Event of receiving SEI data
|
|
1581
1662
|
* @region Message Event
|
|
1582
1663
|
*/
|
|
1583
1664
|
[EngineEventsTypes.onSEIMessageReceived]: (event: onSEIMessageEvent) => void;
|
|
1584
1665
|
|
|
1585
1666
|
/**
|
|
1586
|
-
* Result of the Auto-Subscription
|
|
1587
|
-
* @param event <li>`userId: string` userId of the publisher to be subscribed</li><li>`isScreen: boolean` Wether it is a screen-sharing stream</li><li>`state: SubscribeState`
|
|
1667
|
+
* @brief Result of the Auto-Subscription
|
|
1668
|
+
* @param event <li>`userId: string` userId of the publisher to be subscribed</li><li>`isScreen: boolean` Wether it is a screen-sharing stream</li><li>`state: SubscribeState` </li>
|
|
1588
1669
|
* @region Room Management Event
|
|
1589
1670
|
*/
|
|
1590
1671
|
[EngineEventsTypes.onAutoSubscribeResult]: (event: {
|
|
@@ -1594,8 +1675,8 @@ export interface IEngineEvents {
|
|
|
1594
1675
|
}) => void;
|
|
1595
1676
|
|
|
1596
1677
|
/**
|
|
1597
|
-
* Result of Auto-publishing. You will receive this event if you enable Auto-publish when calling `joinRoom`
|
|
1598
|
-
* @param event <li>`isScreen: boolean` Wether it is a screen-sharing stream </li><li>`state: PublishState`
|
|
1678
|
+
* @brief Result of Auto-publishing. You will receive this event if you enable Auto-publish when calling `joinRoom`
|
|
1679
|
+
* @param event <li>`isScreen: boolean` Wether it is a screen-sharing stream </li><li>`state: PublishState` </li>
|
|
1599
1680
|
* @region Room Management Event
|
|
1600
1681
|
*/
|
|
1601
1682
|
[EngineEventsTypes.onAutoPublishResult]: (event: {
|
|
@@ -1604,35 +1685,47 @@ export interface IEngineEvents {
|
|
|
1604
1685
|
}) => void;
|
|
1605
1686
|
|
|
1606
1687
|
/**
|
|
1607
|
-
* Auto-play fails.
|
|
1688
|
+
* @brief Auto-play fails.
|
|
1608
1689
|
* @param event Event related to the player
|
|
1609
1690
|
* @region Room Management Event
|
|
1610
1691
|
*/
|
|
1611
1692
|
[EngineEventsTypes.onAutoplayFailed]: (event: PlayerEvent) => void;
|
|
1612
1693
|
|
|
1613
1694
|
/**
|
|
1614
|
-
* Result of the Pushing stream to CDN
|
|
1695
|
+
* @brief Result of the Pushing stream to CDN
|
|
1615
1696
|
* @param event
|
|
1616
1697
|
* @region Advanced Feature Event
|
|
1617
1698
|
*/
|
|
1618
1699
|
[EngineEventsTypes.onLiveTranscodingResult]: (event: LiveTranscodingResultEvent) => void;
|
|
1619
1700
|
|
|
1620
1701
|
/**
|
|
1621
|
-
* event of error
|
|
1622
|
-
* @param event
|
|
1702
|
+
* @brief event of error
|
|
1703
|
+
* @param event The reason why the current user has been removed from the room.
|
|
1623
1704
|
* @region Room Management Event
|
|
1624
1705
|
*/
|
|
1625
1706
|
[EngineEventsTypes.onError]: (event: {
|
|
1626
|
-
errorCode: ErrorCode
|
|
1707
|
+
errorCode: ErrorCode;
|
|
1627
1708
|
}) => void;
|
|
1628
1709
|
|
|
1629
1710
|
/**
|
|
1630
|
-
* Event of the state change of audio mixing
|
|
1711
|
+
* @brief Event of the state change of audio mixing
|
|
1631
1712
|
* @param event
|
|
1632
1713
|
* @region Advanced Feature
|
|
1633
1714
|
*/
|
|
1634
1715
|
[EngineEventsTypes.onAudioMixingStateChanged]: (event: AudioMixingStateChangedEvent) => void;
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* @brief Event of receiving a text message
|
|
1719
|
+
* @param event
|
|
1720
|
+
* @region Message Event
|
|
1721
|
+
*/
|
|
1635
1722
|
[EngineEventsTypes.onUserMessageReceivedOutsideRoom]: (event: UserMessageEvent) => void;
|
|
1723
|
+
|
|
1724
|
+
/**
|
|
1725
|
+
* @brief Event of receiving a binary message
|
|
1726
|
+
* @param event
|
|
1727
|
+
* @region Message Event
|
|
1728
|
+
*/
|
|
1636
1729
|
[EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]: (event: UserBinaryMessageEvent) => void;
|
|
1637
1730
|
}
|
|
1638
1731
|
|
|
@@ -1643,7 +1736,7 @@ export interface IEngineEvents {
|
|
|
1643
1736
|
export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
1644
1737
|
|
|
1645
1738
|
/**
|
|
1646
|
-
* Join the room. <br>
|
|
1739
|
+
* @brief Join the room. <br>
|
|
1647
1740
|
* Call this method to join the room and make audio & video calls with other users in the room. <br>
|
|
1648
1741
|
* @param token Dynamic key. It is used for authentication and verification of users entering the room. <br>
|
|
1649
1742
|
* You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. <br>
|
|
@@ -1658,59 +1751,54 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1658
1751
|
* @param userInfo User information.
|
|
1659
1752
|
* @param roomConfig Room parameter configuration, set the room mode and whether to automatically publish or subscribe to the flow.
|
|
1660
1753
|
* @return
|
|
1661
|
-
* @notes
|
|
1662
|
-
* +
|
|
1663
|
-
* +
|
|
1664
|
-
* + RTC SDK will try reconnect after losing connection to the server caused by a poor network connection. The remote user will receive [[EngineEventsTypes.onUserJoined]](104479#engineeventstypes-onuserjoined) if a visible user reconnected successfully. <br>
|
|
1754
|
+
* @notes + In the same room with the same App ID, the user ID of each user must be unique. The user will be kicked out of the room when a user with the same userID joins the room because of the error of `DUPLICATE_LOGIN`.
|
|
1755
|
+
* + Remote users will receive [onUserJoined](104479#onuserjoined) callback when a visible user joins the room. Call [setUserVisibility](#setuservisibility) to switch the visibility of the user. <br>
|
|
1756
|
+
* + RTC SDK will try reconnect after losing connection to the server caused by a poor network connection. The remote user will receive [onUserJoined](104479#onuserjoined) if a visible user reconnected successfully. <br>
|
|
1665
1757
|
* @region Room Management
|
|
1666
1758
|
*/
|
|
1667
1759
|
joinRoom(token: string | null, roomId: string, userInfo: UserInfo, roomConfig: RoomConfig): Promise<void>;
|
|
1668
1760
|
|
|
1669
1761
|
/**
|
|
1670
|
-
* Leave the room. <br>
|
|
1762
|
+
* @brief Leave the room. <br>
|
|
1671
1763
|
* The user calls this API to leave the room, end the call process, and release all call-related resources. <br>
|
|
1672
|
-
* @notes
|
|
1673
|
-
* + After visible users leave the room, other users in the room will receive [[EngineEventsTypes.onUserLeave]](104479#engineeventstypes-onuserleave) callback notification. <br>
|
|
1764
|
+
* @notes + After visible users leave the room, other users in the room will receive [onUserLeave](104479#onuserleave) callback notification. <br>
|
|
1674
1765
|
* + You must call this API to end the call, after calling the [joinRoom](#joinroom) method to join the room. Otherwise you cannot start the next call. Repeatedly call this method have no negative impact. <br>
|
|
1675
1766
|
* @region Room Management
|
|
1676
1767
|
*/
|
|
1677
1768
|
leaveRoom(): void;
|
|
1678
1769
|
|
|
1679
1770
|
/**
|
|
1680
|
-
* Destroy engine
|
|
1771
|
+
* @brief Destroy engine
|
|
1681
1772
|
* Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources <br>
|
|
1682
|
-
* @notes
|
|
1683
|
-
* +
|
|
1684
|
-
* + Calling this API will destroy all memory related to this RTCEngine{@link #RTCEngine} instance, and stop any interaction with the media server. <br>
|
|
1773
|
+
* @notes + Make sure that the business scenarios related to the `RTCEngine` instances that need to be destroyed are all finished before calling this API. <br>
|
|
1774
|
+
* + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server. <br>
|
|
1685
1775
|
* + This API is a blocking call which will block the current thread until the SDK completes the exit logic. Therefore, do NOT to call this API directly in the callback thread. Besides do NOT wait for the execution of the main thread including this API in any callback, thus causing a deadlock. <br>
|
|
1686
1776
|
* @region Engine Management
|
|
1687
1777
|
*/
|
|
1688
1778
|
destroy(): void;
|
|
1689
1779
|
|
|
1690
1780
|
/**
|
|
1691
|
-
* Start publishing media streams.
|
|
1781
|
+
* @brief Start publishing media streams.
|
|
1692
1782
|
* @return
|
|
1693
|
-
* @notes
|
|
1694
|
-
* +
|
|
1695
|
-
* +
|
|
1696
|
-
* +
|
|
1697
|
-
* + After publishing media streams by calling this API, other users in the room will be informed via [[EngineEventsTypes.onStreamAdd]](104479#engineeventstypes-onstreamadd).
|
|
1783
|
+
* @notes + Call this API to publish media streams only when you have disabled Auto-Publish when calling [joinRoom](#joinroom).
|
|
1784
|
+
* + An invisible user can not publish media streams. Call [setUserVisibility](#setuservisibility) to change the visibility of a user.
|
|
1785
|
+
* + Users can only publish media streams in one room at the same time. Call [publishScreen](#publishscreen) to start screen sharing.
|
|
1786
|
+
* + After publishing media streams by calling this API, other users in the room will be informed via [onStreamAdd](104479#onstreamadd).
|
|
1698
1787
|
* @region Media Transmission
|
|
1699
1788
|
*/
|
|
1700
1789
|
publish(): Promise<void>;
|
|
1701
1790
|
|
|
1702
1791
|
/**
|
|
1703
|
-
* Stops publishing local media streams in the room.
|
|
1792
|
+
* @brief Stops publishing local media streams in the room.
|
|
1704
1793
|
* @return
|
|
1705
|
-
* @notes
|
|
1706
|
-
* +
|
|
1707
|
-
* + After stopping publishing media streams by calling this API, other users in the room will be informed via [[EngineEventsTypes.onStreamRemove]](104479#engineeventstypes-onstreamremove).
|
|
1794
|
+
* @notes + Call this API to stop publishing either started by calling [publish](#publish) or enabling Auto-Publish.
|
|
1795
|
+
* + After stopping publishing media streams by calling this API, other users in the room will be informed via [onStreamRemove](104479#onstreamremove).
|
|
1708
1796
|
* @region Media Transmission
|
|
1709
1797
|
*/
|
|
1710
1798
|
unpublish(): Promise<void>;
|
|
1711
1799
|
|
|
1712
1800
|
/**
|
|
1713
|
-
* Subscribe to media streams in the room. <br>
|
|
1801
|
+
* @brief Subscribe to media streams in the room. <br>
|
|
1714
1802
|
* Call this API to subscribe to media streams in the room regardless of subscription mode, either Auto or Manual. <br>
|
|
1715
1803
|
* Call this API to update the properties and configurations of the stream you have already subscribed to.
|
|
1716
1804
|
* @param userId User ID of the publisher of the subscribed media stream
|
|
@@ -1718,15 +1806,14 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1718
1806
|
* @param streamType Media stream type to be subscribed to.
|
|
1719
1807
|
* @param configure Subscription configuration of video streams.
|
|
1720
1808
|
* @return
|
|
1721
|
-
* @notes
|
|
1722
|
-
* +
|
|
1723
|
-
* + You can update the subscription configuration by calling the API even after calling pauseAllSubscribedStream{@link #pauseAllSubscribedStream} to pause streaming. . Call resumeAllSubscribedStream{@link #resumeAllSubscribedStream} to resume streaming and apply the changes.
|
|
1809
|
+
* @notes + Get the media stream information in the room from [onStreamAdd](104479#onstreamadd) and [onStreamRemove](104479#onstreamremove). <br>
|
|
1810
|
+
* + You can update the subscription configuration by calling the API even after calling [pauseAllSubscribedStream](#pauseallsubscribedstream) to pause streaming. Call [resumeAllSubscribedStream](#resumeallsubscribedstream) to resume streaming and apply the changes.
|
|
1724
1811
|
* @region Media Transmission
|
|
1725
1812
|
*/
|
|
1726
1813
|
subscribeUserStream(userId: string, mediaType: SubscribeMediaType, streamType?: StreamIndex, configure?: SubscribeVideoConfig): Promise<void>;
|
|
1727
1814
|
|
|
1728
1815
|
/**
|
|
1729
|
-
* Stop subscribing to media streams in the room. <br>
|
|
1816
|
+
* @brief Stop subscribing to media streams in the room. <br>
|
|
1730
1817
|
* You can call this API to unsubscribe to media streams regardless of automatic or manual subscription mode. <br>
|
|
1731
1818
|
* @param userId User ID of the publisher of the subscribed media stream
|
|
1732
1819
|
* @param isScreen Whether the stream unsubscribed is a screen-sharing stream. <br>
|
|
@@ -1737,11 +1824,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1737
1824
|
unSubscribe(userId: string, isScreen: boolean): Promise<void>;
|
|
1738
1825
|
|
|
1739
1826
|
/**
|
|
1740
|
-
* Update Token. <br>
|
|
1827
|
+
* @brief Update Token. <br>
|
|
1741
1828
|
* Call this API to update the Token information of the room when the Token expires <br>
|
|
1742
1829
|
* @param token A valid token <br>
|
|
1743
|
-
* @notes
|
|
1744
|
-
* + If you call [joinRoom](#joinroom) with an expired token, the joining will fail with an error code `INVALID_TOKEN`. And you need to obtain a valid token and call this API to update the token. <br>
|
|
1830
|
+
* @notes + If you call [joinRoom](#joinroom) with an expired token, the joining will fail with an error code `INVALID_TOKEN`. And you need to obtain a valid token and call this API to update the token. <br>
|
|
1745
1831
|
* + If joining a room failed because the token expired, call this API with an updated token. And then RTC SDK will automatically rejoin the room without calling [joinRoom](#joinroom) again. <br>
|
|
1746
1832
|
* + You have no need to worry about the token expiration after the user joining successfully. Because RTC SDK only verifies the token when the user joins.
|
|
1747
1833
|
* @region Room Management
|
|
@@ -1749,7 +1835,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1749
1835
|
updateToken(token: string): void;
|
|
1750
1836
|
|
|
1751
1837
|
/**
|
|
1752
|
-
* Switch the microphone used for internal audio capture <br>
|
|
1838
|
+
* @brief Switch the microphone used for internal audio capture <br>
|
|
1753
1839
|
* @param deviceId
|
|
1754
1840
|
* @region Device Management
|
|
1755
1841
|
* @notes If the internal audio capturing is on, the switch is effective once you call this API. If the internal audio capturing is off, the setting will be effective when capture starts.
|
|
@@ -1757,9 +1843,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1757
1843
|
switchMicrophone(deviceId: string): Promise<void>;
|
|
1758
1844
|
|
|
1759
1845
|
/**
|
|
1760
|
-
* Switch the camera used for internal video capture <br>
|
|
1846
|
+
* @brief Switch the camera used for internal video capture <br>
|
|
1761
1847
|
* The default camera to be used depends on the web browser.
|
|
1762
|
-
* @param deviceId ID of the device need to enable which you can call getDevices
|
|
1848
|
+
* @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
|
|
1763
1849
|
* @return
|
|
1764
1850
|
* @notes If the internal video capturing is on, the switch is effective once you call this API. If the internal video capturing is off, the setting will be effective when capture starts.
|
|
1765
1851
|
* @region Device Management
|
|
@@ -1767,100 +1853,93 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1767
1853
|
switchCamera(deviceId: string): Promise<void>;
|
|
1768
1854
|
|
|
1769
1855
|
/**
|
|
1770
|
-
* Enable internal video capture. The default state is off. <br>
|
|
1856
|
+
* @brief Enable internal video capture. The default state is off. <br>
|
|
1771
1857
|
* Internal video capture refers to: capturing video using the built-in module.
|
|
1772
|
-
* The remote clients in the room will be informed of the state change via [
|
|
1773
|
-
* @param deviceId ID of the device need to enable which you can call getDevices
|
|
1858
|
+
* The remote clients in the room will be informed of the state change via [onUserStartVideoCapture](104479#onuserstartvideocapture) after the publisher starts video capture by calling this API.<br>
|
|
1859
|
+
* @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
|
|
1774
1860
|
* @return
|
|
1775
|
-
* @notes
|
|
1776
|
-
* + Call stopVideoCapture{@link #stopVideoCapture} to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.<br>
|
|
1861
|
+
* @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.<br>
|
|
1777
1862
|
* + Once you create the engine instance, you can start internal video capture regardless of the video publishing state. The video stream will start publishing only after the video capture starts. <br>
|
|
1778
|
-
* + Call switchCamera
|
|
1863
|
+
* + Call [switchCamera](#switchcamera) to switch the camera used by the internal video capture module.<br>
|
|
1779
1864
|
* @region Video Management
|
|
1780
1865
|
*/
|
|
1781
1866
|
startVideoCapture(deviceId?: string): Promise<void>;
|
|
1782
1867
|
|
|
1783
1868
|
/**
|
|
1784
|
-
* Enable internal video capture immediately. The default setting is off. <br>
|
|
1869
|
+
* @brief Enable internal video capture immediately. The default setting is off. <br>
|
|
1785
1870
|
* Internal video capture refers to: capturing video using the built-in module.
|
|
1786
|
-
* The remote clients in the room will be informed of the state change via [
|
|
1871
|
+
* The remote clients in the room will be informed of the state change via [onUserStopVideoCapture](104479#onuserstopvideocapture) after the publisher stops video capture by calling this API.<br>
|
|
1787
1872
|
* @return
|
|
1788
|
-
* @notes <br>
|
|
1789
|
-
* + Call [startVideoCapture](#startvideocapture) to enable the internal video capture. <br>
|
|
1873
|
+
* @notes + Call [startVideoCapture](#startvideocapture) to enable the internal video capture. <br>
|
|
1790
1874
|
* + Without calling this API the internal video capture will sustain until you destroy the engine instance.<br>
|
|
1791
1875
|
* @region Video Management
|
|
1792
1876
|
*/
|
|
1793
1877
|
stopVideoCapture(): Promise<void>;
|
|
1794
1878
|
|
|
1795
1879
|
/**
|
|
1796
|
-
* Start internal audio capture. The default is off.
|
|
1880
|
+
* @brief Start internal audio capture. The default is off.
|
|
1797
1881
|
* Internal audio capture refers to: capturing audio using the built-in module.
|
|
1798
|
-
* The remote clients in the room will be informed of the state change via [
|
|
1799
|
-
* @param deviceId ID of the device need to enable which you can call getDevices
|
|
1882
|
+
* The remote clients in the room will be informed of the state change via [onUserStartAudioCapture](104479#onuserstartaudiocapture) after the publisher starts audio capture by calling this API.
|
|
1883
|
+
* @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
|
|
1800
1884
|
* @return
|
|
1801
|
-
* @notes
|
|
1802
|
-
* + Call stopAudioCapture{@link #stopAudioCapture} to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance. <br>
|
|
1885
|
+
* @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance. <br>
|
|
1803
1886
|
* + Once you create the engine instance, you can start internal audio capture regardless of the audio publishing state. The audio stream will start publishing only after the audio capture starts. <br>
|
|
1804
1887
|
* @region Audio Management
|
|
1805
1888
|
*/
|
|
1806
1889
|
startAudioCapture(deviceId?: string): Promise<void>;
|
|
1807
1890
|
|
|
1808
1891
|
/**
|
|
1809
|
-
* Stop internal audio capture. The default is off. <br>
|
|
1892
|
+
* @brief Stop internal audio capture. The default is off. <br>
|
|
1810
1893
|
* Internal audio capture refers to: capturing audio using the built-in module.
|
|
1811
|
-
* The remote clients in the room will be informed of the state change via [
|
|
1894
|
+
* The remote clients in the room will be informed of the state change via [onUserStopAudioCapture](104479#onuserstopaudiocapture) after stopping audio capture by calling this API.<br>
|
|
1812
1895
|
* @return
|
|
1813
|
-
* @notes
|
|
1814
|
-
* + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture. <br>
|
|
1896
|
+
* @notes + Call [startAudioCapture](#startaudiocapture) to enable the internal audio capture. <br>
|
|
1815
1897
|
* + Without calling this API the internal audio capture will sustain until you destroy the engine instance.<br>
|
|
1816
1898
|
* @region Audio Management
|
|
1817
1899
|
*/
|
|
1818
1900
|
stopAudioCapture(): Promise<void>;
|
|
1819
1901
|
|
|
1820
1902
|
/**
|
|
1821
|
-
* Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
|
|
1903
|
+
* @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
|
|
1822
1904
|
* @param screenConfig Specify properties for the sharing screen.
|
|
1823
1905
|
* @return
|
|
1824
|
-
* @notes
|
|
1825
|
-
* +
|
|
1826
|
-
* + To turn off screen video source capture, call stopScreenCapture{@link #stopScreenCapture}. <br>
|
|
1906
|
+
* @notes + Call this API will start screen stream video capture but will not publish the captured video. Publishing a screen-sharing stream by calling [publishScreen](#publishScreen). <br>
|
|
1907
|
+
* + To turn off screen video source capture, call [stopScreenVideoCapture](#stopScreenVideoCapture). <br>
|
|
1827
1908
|
* + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream. <br>
|
|
1828
1909
|
* @region Advanced Feature
|
|
1829
1910
|
*/
|
|
1830
1911
|
startScreenCapture(screenConfig?: ScreenConfig): Promise<void>;
|
|
1831
1912
|
|
|
1832
1913
|
/**
|
|
1833
|
-
* Stop screen sharing.
|
|
1914
|
+
* @brief Stop screen sharing.
|
|
1834
1915
|
* @return
|
|
1835
|
-
* @notes If the stream has been published, the other users in the room will receive the [
|
|
1916
|
+
* @notes If the stream has been published, the other users in the room will receive the [onStreamRemove](104479#onstreamremove) event after the user stop screen sharing by calling this API.
|
|
1836
1917
|
* @region Advanced Feature
|
|
1837
1918
|
*/
|
|
1838
1919
|
stopScreenCapture(): Promise<void>;
|
|
1839
1920
|
|
|
1840
1921
|
/**
|
|
1841
|
-
* Publish screen-sharing streams.
|
|
1922
|
+
* @brief Publish screen-sharing streams.
|
|
1842
1923
|
* @return
|
|
1843
|
-
* @notes
|
|
1844
|
-
* + You must join the room before you can call this API. <br>
|
|
1924
|
+
* @notes + You must join the room before you can call this API. <br>
|
|
1845
1925
|
* + This API is only available to visible users.
|
|
1846
|
-
* + After the call, the remote receives the [
|
|
1847
|
-
* + Call unpublishScreen
|
|
1926
|
+
* + After the call, the remote receives the [onStreamAdd](104479#onstreamadd) callback. <br>
|
|
1927
|
+
* + Call [unpublishScreen](#unpublishscreen) to unpublish.
|
|
1848
1928
|
* @region Advanced Feature
|
|
1849
1929
|
*/
|
|
1850
1930
|
publishScreen(): Promise<void>;
|
|
1851
1931
|
|
|
1852
1932
|
/**
|
|
1853
|
-
* Stop publishing screen-sharing streams.
|
|
1933
|
+
* @brief Stop publishing screen-sharing streams.
|
|
1854
1934
|
* @return
|
|
1855
|
-
* @notes
|
|
1856
|
-
* +
|
|
1857
|
-
* + After the call, the remote receives the [[EngineEventsTypes.onStreamRemove]](104479#engineeventstypes-onstreamremove) callback.
|
|
1935
|
+
* @notes + To start publishing, call [publishScreen](#publishscreen). <br>
|
|
1936
|
+
* + After the call, the remote receives the [onStreamRemove](104479#onstreamremove) callback.
|
|
1858
1937
|
* @region Advanced Feature
|
|
1859
1938
|
*/
|
|
1860
1939
|
unpublishScreen(): Promise<void>;
|
|
1861
1940
|
|
|
1862
1941
|
/**
|
|
1863
|
-
* Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
|
|
1942
|
+
* @brief Bind a view to the local media stream and set the rendering mode for the rendering of the local stream
|
|
1864
1943
|
* Listen to `onPlayerEvent` for the state after binding a view to the local video stream.
|
|
1865
1944
|
* Call this API again with a blank view to unbind the view from the local video stream.
|
|
1866
1945
|
* @param streamIndex Video stream properties
|
|
@@ -1868,10 +1947,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1868
1947
|
* @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
|
|
1869
1948
|
* @region Video Management
|
|
1870
1949
|
*/
|
|
1871
|
-
setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption
|
|
1950
|
+
setLocalVideoPlayer(streamIndex: StreamIndex, videoPlayerOption?: VideoPlayerOption): HTMLVideoElement | undefined;
|
|
1872
1951
|
|
|
1873
1952
|
/**
|
|
1874
|
-
* Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
|
|
1953
|
+
* @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
|
|
1875
1954
|
* It's recommended to call this API and bind a view once the event of `onVideoFirstFrameRendered` is triggered.
|
|
1876
1955
|
* Call this API again with a blank view to unbind the view from the remote video stream.
|
|
1877
1956
|
* @param streamIndex Video stream properties
|
|
@@ -1879,18 +1958,18 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1879
1958
|
* @notes You should bind the view after the user joins a room. This setting will sustain when the user leaves the room.
|
|
1880
1959
|
* @region Video Management
|
|
1881
1960
|
*/
|
|
1882
|
-
setRemoteVideoPlayer(streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption):
|
|
1961
|
+
setRemoteVideoPlayer(streamIndex: StreamIndex, videoPlayerOption: VideoPlayerOption): HTMLVideoElement | undefined;
|
|
1883
1962
|
|
|
1884
1963
|
/**
|
|
1885
|
-
* Enable or disable the mirror mode for the local video stream. <br>
|
|
1964
|
+
* @brief Enable or disable the mirror mode for the local video stream. <br>
|
|
1886
1965
|
* @param mirrorType Whether to turn on mirror mode.
|
|
1887
1966
|
* @region Media Processing
|
|
1888
1967
|
*/
|
|
1889
1968
|
setLocalVideoMirrorType(mirrorType: MirrorType): void;
|
|
1890
1969
|
|
|
1891
1970
|
/**
|
|
1892
|
-
* Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker. <br>
|
|
1893
|
-
* @param deviceId ID of the audio playback device. Call getDevices
|
|
1971
|
+
* @brief Sets the speaker or the earpiece as the audio playback device. The audio playback device defaults to the speaker. <br>
|
|
1972
|
+
* @param deviceId ID of the audio playback device. Call [getDevices](#getdevices) to get device ID.
|
|
1894
1973
|
* @return
|
|
1895
1974
|
* @notes You can call this API before or after the user joins a room.
|
|
1896
1975
|
* @region Audio Management
|
|
@@ -1898,7 +1977,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1898
1977
|
setAudioPlaybackDevice(deviceId: string): Promise<void>;
|
|
1899
1978
|
|
|
1900
1979
|
/**
|
|
1901
|
-
* Play audio and video stream manually.
|
|
1980
|
+
* @brief Play audio and video stream manually.
|
|
1902
1981
|
* Call this API when user need to take part in the audio and video reaction after calling [joinRoom](#joinroom) and set to autoPlay to False.
|
|
1903
1982
|
* @param userId
|
|
1904
1983
|
* @return
|
|
@@ -1907,56 +1986,52 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1907
1986
|
play(userId: string): Promise<void>;
|
|
1908
1987
|
|
|
1909
1988
|
/**
|
|
1910
|
-
* Enable/ Disable the transmission of the local audio stream.
|
|
1911
|
-
* Remote users in the room will be informed via [
|
|
1989
|
+
* @brief Enable/ Disable the transmission of the local audio stream.
|
|
1990
|
+
* Remote users in the room will be informed via [onUserMuteAudio](104479#onusermuteaudio) after the visible user changes the transmission state of the audio streams by calling this API.
|
|
1912
1991
|
* @param muteState An identifier denoting whether the local audio stream is sending.
|
|
1913
1992
|
* @return
|
|
1914
|
-
* @notes
|
|
1915
|
-
* + Calling this API toggles the transmission state of the local audio streams instead of the capture state.
|
|
1993
|
+
* @notes + Calling this API toggles the transmission state of the local audio streams instead of the capture state.
|
|
1916
1994
|
* + You can enable audio transmission regardless of the audio capture state. Enable the transmission before capture, thus the audio stream can be sent once the capture starts.
|
|
1917
1995
|
* @region Media Transmission
|
|
1918
1996
|
*/
|
|
1919
1997
|
muteLocalAudio(muteState: MuteState): Promise<boolean>;
|
|
1920
1998
|
|
|
1921
1999
|
/**
|
|
1922
|
-
* Enable/ Disable the transmission of the local video stream. The video stream is not sending by default.
|
|
2000
|
+
* @brief Enable/ Disable the transmission of the local video stream. The video stream is not sending by default.
|
|
1923
2001
|
* Call this API to start sending local video streams when using either internal capture module or custom video source. <br>
|
|
1924
|
-
* Remote users in the room will be informed via [
|
|
2002
|
+
* Remote users in the room will be informed via [onUserMuteAudio](104479#onusermuteaudio) after the visible user changes the transmission state of the video streams by calling this API.
|
|
1925
2003
|
* @param muteState An identifier denoting whether the local video stream is sending
|
|
1926
2004
|
* @return Sending state of the local video stream
|
|
1927
|
-
* @notes
|
|
1928
|
-
* + This API only controls the sending state of the local video stream and does not affect the local video acquisition state.
|
|
2005
|
+
* @notes + This API only controls the sending state of the local video stream and does not affect the local video acquisition state.
|
|
1929
2006
|
* + You can enable video transmission regardless of the video capture state. Enable the transmission before capture, thus the video stream can be sent once the capture starts.
|
|
1930
2007
|
* @region Media Transmission
|
|
1931
2008
|
*/
|
|
1932
2009
|
muteLocalVideo(muteState: MuteState): Promise<boolean>;
|
|
1933
2010
|
|
|
1934
2011
|
/**
|
|
1935
|
-
* Pause receiving remote media streams.
|
|
2012
|
+
* @brief Pause receiving remote media streams.
|
|
1936
2013
|
* @param mediaType Media stream type subscribed to.
|
|
1937
2014
|
* @return
|
|
1938
|
-
* @notes
|
|
1939
|
-
* + Calling this API does not change the capture state and the transmission state of the remote clients. <br>
|
|
2015
|
+
* @notes + Calling this API does not change the capture state and the transmission state of the remote clients. <br>
|
|
1940
2016
|
* + Calling this API does not cancel the subscription or change any subscription configuration. <br>
|
|
1941
|
-
* + To resume, call resumeAllSubscribedStream
|
|
2017
|
+
* + To resume, call [resumeAllSubscribedStream](#resumeAllSubscribedStream).
|
|
1942
2018
|
* @region Media Stream Transmission
|
|
1943
2019
|
*/
|
|
1944
2020
|
pauseAllSubscribedStream(mediaType: PauseResumeControlMediaType): Promise<void>;
|
|
1945
2021
|
|
|
1946
2022
|
/**
|
|
1947
|
-
* Resume receiving remote media streams
|
|
2023
|
+
* @brief Resume receiving remote media streams
|
|
1948
2024
|
* @param mediaType Media stream type subscribed to
|
|
1949
2025
|
* @return
|
|
1950
|
-
* @notes
|
|
1951
|
-
* + Calling this API does not change the capture state and the transmission state of the remote clients.
|
|
2026
|
+
* @notes + Calling this API does not change the capture state and the transmission state of the remote clients.
|
|
1952
2027
|
* + Calling this API does not change any subscription configuration.
|
|
1953
2028
|
* @region Media Transmission
|
|
1954
2029
|
*/
|
|
1955
2030
|
resumeAllSubscribedStream(mediaType: PauseResumeControlMediaType): Promise<void>;
|
|
1956
2031
|
|
|
1957
2032
|
/**
|
|
1958
|
-
* Send point-to-point text messages to a specified user in the room.<br>
|
|
1959
|
-
* The recipient receives the message via [
|
|
2033
|
+
* @brief Send point-to-point text messages to a specified user in the room.<br>
|
|
2034
|
+
* The recipient receives the message via [onUserMessageReceived](104479#onusermessagereceived) once the message is sent successfully.
|
|
1960
2035
|
* @param userId User ID of the recipient
|
|
1961
2036
|
* @param message Text to be sent within 62KB<br>
|
|
1962
2037
|
* @return
|
|
@@ -1966,19 +2041,19 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1966
2041
|
sendUserMessage(userId: string, message: string): Promise<unknown> | undefined;
|
|
1967
2042
|
|
|
1968
2043
|
/**
|
|
1969
|
-
* Send point-to-point binary messages to a specified user in the room.<br>
|
|
1970
|
-
* The recipient receives the message via [
|
|
2044
|
+
* @brief Send point-to-point binary messages to a specified user in the room.<br>
|
|
2045
|
+
* The recipient receives the message via [onUserBinaryMessageReceived](104479#onuserbinarymessagereceived) once the message is sent successfully.
|
|
1971
2046
|
* @param userId User ID of the recipient
|
|
1972
2047
|
* @param message Binary to be sent within 62KB<br>
|
|
1973
2048
|
* @return
|
|
1974
|
-
* @notes Call joinRoom
|
|
2049
|
+
* @notes Call [joinRoom](#joinroom) to join the room before calling this API. <br>
|
|
1975
2050
|
* @region Message
|
|
1976
2051
|
*/
|
|
1977
2052
|
sendUserBinaryMessage(userId: string, message: ArrayBuffer): Promise<unknown>;
|
|
1978
2053
|
|
|
1979
2054
|
/**
|
|
1980
|
-
* Send text messaging to all other users in the room.<br>
|
|
1981
|
-
* Users in the room will receive message via [
|
|
2055
|
+
* @brief Send text messaging to all other users in the room.<br>
|
|
2056
|
+
* Users in the room will receive message via [onRoomMessageReceived](104479#onroommessagereceived) once the message is sent successfully.
|
|
1982
2057
|
* @param message Text to be sent within 62KB<br>
|
|
1983
2058
|
* @return
|
|
1984
2059
|
* @region Message
|
|
@@ -1986,8 +2061,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1986
2061
|
sendRoomMessage(message: string): Promise<any> | undefined;
|
|
1987
2062
|
|
|
1988
2063
|
/**
|
|
1989
|
-
* Send binary messaging to all other users in the room.<br>
|
|
1990
|
-
* Users in the room will receive binary message via [
|
|
2064
|
+
* @brief Send binary messaging to all other users in the room.<br>
|
|
2065
|
+
* Users in the room will receive binary message via [onRoomBinaryMessageReceived](104479#onroombinarymessagereceived) once the message is sent successfully.
|
|
1991
2066
|
* @param message Binary message to be sent within 62KB<br>
|
|
1992
2067
|
* @return
|
|
1993
2068
|
* @region Message
|
|
@@ -1995,38 +2070,33 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1995
2070
|
sendRoomBinaryMessage(message: ArrayBuffer): Promise<any> | undefined;
|
|
1996
2071
|
|
|
1997
2072
|
/**
|
|
1998
|
-
* Send SEI message carried by video frames
|
|
2073
|
+
* @brief Send SEI message carried by video frames
|
|
1999
2074
|
* @param streamIndex
|
|
2000
2075
|
* @param message SEI message within 4kb. Empty message or message exceeding this size will not be sent with respective error prompt.
|
|
2001
2076
|
* @param repeatCount Number of message sending repetitions. The value range is [0,30]. <br>
|
|
2002
2077
|
* Calling this API to add SEI data to consecutive `repeatCount` video frames starting from the current one.
|
|
2003
|
-
* @notes
|
|
2004
|
-
* + Call this API to add SEI message to the video frame captured by the internal video capture module.
|
|
2078
|
+
* @notes + Call this API to add SEI message to the video frame captured by the internal video capture module.
|
|
2005
2079
|
* + SDK will abandon the SEI message if no video frame in 2s after you call this API.
|
|
2006
|
-
* + Users receiving the stream will receive the SEI message via onSEIMessageReceived
|
|
2080
|
+
* + Users receiving the stream will receive the SEI message via [onSEIMessageReceived](104479#onseimessagereceived) once the SEI message is sent successfully.
|
|
2007
2081
|
* @region Message
|
|
2008
2082
|
*/
|
|
2009
2083
|
sendSEIMessage(streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number): void;
|
|
2010
2084
|
|
|
2011
2085
|
/**
|
|
2012
|
-
* Sets the video encoder configuration of each individual stream for simulcasting, including resolution, frame rate, bitrate, scale mode, fallback strategy under poor network conditions.
|
|
2086
|
+
* @brief Sets the video encoder configuration of each individual stream for simulcasting, including resolution, frame rate, bitrate, scale mode, fallback strategy under poor network conditions.
|
|
2013
2087
|
* @param streamIndex
|
|
2014
2088
|
* @param descriptions Video parameters of each individual stream for simulcasting.
|
|
2015
|
-
* The length of `
|
|
2016
|
-
*
|
|
2017
|
-
* @notes <br>
|
|
2018
|
-
* + When using the internal capture, the resolution and frame rate will be adapted to the maximum resolution and frame rate for encoding. <br>
|
|
2019
|
-
* + The video streams are encoded by default with a bitrate of 500bps. <br>
|
|
2020
|
-
* + When you call this API, it will take effect immediately, which may cause the camera to restart. <br>
|
|
2089
|
+
* The length of `VideoEncoderConfig` is no more than 3. The resolutions must be in descending sort.
|
|
2090
|
+
* @notes + The video streams are encoded by default with a bitrate of 500bps. <br>
|
|
2021
2091
|
* + The screen stream takes the first set of parameters. <br>
|
|
2022
2092
|
* @region Media Transmission
|
|
2023
2093
|
*/
|
|
2024
|
-
setVideoEncoderConfig(streamIndex: StreamIndex, descriptions:
|
|
2094
|
+
setVideoEncoderConfig(streamIndex: StreamIndex, descriptions: VideoEncoderConfig[]): Promise<void>;
|
|
2025
2095
|
|
|
2026
2096
|
/**
|
|
2027
|
-
* Turn on/off volume prompts. Off by default. <br>
|
|
2097
|
+
* @brief Turn on/off volume prompts. Off by default. <br>
|
|
2028
2098
|
* Call this API to set the report period of the volume information of local user and each subscribed user.
|
|
2029
|
-
* Local client will get informed of the the volume of local user and each subscribed users via [
|
|
2099
|
+
* Local client will get informed of the the volume of local user and each subscribed users via [onAudioVolumeIndication](104479#onaudiovolumeindication).
|
|
2030
2100
|
* @param interval The time interval for receiving a volume prompt callback <br>
|
|
2031
2101
|
* It is recommended to set to greater than or equal to 200 milliseconds; when less than 10 milliseconds, the behavior is undefined. <br>
|
|
2032
2102
|
* + ≤ 0: Disable the volume prompt function. <br>
|
|
@@ -2036,18 +2106,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2036
2106
|
setAudioVolumeIndicationInterval(interval?: number): void;
|
|
2037
2107
|
|
|
2038
2108
|
/**
|
|
2039
|
-
* Starts pushing media streams to CDN and sets the relevant configurations.
|
|
2109
|
+
* @brief Starts pushing media streams to CDN and sets the relevant configurations.
|
|
2040
2110
|
* @param transcode configuration for push media streams to CDN.
|
|
2041
2111
|
* @return
|
|
2042
|
-
* @notes
|
|
2043
|
-
* +
|
|
2044
|
-
* + Call stopLiveTranscoding{@link #stopLiveTranscoding} to stop pushing stream to CDN.
|
|
2112
|
+
* @notes + After calling this API, you will be informed of the result and errors during the pushing process via [onLiveTransCodingResult](104479#onlivetranscodingresult).
|
|
2113
|
+
* + Call [stopLiveTranscoding](#stoplivetranscoding) to stop pushing stream to CDN.
|
|
2045
2114
|
* @region Advanced Feature
|
|
2046
2115
|
*/
|
|
2047
2116
|
startLiveTranscoding(transcode: LiveTranscodeConfig): Promise<void>;
|
|
2048
2117
|
|
|
2049
2118
|
/**
|
|
2050
|
-
* Update configuration needed when pushing media streams to CDN. <br>
|
|
2119
|
+
* @brief Update configuration needed when pushing media streams to CDN. <br>
|
|
2051
2120
|
* After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
|
|
2052
2121
|
* @param transcode Configurations that you want to update.
|
|
2053
2122
|
* @region Advanced Feature
|
|
@@ -2055,7 +2124,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2055
2124
|
updateLiveTranscoding(transcode: Partial<LiveTranscodeConfig>): Promise<void>;
|
|
2056
2125
|
|
|
2057
2126
|
/**
|
|
2058
|
-
* Stop pushing media streams to CDN
|
|
2127
|
+
* @brief Stop pushing media streams to CDN
|
|
2059
2128
|
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](#startlivetranscoding).
|
|
2060
2129
|
* @return
|
|
2061
2130
|
* @region Advanced Feature
|
|
@@ -2063,41 +2132,40 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2063
2132
|
stopLiveTranscoding(): Promise<void>;
|
|
2064
2133
|
|
|
2065
2134
|
/**
|
|
2066
|
-
* Set the business ID. <br>
|
|
2135
|
+
* @brief Set the business ID. <br>
|
|
2067
2136
|
* You can use businessId to distinguish different business scenarios. You can customize your businessId to serve as a sub AppId, which can share and refine the function of the AppId, but it does not need authentication.
|
|
2068
2137
|
* @param businessId Your customized businessId
|
|
2069
2138
|
* BusinessId is a tag, and you can customize its granularity.
|
|
2070
2139
|
* @notes You must call this API before the [joinRoom](#joinroom) API, otherwise it will be invalid. <br>
|
|
2071
2140
|
* @region Engine Management
|
|
2072
2141
|
*/
|
|
2073
|
-
setBusinessId(businessId: string):
|
|
2142
|
+
setBusinessId(businessId: string): boolean;
|
|
2074
2143
|
|
|
2075
2144
|
/**
|
|
2076
|
-
* Set user visibility. Visible by default. <br>
|
|
2145
|
+
* @brief Set user visibility. Visible by default. <br>
|
|
2077
2146
|
* @param enable Visibility of the user in the room:
|
|
2078
2147
|
* + `true`: The user can publish media streams. And the other users in the room get informed of the behaviors of the user, such as Joining room, starting video capture, and Leaving room.<br>
|
|
2079
2148
|
* + `false`: The user cannot publish media streams. And the other users in the room do not get informed of the behaviors of the user, such as joining, starting video capture, or leaving.
|
|
2080
2149
|
* @return
|
|
2081
|
-
* @notes
|
|
2082
|
-
* + You can call this API whether the user is in a room or not. <br>
|
|
2150
|
+
* @notes + You can call this API whether the user is in a room or not. <br>
|
|
2083
2151
|
* + When you call this API, the other users in the room will be informed via the related callback:
|
|
2084
|
-
* - Switch from `false` to `true`: [
|
|
2085
|
-
* - Switch from `true` to `false`: [
|
|
2152
|
+
* - Switch from `false` to `true`: [onUserJoined](104479#onuserjoined)<br>
|
|
2153
|
+
* - Switch from `true` to `false`: [onUserLeave](104479#onuserleave) <br>
|
|
2086
2154
|
* @region Room Management
|
|
2087
2155
|
*/
|
|
2088
2156
|
setUserVisibility(enable: boolean): Promise<void>;
|
|
2089
2157
|
|
|
2090
2158
|
/**
|
|
2091
|
-
* Bind a custom videoTrack object.
|
|
2159
|
+
* @brief Bind a custom videoTrack object.
|
|
2092
2160
|
* @param index specify a stream index
|
|
2093
|
-
* @param track specify a video track
|
|
2161
|
+
* @param track specify a video track. Refer to [MediaStreamTrack](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaStreamTrack) for more details.
|
|
2094
2162
|
* @return
|
|
2095
2163
|
* @region Video Management
|
|
2096
2164
|
*/
|
|
2097
2165
|
setExternalVideoTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
|
|
2098
2166
|
|
|
2099
2167
|
/**
|
|
2100
|
-
* Bind a custom audioTrack object.
|
|
2168
|
+
* @brief Bind a custom audioTrack object.
|
|
2101
2169
|
* @param index specify a stream index
|
|
2102
2170
|
* @param track specify a audio track
|
|
2103
2171
|
* @return
|
|
@@ -2106,7 +2174,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2106
2174
|
setExternalAudioTrack(index: StreamIndex, track: MediaStreamTrack): Promise<void>;
|
|
2107
2175
|
|
|
2108
2176
|
/**
|
|
2109
|
-
* Switch the source from the internal to custom video capture.
|
|
2177
|
+
* @brief Switch the source from the internal to custom video capture.
|
|
2110
2178
|
* Internal video capture refers to using built-in video capture video.
|
|
2111
2179
|
* @param index audio stream index
|
|
2112
2180
|
* @param videoSourceType Type of the module for video capture
|
|
@@ -2116,7 +2184,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2116
2184
|
setVideoSourceType(index: StreamIndex, videoSourceType: VideoSourceType): Promise<void>;
|
|
2117
2185
|
|
|
2118
2186
|
/**
|
|
2119
|
-
* Switch the source from the internal to custom audio capture.
|
|
2187
|
+
* @brief Switch the source from the internal to custom audio capture.
|
|
2120
2188
|
* Internal audio capture refers to using built-in audio capture.
|
|
2121
2189
|
* @param index audio stream index
|
|
2122
2190
|
* @param audioSourceType Type of the module for video capture
|
|
@@ -2126,15 +2194,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2126
2194
|
setAudioSourceType(index: StreamIndex, audioSourceType: AudioSourceType): Promise<void>;
|
|
2127
2195
|
|
|
2128
2196
|
/**
|
|
2129
|
-
* Create an audio mixing manager object
|
|
2197
|
+
* @brief Create an audio mixing manager object
|
|
2130
2198
|
* @return audio mixing manager object
|
|
2131
2199
|
* @region Advanced Feature
|
|
2132
2200
|
*/
|
|
2133
2201
|
getAudioMixingManager(): IAudioMixingManager;
|
|
2134
2202
|
|
|
2135
2203
|
/**
|
|
2136
|
-
* Configure the internal audio capture. Different browser has its own default settings.
|
|
2137
|
-
* @param config Configuration of the internal audio capture such as, disabling audio 3A processing
|
|
2204
|
+
* @brief Configure the internal audio capture. Different browser has its own default settings.
|
|
2205
|
+
* @param config Configuration of the internal audio capture such as, disabling audio 3A processing. Refer to [MediaTrackConstraints](https://developer.mozilla.org/zh-CN/docs/Web/API/MediaTrackConstraints) for more details.
|
|
2138
2206
|
* @return
|
|
2139
2207
|
* @note You can call this API after creating the engine. We recommend to call this API before [startAudioCapture](#startaudiocapture).
|
|
2140
2208
|
* @region Audio Management
|
|
@@ -2142,68 +2210,147 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2142
2210
|
setAudioCaptureConfig(config: TrackCaptureConfig): Promise<void>;
|
|
2143
2211
|
|
|
2144
2212
|
/**
|
|
2145
|
-
* Configure the internal video capture. Different browser has its own default settings.
|
|
2146
|
-
* @param config Configuration of the internal video capture
|
|
2213
|
+
* @brief Configure the internal video capture. Different browser has its own default settings.
|
|
2214
|
+
* @param config Configuration of the internal video capture, For supported options please see: [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints)
|
|
2147
2215
|
* @return
|
|
2148
2216
|
* @note You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
|
|
2149
2217
|
* @region Video Management
|
|
2150
2218
|
*/
|
|
2151
2219
|
setVideoCaptureConfig(config: TrackCaptureConfig): Promise<void>;
|
|
2220
|
+
|
|
2221
|
+
/**
|
|
2222
|
+
* @brief Log in to the RTM server. <br>
|
|
2223
|
+
* Call this method before users within the same `appID` can communicate with each other via messages.
|
|
2224
|
+
* @param token Dynamic key. It is used for authentication and verification of users entering the room. <br>
|
|
2225
|
+
* You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. <br>
|
|
2226
|
+
* Apps with different AppIDs are not interoperable. <br>
|
|
2227
|
+
* @param userInfo User information.
|
|
2228
|
+
* @return
|
|
2229
|
+
* @notes + Call [logout](#logout) to log out the IM server.
|
|
2230
|
+
* + In the same App ID, the user ID of each user must be unique. The user will be logged out when a user with the same userID joins the room because of the error of `RTM_DUPLICATE_LOGIN`.
|
|
2231
|
+
* @region Room Management
|
|
2232
|
+
*/
|
|
2152
2233
|
login(token: string | null, userId: string): Promise<void>;
|
|
2234
|
+
|
|
2235
|
+
/**
|
|
2236
|
+
* @brief After calling this API to logout you are not able to call APIs to send messages and server messages.
|
|
2237
|
+
* @return
|
|
2238
|
+
*/
|
|
2153
2239
|
logout(): Promise<void>;
|
|
2240
|
+
|
|
2241
|
+
/**
|
|
2242
|
+
* @brief Update the Token used to login. Since all tokens have a limited time-to-live, call this API to refresh the token.
|
|
2243
|
+
* @param token updated token
|
|
2244
|
+
* @return
|
|
2245
|
+
* @notes + Call this API to refresh the token after the token has expired with no need for calling [login](#login).
|
|
2246
|
+
* + You will be informed of the expiration of the token if you tried to login with an expired token or during a reconnection. If the token expired after the user has logged in, no actions need to be taken.
|
|
2247
|
+
*/
|
|
2154
2248
|
updateLoginToken(token: string | null): Promise<void>;
|
|
2249
|
+
|
|
2250
|
+
/**
|
|
2251
|
+
* @brief Get the status of a user before sending him/her a P2P message. You can also call this API to check the status of the current user.
|
|
2252
|
+
* @param userId ID of the user whose status intended to know
|
|
2253
|
+
* @return
|
|
2254
|
+
* @notes Call [login](#login) before calling this API.
|
|
2255
|
+
*/
|
|
2155
2256
|
getPeerOnlineStatus(userId: string): Promise<USER_ONLINE_STATUS>;
|
|
2257
|
+
|
|
2258
|
+
/**
|
|
2259
|
+
* @brief Send point-to-point (P2P) text message to a user.
|
|
2260
|
+
* @param userId ID of the recipient
|
|
2261
|
+
* @param message Text message within 62 KB.
|
|
2262
|
+
* @return
|
|
2263
|
+
* @notes + Call [login](#login) before calling this API.
|
|
2264
|
+
* + The recipient must be logged into the server and will receive the text message via [onUserMessageReceivedOutsideRoom](104479#onusermessagereceivedoutsideroom) if the message has been sent successfully.
|
|
2265
|
+
*/
|
|
2156
2266
|
sendUserMessageOutsideRoom(userId: string, message: string): Promise<any>;
|
|
2267
|
+
|
|
2268
|
+
/**
|
|
2269
|
+
* @brief Send point-to-point (P2P) binary message to a user.
|
|
2270
|
+
* @param userId ID of the recipient
|
|
2271
|
+
* @param message Binary message within 46 KB
|
|
2272
|
+
* @return
|
|
2273
|
+
* @notes + Call [login](#login) before calling this API.
|
|
2274
|
+
* + The recipient must be logged into the server and will receive the text message via [onUserBinaryMessageReceivedOutsideRoom](104479#onuserbinarymessagereceivedoutsideroom) if the message has been sent successfully.
|
|
2275
|
+
*/
|
|
2157
2276
|
sendUserBinaryMessageOutsideRoom(userId: string, message: ArrayBuffer): Promise<any>;
|
|
2277
|
+
|
|
2278
|
+
/**
|
|
2279
|
+
* @brief Set the params of the server before calling [sendServerMessage](#sendServerMessage) or [sendServerBinaryMessage](#sendserverbinarymessage) to send messages to the server.
|
|
2280
|
+
* @param signature Dynamic signature.
|
|
2281
|
+
* @param url Address of the IM server
|
|
2282
|
+
* @return
|
|
2283
|
+
* @notes Call [login](#login) before calling this API.
|
|
2284
|
+
*/
|
|
2158
2285
|
setServerParams(signature: string, url: string): Promise<any>;
|
|
2286
|
+
|
|
2287
|
+
/**
|
|
2288
|
+
* @brief Send point-to-point (P2P) text message to the server.
|
|
2289
|
+
* @param message Text message within 62 KB.
|
|
2290
|
+
* @return
|
|
2291
|
+
* @notes Call [login](#login) and [setServerParams](#setserverparams) before calling this API.
|
|
2292
|
+
*/
|
|
2159
2293
|
sendServerMessage(message: string): Promise<any>;
|
|
2294
|
+
|
|
2295
|
+
/**
|
|
2296
|
+
* @brief Send point-to-point (P2P) binary message to the server.
|
|
2297
|
+
* @param message Binary message within 46 KB.
|
|
2298
|
+
* @return
|
|
2299
|
+
* @notes Call [login](#login) and [setServerParams](#setserverparams) before calling this API.
|
|
2300
|
+
*/
|
|
2160
2301
|
sendServerBinaryMessage(message: ArrayBuffer): Promise<any>;
|
|
2302
|
+
|
|
2303
|
+
/**
|
|
2304
|
+
* @brief Get the default parameters of `LiveTranscodeConfig`.
|
|
2305
|
+
* @return The default parameters of `LiveTranscodeConfig`
|
|
2306
|
+
*/
|
|
2307
|
+
defaultTranscoding(): Required<LiveTranscodeConfig>;
|
|
2161
2308
|
}
|
|
2162
2309
|
|
|
2163
2310
|
/**
|
|
2164
|
-
* Video source type
|
|
2311
|
+
* @brief Video source type
|
|
2165
2312
|
*/
|
|
2166
2313
|
export declare enum VideoSourceType {
|
|
2167
2314
|
|
|
2168
2315
|
/**
|
|
2169
|
-
* Custom video source
|
|
2316
|
+
* @brief Custom video source
|
|
2170
2317
|
*/
|
|
2171
2318
|
VIDEO_SOURCE_TYPE_EXTERNAL = 0,
|
|
2172
2319
|
|
|
2173
2320
|
/**
|
|
2174
|
-
* Internal audio capture, referring to capture video using the built-in module (the default)
|
|
2321
|
+
* @brief Internal audio capture, referring to capture video using the built-in module (the default)
|
|
2175
2322
|
*/
|
|
2176
2323
|
VIDEO_SOURCE_TYPE_INTERNAL = 1
|
|
2177
2324
|
}
|
|
2178
2325
|
|
|
2179
2326
|
/**
|
|
2180
|
-
* Audio source type
|
|
2327
|
+
* @brief Audio source type
|
|
2181
2328
|
*/
|
|
2182
2329
|
export declare enum AudioSourceType {
|
|
2183
2330
|
|
|
2184
2331
|
/**
|
|
2185
|
-
* Custom audio source
|
|
2332
|
+
* @brief Custom audio source
|
|
2186
2333
|
*/
|
|
2187
2334
|
AUDIO_SOURCE_TYPE_EXTERNAL = 0,
|
|
2188
2335
|
|
|
2189
2336
|
/**
|
|
2190
|
-
* Internal audio capture, referring to capture audio using the built-in module (the default)
|
|
2337
|
+
* @brief Internal audio capture, referring to capture audio using the built-in module (the default)
|
|
2191
2338
|
*/
|
|
2192
2339
|
AUDIO_SOURCE_TYPE_INTERNAL = 1
|
|
2193
2340
|
}
|
|
2194
2341
|
|
|
2195
2342
|
/**
|
|
2196
|
-
* User information
|
|
2343
|
+
* @brief User information
|
|
2197
2344
|
*/
|
|
2198
2345
|
export interface UserInfo {
|
|
2199
2346
|
|
|
2200
2347
|
/**
|
|
2201
|
-
* User ID, a non-empty string within 128 bytes.
|
|
2348
|
+
* @brief User ID, a non-empty string within 128 bytes.
|
|
2202
2349
|
*/
|
|
2203
2350
|
userId: string;
|
|
2204
2351
|
|
|
2205
2352
|
/**
|
|
2206
|
-
* ExtraInfo Additional information passed by the user, with a maximum length of 200 bytes. Callback to remote user in [
|
|
2353
|
+
* @brief ExtraInfo Additional information passed by the user, with a maximum length of 200 bytes. Callback to remote user in [onUserJoined](104479#onuserjoined).
|
|
2207
2354
|
* @notes Supports the following character set ranges <br>
|
|
2208
2355
|
* + 26 uppercase letters A~ Z
|
|
2209
2356
|
* + 26 lowercase letters a~ z
|
|
@@ -2213,6 +2360,33 @@ export interface UserInfo {
|
|
|
2213
2360
|
extraInfo?: string;
|
|
2214
2361
|
}
|
|
2215
2362
|
|
|
2363
|
+
/**
|
|
2364
|
+
* @brief The reason why the remote user left the room
|
|
2365
|
+
*/
|
|
2366
|
+
export declare enum UserOfflineReason {
|
|
2367
|
+
|
|
2368
|
+
/**
|
|
2369
|
+
* @brief The remote client calls leaveRoom to leave the room.
|
|
2370
|
+
*/
|
|
2371
|
+
QUIT = 0,
|
|
2372
|
+
|
|
2373
|
+
/**
|
|
2374
|
+
* @brief The remote client is disconnected because of poor network connection or expired Token.
|
|
2375
|
+
*/
|
|
2376
|
+
DROPPED = 1,
|
|
2377
|
+
|
|
2378
|
+
/**
|
|
2379
|
+
* @brief The remote client calls `setUserVisibility` to turn invisible.<br>
|
|
2380
|
+
*/
|
|
2381
|
+
SWITCH_TO_INVISIBLE = 2,
|
|
2382
|
+
|
|
2383
|
+
/**
|
|
2384
|
+
* @hidden
|
|
2385
|
+
* @brief The remote user has been removed from the room by the administrator via a OpenAPI call.
|
|
2386
|
+
*/
|
|
2387
|
+
KICKED_BY_ADMIN = 3
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2216
2390
|
/**
|
|
2217
2391
|
* @private
|
|
2218
2392
|
*/
|
|
@@ -2222,152 +2396,153 @@ export declare enum ChannelProfile {
|
|
|
2222
2396
|
}
|
|
2223
2397
|
|
|
2224
2398
|
/**
|
|
2225
|
-
* Room configure
|
|
2399
|
+
* @brief Room configure
|
|
2226
2400
|
*/
|
|
2227
2401
|
export interface RoomConfig {
|
|
2228
2402
|
|
|
2229
2403
|
/**
|
|
2230
|
-
* Enable/disable auto-subscribe audio. Enable by default.
|
|
2404
|
+
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
2231
2405
|
*/
|
|
2232
2406
|
isAutoPublish: boolean;
|
|
2233
2407
|
|
|
2234
2408
|
/**
|
|
2235
|
-
* Enable/disable auto-subscribe audio. Enable by default.
|
|
2409
|
+
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
2236
2410
|
* Call subscribeUserStream, unsubscribe to revise the subscription.
|
|
2237
2411
|
*/
|
|
2238
2412
|
isAutoSubscribeAudio: boolean;
|
|
2239
2413
|
|
|
2240
2414
|
/**
|
|
2241
|
-
* Enable/disable auto-subscribe video. Enable by default.
|
|
2415
|
+
* @brief Enable/disable auto-subscribe video. Enable by default.
|
|
2242
2416
|
* Call subscribeUserStream, unsubscribe to revise the subscription.
|
|
2243
2417
|
*/
|
|
2244
2418
|
isAutoSubscribeVideo: boolean;
|
|
2245
2419
|
}
|
|
2246
2420
|
|
|
2247
2421
|
/**
|
|
2248
|
-
*
|
|
2422
|
+
* @hidden
|
|
2423
|
+
* @brief Subscription mode
|
|
2249
2424
|
*/
|
|
2250
2425
|
export declare enum SubscribeMode {
|
|
2251
2426
|
|
|
2252
2427
|
/**
|
|
2253
|
-
* Auto. Subscribe every stream in the room automatically.
|
|
2428
|
+
* @brief Auto. Subscribe every stream in the room automatically.
|
|
2254
2429
|
*/
|
|
2255
2430
|
AUTO_SUBSCRIBE_MODE = 0,
|
|
2256
2431
|
|
|
2257
2432
|
/**
|
|
2258
|
-
* Manual.
|
|
2433
|
+
* @brief Manual. You can subscribe the stream in the room manually by calling [subscribeUserStream](104478#subscribeuserstream).
|
|
2259
2434
|
*/
|
|
2260
2435
|
MANUAL_SUBSCRIBE_MODE = 1
|
|
2261
2436
|
}
|
|
2262
2437
|
|
|
2263
2438
|
/**
|
|
2264
|
-
* Subscribe configuration
|
|
2439
|
+
* @brief Subscribe configuration
|
|
2265
2440
|
*/
|
|
2266
2441
|
export interface SubscribeConfig {
|
|
2267
2442
|
|
|
2268
2443
|
/**
|
|
2269
|
-
* Specify whether to subscribe the video stream.
|
|
2444
|
+
* @brief Specify whether to subscribe the video stream.
|
|
2270
2445
|
*/
|
|
2271
2446
|
isScreen: boolean;
|
|
2272
2447
|
|
|
2273
2448
|
/**
|
|
2274
|
-
* Specify whether to subscribe the audio stream.
|
|
2449
|
+
* @brief Specify whether to subscribe the audio stream.
|
|
2275
2450
|
*/
|
|
2276
2451
|
subVideo: boolean;
|
|
2277
2452
|
|
|
2278
2453
|
/**
|
|
2279
|
-
* Specify whether to subscribe the screen-sharing stream.
|
|
2454
|
+
* @brief Specify whether to subscribe the screen-sharing stream.
|
|
2280
2455
|
*/
|
|
2281
2456
|
subAudio: boolean;
|
|
2282
2457
|
}
|
|
2283
2458
|
|
|
2284
2459
|
/**
|
|
2285
|
-
* Transmission/Playback state of the media stream
|
|
2460
|
+
* @brief Transmission/Playback state of the media stream
|
|
2286
2461
|
*/
|
|
2287
2462
|
export declare enum MuteState {
|
|
2288
2463
|
|
|
2289
2464
|
/**
|
|
2290
|
-
* Enable
|
|
2465
|
+
* @brief Enable
|
|
2291
2466
|
*/
|
|
2292
2467
|
MUTE_STATE_OFF = 0,
|
|
2293
2468
|
|
|
2294
2469
|
/**
|
|
2295
|
-
* Disable
|
|
2470
|
+
* @brief Disable
|
|
2296
2471
|
*/
|
|
2297
2472
|
MUTE_STATE_ON = 1
|
|
2298
2473
|
}
|
|
2299
2474
|
|
|
2300
2475
|
/**
|
|
2301
|
-
* Result of updating subscription
|
|
2476
|
+
* @brief Result of updating subscription
|
|
2302
2477
|
*/
|
|
2303
2478
|
export declare enum SubscribeState {
|
|
2304
2479
|
|
|
2305
2480
|
/**
|
|
2306
|
-
* Update subscription successfully.
|
|
2481
|
+
* @brief Update subscription successfully.
|
|
2307
2482
|
*/
|
|
2308
2483
|
SUBSCRIBE_SUCC = 0,
|
|
2309
2484
|
|
|
2310
2485
|
/**
|
|
2311
|
-
* Update subscription failed.
|
|
2486
|
+
* @brief Update subscription failed.
|
|
2312
2487
|
*/
|
|
2313
2488
|
SUBSCRIBE_FAIL = 1
|
|
2314
2489
|
}
|
|
2315
2490
|
|
|
2316
2491
|
/**
|
|
2317
|
-
* Result of publishing
|
|
2492
|
+
* @brief Result of publishing
|
|
2318
2493
|
*/
|
|
2319
2494
|
export declare enum PublishState {
|
|
2320
2495
|
|
|
2321
2496
|
/**
|
|
2322
|
-
* Publish successfully.
|
|
2497
|
+
* @brief Publish successfully.
|
|
2323
2498
|
*/
|
|
2324
2499
|
PUBLISH_SUCC = 0,
|
|
2325
2500
|
|
|
2326
2501
|
/**
|
|
2327
|
-
* Publish failed.
|
|
2502
|
+
* @brief Publish failed.
|
|
2328
2503
|
*/
|
|
2329
2504
|
PUBLISH_FAIL = 1
|
|
2330
2505
|
}
|
|
2331
2506
|
|
|
2332
2507
|
/**
|
|
2333
|
-
* State of Mirror mode
|
|
2508
|
+
* @brief State of Mirror mode
|
|
2334
2509
|
*/
|
|
2335
2510
|
export declare enum MirrorMode {
|
|
2336
2511
|
|
|
2337
2512
|
/**
|
|
2338
|
-
* Disable
|
|
2513
|
+
* @brief Disable
|
|
2339
2514
|
*/
|
|
2340
2515
|
MIRROR_MODE_OFF = 0,
|
|
2341
2516
|
|
|
2342
2517
|
/**
|
|
2343
|
-
* Enable
|
|
2518
|
+
* @brief Enable
|
|
2344
2519
|
*/
|
|
2345
2520
|
MIRROR_MODE_ON = 1
|
|
2346
2521
|
}
|
|
2347
2522
|
|
|
2348
2523
|
/**
|
|
2349
|
-
* Media stream type
|
|
2524
|
+
* @brief Media stream type
|
|
2350
2525
|
*/
|
|
2351
2526
|
export declare enum PauseResumeControlMediaType {
|
|
2352
2527
|
|
|
2353
2528
|
/**
|
|
2354
|
-
* Audio
|
|
2529
|
+
* @brief Audio
|
|
2355
2530
|
*/
|
|
2356
2531
|
RTC_PAUSE_RESUME_CONTROL_AUDIO = 0,
|
|
2357
2532
|
|
|
2358
2533
|
/**
|
|
2359
|
-
* Video
|
|
2534
|
+
* @brief Video
|
|
2360
2535
|
*/
|
|
2361
2536
|
RTC_PAUSE_RESUME_CONTROL_VIDEO = 1,
|
|
2362
2537
|
|
|
2363
2538
|
/**
|
|
2364
|
-
* Both video and audio
|
|
2539
|
+
* @brief Both video and audio
|
|
2365
2540
|
*/
|
|
2366
2541
|
RTC_PAUSE_RESUME_CONTROL_AUDIO_AND_VIDEO = 2
|
|
2367
2542
|
}
|
|
2368
2543
|
|
|
2369
2544
|
/**
|
|
2370
|
-
* Player information and rendering mode
|
|
2545
|
+
* @brief Player information and rendering mode
|
|
2371
2546
|
*/
|
|
2372
2547
|
export interface VideoPlayerOption {
|
|
2373
2548
|
|
|
@@ -2377,12 +2552,12 @@ export interface VideoPlayerOption {
|
|
|
2377
2552
|
renderDom?: string | HTMLElement;
|
|
2378
2553
|
|
|
2379
2554
|
/**
|
|
2380
|
-
* Rendering modes: optional `RENDER_MODE_HIDDEN`, `RENDER_MODE_FIT` and `RENDER_MODE_ADAPTIVE`.
|
|
2555
|
+
* @brief Rendering modes: optional `RENDER_MODE_HIDDEN`, `RENDER_MODE_FIT` and `RENDER_MODE_ADAPTIVE`.
|
|
2381
2556
|
*/
|
|
2382
2557
|
renderMode?: VideoRenderMode;
|
|
2383
2558
|
|
|
2384
2559
|
/**
|
|
2385
|
-
* User ID, a non-empty string within 128 bytes. Use the following character set ranges <br>
|
|
2560
|
+
* @brief User ID, a non-empty string within 128 bytes. Use the following character set ranges <br>
|
|
2386
2561
|
* + 26 uppercase letters A~ Z
|
|
2387
2562
|
* + 26 lowercase letters a~ z
|
|
2388
2563
|
* + 10 numbers 0~ 9
|
|
@@ -2392,454 +2567,456 @@ export interface VideoPlayerOption {
|
|
|
2392
2567
|
}
|
|
2393
2568
|
|
|
2394
2569
|
/**
|
|
2395
|
-
* Rendering modes
|
|
2570
|
+
* @brief Rendering modes
|
|
2396
2571
|
*/
|
|
2397
2572
|
export declare enum VideoRenderMode {
|
|
2398
2573
|
|
|
2399
2574
|
/**
|
|
2400
|
-
* Windows fill priority. <br>
|
|
2575
|
+
* @brief Windows fill priority. <br>
|
|
2401
2576
|
* Scale the video frame at the original equal ratio until the window is filled with video. If the video frame aspect ratio is different from that of the window, the over-brims of the video frame will not be displayed. <br>
|
|
2402
2577
|
*/
|
|
2403
2578
|
RENDER_MODE_HIDDEN = 0,
|
|
2404
2579
|
|
|
2405
2580
|
/**
|
|
2406
|
-
* All video frame contents are fit to display in the window. <br>
|
|
2581
|
+
* @brief All video frame contents are fit to display in the window. <br>
|
|
2407
2582
|
* Scale the video frame at the original equal ratio until the whole video frame has been displayed in the window. If the video frame aspect ratio is different from that of the window, the area on the window that is not filled by the video frame will be blacked out. <br>
|
|
2408
2583
|
*/
|
|
2409
2584
|
RENDER_MODE_FIT = 1
|
|
2410
2585
|
}
|
|
2411
2586
|
|
|
2412
2587
|
/**
|
|
2413
|
-
* Audio player information
|
|
2588
|
+
* @brief Audio player information
|
|
2414
2589
|
*/
|
|
2415
2590
|
export interface AudioPlayerOption {
|
|
2416
2591
|
|
|
2417
2592
|
/**
|
|
2418
|
-
* User ID
|
|
2593
|
+
* @brief User ID
|
|
2419
2594
|
*/
|
|
2420
2595
|
userId: string;
|
|
2421
2596
|
|
|
2422
2597
|
/**
|
|
2423
|
-
* DOM
|
|
2598
|
+
* @brief DOM
|
|
2424
2599
|
*/
|
|
2425
2600
|
renderDom?: string;
|
|
2426
2601
|
}
|
|
2427
2602
|
|
|
2428
2603
|
/**
|
|
2429
|
-
* Stream specification
|
|
2604
|
+
* @brief Stream specification
|
|
2430
2605
|
*/
|
|
2431
2606
|
export declare enum StreamIndex {
|
|
2432
2607
|
|
|
2433
2608
|
/**
|
|
2434
|
-
* A mainstream is a media stream either captured by the internal module or from the custom source.
|
|
2609
|
+
* @brief A mainstream is a media stream either captured by the internal module or from the custom source.
|
|
2435
2610
|
*/
|
|
2436
2611
|
STREAM_INDEX_MAIN = 0,
|
|
2437
2612
|
|
|
2438
2613
|
/**
|
|
2439
|
-
* Screen-sharing stream, including screen-sharing video streams and/ or audio streams from sound cards
|
|
2614
|
+
* @brief Screen-sharing stream, including screen-sharing video streams and/ or audio streams from sound cards
|
|
2440
2615
|
*/
|
|
2441
2616
|
STREAM_INDEX_SCREEN = 1
|
|
2442
2617
|
}
|
|
2443
2618
|
|
|
2444
2619
|
/**
|
|
2445
|
-
* Type of the media stream subscribed to
|
|
2620
|
+
* @brief Type of the media stream subscribed to
|
|
2446
2621
|
*/
|
|
2447
2622
|
export declare enum SubscribeMediaType {
|
|
2448
2623
|
|
|
2449
2624
|
/**
|
|
2450
|
-
* Audio only
|
|
2625
|
+
* @brief Audio only
|
|
2451
2626
|
*/
|
|
2452
2627
|
AUDIO_ONLY = 0,
|
|
2453
2628
|
|
|
2454
2629
|
/**
|
|
2455
|
-
* Video only
|
|
2630
|
+
* @brief Video only
|
|
2456
2631
|
*/
|
|
2457
2632
|
VIDEO_ONLY = 1,
|
|
2458
2633
|
|
|
2459
2634
|
/**
|
|
2460
|
-
* Both video and audio
|
|
2635
|
+
* @brief Both video and audio
|
|
2461
2636
|
*/
|
|
2462
2637
|
AUDIO_AND_VIDEO = 2,
|
|
2463
2638
|
|
|
2464
2639
|
/**
|
|
2465
|
-
* Neither audio nor video
|
|
2640
|
+
* @brief Neither audio nor video
|
|
2466
2641
|
*/
|
|
2467
2642
|
NONE = 3
|
|
2468
2643
|
}
|
|
2469
2644
|
|
|
2470
2645
|
/**
|
|
2471
|
-
* Subscription configuration of video streams
|
|
2646
|
+
* @brief Subscription configuration of video streams
|
|
2472
2647
|
*/
|
|
2473
2648
|
export interface SubscribeVideoConfig {
|
|
2474
2649
|
|
|
2475
2650
|
/**
|
|
2476
|
-
* videoIndex Quality level of the video stream subscribed to. <br>
|
|
2651
|
+
* @brief videoIndex Quality level of the video stream subscribed to. <br>
|
|
2477
2652
|
* In Simulcast mode, use a number to specify the expected quality of the video stream to be subscribed to. In Simulcast mode, a video has a diversity of encoded qualities that ranking from 0 to 3. Call [setVideoEncoderConfig](#setvideoencoderconfig) to enable Simulcast mode on the publisher's clients. <br>
|
|
2478
2653
|
*/
|
|
2479
2654
|
videoIndex: number;
|
|
2480
2655
|
}
|
|
2481
2656
|
|
|
2482
2657
|
/**
|
|
2483
|
-
* Stream property. <br>
|
|
2658
|
+
* @brief Stream property. <br>
|
|
2484
2659
|
*/
|
|
2485
2660
|
export interface RTCStream {
|
|
2486
2661
|
|
|
2487
2662
|
/**
|
|
2488
|
-
* User ID
|
|
2663
|
+
* @brief User ID
|
|
2489
2664
|
*/
|
|
2490
2665
|
userId: string;
|
|
2491
2666
|
|
|
2492
2667
|
/**
|
|
2493
|
-
* Whether it is a screen-sharing stream
|
|
2668
|
+
* @brief Whether it is a screen-sharing stream
|
|
2494
2669
|
*/
|
|
2495
2670
|
isScreen: boolean;
|
|
2496
2671
|
|
|
2497
2672
|
/**
|
|
2498
|
-
* Whether it includes a video stream
|
|
2673
|
+
* @brief Whether it includes a video stream
|
|
2499
2674
|
*/
|
|
2500
2675
|
hasVideo: boolean;
|
|
2501
2676
|
|
|
2502
2677
|
/**
|
|
2503
|
-
* Whether it includes a audio stream
|
|
2678
|
+
* @brief Whether it includes a audio stream
|
|
2504
2679
|
*/
|
|
2505
2680
|
hasAudio: boolean;
|
|
2506
2681
|
|
|
2507
2682
|
/**
|
|
2508
|
-
* Properties of the video stream. <br>
|
|
2509
|
-
* When a remote user calls the [setVideoEncoderConfig](#setvideoencoderconfig) API to publish multiple configured video streams, this will contain attribute information for all video streams published by the user.
|
|
2510
|
-
* See VideoStreamDescription{@link #VideoStreamDescription}.
|
|
2683
|
+
* @brief Properties of the video stream. <br>
|
|
2684
|
+
* When a remote user calls the [setVideoEncoderConfig](#setvideoencoderconfig) API to publish multiple configured video streams, this will contain attribute information for all video streams published by the user.
|
|
2511
2685
|
*/
|
|
2512
2686
|
videoStreamDescriptions?: VideoStreamDescription[];
|
|
2513
2687
|
}
|
|
2514
2688
|
|
|
2515
2689
|
/**
|
|
2516
|
-
* The reason for the removal of the remote stream in the room. <br>
|
|
2690
|
+
* @brief The reason for the removal of the remote stream in the room. <br>
|
|
2517
2691
|
*
|
|
2518
2692
|
*/
|
|
2519
2693
|
export declare enum StreamRemoveReason {
|
|
2520
2694
|
|
|
2521
2695
|
/**
|
|
2522
|
-
* The remote user stops publishing the stream. <br>
|
|
2696
|
+
* @brief The remote user stops publishing the stream. <br>
|
|
2523
2697
|
*/
|
|
2524
2698
|
STREAM_REMOVE_REASON_UNPUBLISH = 0,
|
|
2525
2699
|
|
|
2526
2700
|
/**
|
|
2527
|
-
* The remote user failed to publish the stream. <br>
|
|
2701
|
+
* @brief The remote user failed to publish the stream. <br>
|
|
2528
2702
|
*/
|
|
2529
2703
|
STREAM_REMOVE_REASON_PUBLISH_FAILED = 1,
|
|
2530
2704
|
|
|
2531
2705
|
/**
|
|
2532
|
-
* Keep alive failed. <br>
|
|
2706
|
+
* @brief Keep alive failed. <br>
|
|
2533
2707
|
*/
|
|
2534
2708
|
STREAM_REMOVE_REASON_KEEP_LIVE_FAILED = 2,
|
|
2535
2709
|
|
|
2536
2710
|
/**
|
|
2537
|
-
* The remote user is disconnected. <br>
|
|
2711
|
+
* @brief The remote user is disconnected. <br>
|
|
2538
2712
|
*/
|
|
2539
2713
|
STREAM_REMOVE_REASON_CLIENT_DISCONNECTED = 3,
|
|
2540
2714
|
|
|
2541
2715
|
/**
|
|
2542
|
-
* The remote user republishes the stream. <br>
|
|
2716
|
+
* @brief The remote user republishes the stream. <br>
|
|
2543
2717
|
*/
|
|
2544
2718
|
STREAM_REMOVE_REASON_REPUBLISH = 4,
|
|
2545
2719
|
|
|
2546
2720
|
/**
|
|
2547
|
-
* Other reasons. <br>
|
|
2721
|
+
* @brief Other reasons. <br>
|
|
2548
2722
|
*/
|
|
2549
2723
|
STREAM_REMOVE_REASON_OTHER = 5
|
|
2550
2724
|
}
|
|
2551
2725
|
|
|
2552
2726
|
/**
|
|
2553
|
-
* @
|
|
2554
|
-
* SDK Connection state with the signaling server.
|
|
2727
|
+
* @brief SDK Connection state with the signaling server.
|
|
2555
2728
|
*/
|
|
2556
2729
|
export declare enum ConnectionState {
|
|
2557
2730
|
|
|
2558
2731
|
/**
|
|
2559
|
-
* Occupy related resource and get ready to start connecting.
|
|
2732
|
+
* @brief Occupy related resource and get ready to start connecting.
|
|
2560
2733
|
*/
|
|
2561
2734
|
CONNECTION_START = 0,
|
|
2562
2735
|
|
|
2563
2736
|
/**
|
|
2564
|
-
* Disconnected.
|
|
2737
|
+
* @brief Disconnected.
|
|
2565
2738
|
*/
|
|
2566
2739
|
CONNECTION_STATE_DISCONNECTED = 1,
|
|
2567
2740
|
|
|
2568
2741
|
/**
|
|
2569
|
-
* Connecting of the first connection
|
|
2742
|
+
* @brief Connecting of the first connection
|
|
2570
2743
|
*/
|
|
2571
2744
|
CONNECTION_STATE_CONNECTING = 2,
|
|
2572
2745
|
|
|
2573
2746
|
/**
|
|
2574
|
-
* Completion of the first connection
|
|
2747
|
+
* @brief Completion of the first connection
|
|
2575
2748
|
*/
|
|
2576
2749
|
CONNECTION_STATE_CONNECTED = 3,
|
|
2577
2750
|
|
|
2578
2751
|
/**
|
|
2579
|
-
* Reconnecting after a disconnection
|
|
2752
|
+
* @brief Reconnecting after a disconnection
|
|
2580
2753
|
*/
|
|
2581
2754
|
CONNECTION_STATE_RECONNECTING = 4,
|
|
2582
2755
|
|
|
2583
2756
|
/**
|
|
2584
|
-
* Completion of the reconnecting
|
|
2757
|
+
* @brief Completion of the reconnecting
|
|
2585
2758
|
*/
|
|
2586
2759
|
CONNECTION_STATE_RECONNECTED = 5
|
|
2587
2760
|
}
|
|
2588
2761
|
|
|
2589
2762
|
/**
|
|
2590
|
-
* Video parameters of each individual stream for simulcasting
|
|
2763
|
+
* @brief Video parameters of each individual stream for simulcasting
|
|
2591
2764
|
*/
|
|
2592
2765
|
export interface VideoStreamDescription {
|
|
2593
2766
|
|
|
2594
2767
|
/**
|
|
2595
|
-
* Width
|
|
2768
|
+
* @brief Width
|
|
2596
2769
|
*/
|
|
2597
2770
|
width?: number;
|
|
2598
2771
|
|
|
2599
2772
|
/**
|
|
2600
|
-
* Height
|
|
2773
|
+
* @brief Height
|
|
2601
2774
|
*/
|
|
2602
2775
|
height?: number;
|
|
2603
2776
|
|
|
2604
2777
|
/**
|
|
2605
|
-
* Video frame rate
|
|
2778
|
+
* @brief Video frame rate
|
|
2606
2779
|
*/
|
|
2607
2780
|
frameRate?: number;
|
|
2608
2781
|
|
|
2609
2782
|
/**
|
|
2610
|
-
* Max bitrate
|
|
2783
|
+
* @brief Max bitrate
|
|
2611
2784
|
*/
|
|
2612
2785
|
maxKbps?: number;
|
|
2613
2786
|
}
|
|
2614
2787
|
|
|
2615
2788
|
/**
|
|
2616
|
-
* Volume information. Contains user id and volume information for each speaker
|
|
2789
|
+
* @brief Volume information. Contains user id and volume information for each speaker
|
|
2617
2790
|
*/
|
|
2618
2791
|
export interface AudioVolumeInfo {
|
|
2619
2792
|
|
|
2620
2793
|
/**
|
|
2621
|
-
* Speaker's user id
|
|
2794
|
+
* @brief Speaker's user id
|
|
2622
2795
|
*/
|
|
2623
2796
|
userId: string;
|
|
2624
2797
|
|
|
2625
2798
|
/**
|
|
2626
|
-
* Speaker's volume, ranging from 0 (lowest) - 255 (highest)
|
|
2799
|
+
* @brief Speaker's volume, ranging from 0 (lowest) - 255 (highest)
|
|
2627
2800
|
*/
|
|
2628
2801
|
volume: number;
|
|
2629
2802
|
}
|
|
2630
2803
|
|
|
2631
2804
|
/**
|
|
2632
|
-
* Configuration for screen-sharing stream
|
|
2805
|
+
* @brief Configuration for screen-sharing stream
|
|
2633
2806
|
*/
|
|
2634
2807
|
export interface ScreenConfig {
|
|
2635
2808
|
|
|
2636
2809
|
/**
|
|
2637
|
-
* Set `true` for capturing the system audio when the user is using Chrome on Windows.
|
|
2810
|
+
* @brief Set `true` for capturing the system audio when the user is using Chrome on Windows.
|
|
2638
2811
|
*/
|
|
2639
2812
|
enableAudio?: boolean;
|
|
2640
2813
|
}
|
|
2641
2814
|
|
|
2642
2815
|
/**
|
|
2643
|
-
* Video encoding configuration
|
|
2816
|
+
* @brief Video encoding configuration
|
|
2644
2817
|
*/
|
|
2645
2818
|
export interface VideoEncoderConfig {
|
|
2646
2819
|
|
|
2647
2820
|
/**
|
|
2648
|
-
* The max bitrate, unit: kbps
|
|
2821
|
+
* @brief The max bitrate, unit: kbps
|
|
2649
2822
|
*/
|
|
2650
2823
|
maxKbps: number;
|
|
2651
2824
|
}
|
|
2652
2825
|
|
|
2653
2826
|
/**
|
|
2654
|
-
* Internal capture configuration for video & audio. Refer to [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) for more details.
|
|
2827
|
+
* @brief Internal capture configuration for video & audio. Refer to [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints) for more details.
|
|
2655
2828
|
*/
|
|
2656
2829
|
export declare type TrackCaptureConfig = Omit<MediaTrackConstraints, "deviceId">;
|
|
2657
2830
|
|
|
2658
2831
|
/**
|
|
2659
|
-
* The mirror type
|
|
2832
|
+
* @brief The mirror type
|
|
2660
2833
|
*/
|
|
2661
2834
|
export declare enum MirrorType {
|
|
2662
2835
|
|
|
2663
2836
|
/**
|
|
2664
|
-
* No mirroring effect
|
|
2837
|
+
* @brief No mirroring effect
|
|
2665
2838
|
*/
|
|
2666
2839
|
MIRROR_TYPE_NONE = 0,
|
|
2667
2840
|
|
|
2668
2841
|
/**
|
|
2669
|
-
* Enable mirror effect for the local video only. RTC SDK will not add mirror effect on the video to encode and transmit to the other
|
|
2842
|
+
* @brief Enable mirror effect for the local video only. RTC SDK will not add mirror effect on the video to encode and transmit to the other
|
|
2670
2843
|
*/
|
|
2671
2844
|
MIRROR_TYPE_RENDER = 1
|
|
2672
2845
|
}
|
|
2673
2846
|
|
|
2674
2847
|
/**
|
|
2675
|
-
* Configurations to be set when pushing media streams to CDN
|
|
2848
|
+
* @brief Configurations to be set when pushing media streams to CDN
|
|
2676
2849
|
*/
|
|
2677
2850
|
export interface LiveTranscodeConfig {
|
|
2678
2851
|
|
|
2679
2852
|
/**
|
|
2680
|
-
* CDN url where the mixed stream is supposed to be pushed.
|
|
2853
|
+
* @brief CDN url where the mixed stream is supposed to be pushed.
|
|
2681
2854
|
*/
|
|
2682
2855
|
url: string;
|
|
2683
2856
|
|
|
2684
2857
|
/**
|
|
2685
|
-
* Audio transcoding related configurations.
|
|
2858
|
+
* @brief Audio transcoding related configurations.
|
|
2686
2859
|
*/
|
|
2687
|
-
audio?: LiveTranscodeAudioConfig
|
|
2860
|
+
audio?: Partial<LiveTranscodeAudioConfig>;
|
|
2688
2861
|
|
|
2689
2862
|
/**
|
|
2690
|
-
* Video transcoding related configurations.
|
|
2863
|
+
* @brief Video transcoding related configurations.
|
|
2691
2864
|
*/
|
|
2692
|
-
video?: LiveTranscodeVideoConfig
|
|
2865
|
+
video?: Partial<LiveTranscodeVideoConfig>;
|
|
2693
2866
|
|
|
2694
2867
|
/**
|
|
2695
|
-
* User layout information. Refer to [LiveTranscodeLayoutConfig](#LiveTranscodeLayoutConfig) for more details.
|
|
2868
|
+
* @brief User layout information. Refer to [LiveTranscodeLayoutConfig](#LiveTranscodeLayoutConfig) for more details.
|
|
2696
2869
|
*/
|
|
2697
|
-
layout?: LiveTranscodeLayoutConfig
|
|
2870
|
+
layout?: Partial<LiveTranscodeLayoutConfig>;
|
|
2698
2871
|
}
|
|
2699
2872
|
export declare enum LogChannel {
|
|
2700
2873
|
|
|
2701
2874
|
/**
|
|
2702
|
-
* domestic
|
|
2875
|
+
* @brief domestic
|
|
2703
2876
|
*/
|
|
2704
2877
|
domestic = 0,
|
|
2705
2878
|
|
|
2706
2879
|
/**
|
|
2707
|
-
* overseas
|
|
2880
|
+
* @brief overseas
|
|
2708
2881
|
*/
|
|
2709
2882
|
overseas = 1
|
|
2710
2883
|
}
|
|
2711
2884
|
|
|
2712
2885
|
/**
|
|
2713
|
-
* Video transcoding related configurations
|
|
2886
|
+
* @brief Video transcoding related configurations. Assign a value exceeding the range will lead to a failure of starting or updating a live transcoding mission.
|
|
2714
2887
|
*/
|
|
2715
2888
|
export interface LiveTranscodeVideoConfig {
|
|
2716
2889
|
|
|
2717
2890
|
/**
|
|
2718
|
-
* Width
|
|
2891
|
+
* @brief Width in px. Range: [2, 4096]. The value must be even. The default value is 640 px.
|
|
2719
2892
|
*/
|
|
2720
|
-
width
|
|
2893
|
+
width: number;
|
|
2721
2894
|
|
|
2722
2895
|
/**
|
|
2723
|
-
* Height
|
|
2896
|
+
* @brief Height in px. Range: [2, 2160]. The value must be even. The default value is 360 px.
|
|
2724
2897
|
*/
|
|
2725
|
-
height
|
|
2898
|
+
height: number;
|
|
2726
2899
|
|
|
2727
2900
|
/**
|
|
2728
|
-
* The video encoding format to be set
|
|
2901
|
+
* @brief The video encoding format to be set. The default value is `H264`.
|
|
2729
2902
|
*/
|
|
2730
|
-
codec
|
|
2903
|
+
codec: string;
|
|
2731
2904
|
|
|
2732
2905
|
/**
|
|
2733
|
-
*
|
|
2906
|
+
* @brief Frame rate in fps. The value must be larger than 0. The default value is 30 fps.
|
|
2734
2907
|
*/
|
|
2735
|
-
fps
|
|
2908
|
+
fps: number;
|
|
2736
2909
|
|
|
2737
2910
|
/**
|
|
2738
|
-
* Number of frames between two I-frames.
|
|
2911
|
+
* @brief Number of frames between two I-frames. The value must be larger than 0. The default value is 60.
|
|
2739
2912
|
*/
|
|
2740
|
-
gop
|
|
2913
|
+
gop: number;
|
|
2741
2914
|
|
|
2742
2915
|
/**
|
|
2743
|
-
* Whether to push streams with low latency.
|
|
2916
|
+
* @brief Whether to push streams with low latency. The default value is `true`.
|
|
2744
2917
|
*/
|
|
2745
|
-
lowLatency
|
|
2918
|
+
lowLatency: boolean;
|
|
2746
2919
|
|
|
2747
2920
|
/**
|
|
2748
|
-
* Bitrate (
|
|
2921
|
+
* @brief Bitrate (Kbps) of the mixed video stream in Kbps. Range: [16, 50000000]. The default value is 600 Kbps.
|
|
2749
2922
|
*/
|
|
2750
|
-
kBitRate
|
|
2923
|
+
kBitRate: number;
|
|
2751
2924
|
}
|
|
2752
2925
|
|
|
2753
2926
|
/**
|
|
2754
|
-
* Audio transcoding related configurations
|
|
2927
|
+
* @brief Audio transcoding related configurations
|
|
2755
2928
|
*/
|
|
2756
2929
|
export interface LiveTranscodeAudioConfig {
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* @brief Audio coding standard. Optional. The default value is `AAC`.
|
|
2933
|
+
*/
|
|
2757
2934
|
codec?: string;
|
|
2758
2935
|
|
|
2759
2936
|
/**
|
|
2760
|
-
* The bitrate (kbps) to be set. The value must be
|
|
2937
|
+
* @brief The bitrate (kbps) to be set. The value must be 32, 64, 128, or 192. The default value is 64 Kbps.
|
|
2761
2938
|
*/
|
|
2762
|
-
kBitRate
|
|
2939
|
+
kBitRate: number;
|
|
2763
2940
|
|
|
2764
2941
|
/**
|
|
2765
|
-
*
|
|
2942
|
+
* @brief The sample rate (kHz) to be set. The value must be 32, 44.1, or 48. The default value is 48 Khz.
|
|
2766
2943
|
*/
|
|
2767
|
-
sampleRate
|
|
2944
|
+
sampleRate: number;
|
|
2768
2945
|
|
|
2769
2946
|
/**
|
|
2770
|
-
* The number of sound channels to be set. The value must be 1 or 2.
|
|
2947
|
+
* @brief The number of sound channels to be set. The value must be 1 or 2. The default value is 2.
|
|
2771
2948
|
*/
|
|
2772
|
-
channels
|
|
2949
|
+
channels: number;
|
|
2773
2950
|
|
|
2774
2951
|
/**
|
|
2775
|
-
* The AAC profile to be set
|
|
2952
|
+
* @brief The AAC profile to be set. The value must be `LC`, `HEv1`, ` or 'HEv2`. The default value is `LC`.
|
|
2776
2953
|
*/
|
|
2777
|
-
AACProfile
|
|
2954
|
+
AACProfile: "LC" | "HEv1" | "HEv2";
|
|
2778
2955
|
}
|
|
2779
2956
|
|
|
2780
2957
|
/**
|
|
2781
|
-
* User layout information
|
|
2958
|
+
* @brief User layout information
|
|
2782
2959
|
*/
|
|
2783
2960
|
export interface LiveTranscodeLayoutConfig {
|
|
2784
2961
|
|
|
2785
2962
|
/**
|
|
2786
|
-
* User layout information list
|
|
2963
|
+
* @brief User layout information list
|
|
2787
2964
|
*/
|
|
2788
|
-
regions
|
|
2965
|
+
regions: LiveTranscodeLayoutRegion[];
|
|
2789
2966
|
|
|
2790
2967
|
/**
|
|
2791
|
-
* Data passed through from the App
|
|
2968
|
+
* @brief Data passed through from the App
|
|
2792
2969
|
*/
|
|
2793
|
-
appData
|
|
2970
|
+
appData: string;
|
|
2794
2971
|
|
|
2795
2972
|
/**
|
|
2796
|
-
* Background color of the canvas
|
|
2973
|
+
* @brief Background color of the canvas
|
|
2797
2974
|
*/
|
|
2798
|
-
backgroundColor
|
|
2975
|
+
backgroundColor: string;
|
|
2799
2976
|
}
|
|
2800
2977
|
|
|
2801
2978
|
/**
|
|
2802
|
-
* Layout information for one of the video streams to be mixed
|
|
2979
|
+
* @brief Layout information for one of the video streams to be mixed
|
|
2803
2980
|
*/
|
|
2804
2981
|
export interface LiveTranscodeLayoutRegion {
|
|
2805
2982
|
|
|
2806
2983
|
/**
|
|
2807
|
-
* Transparency to be set. The range is [0.0, 1.0].
|
|
2984
|
+
* @brief Transparency to be set. The range is [0.0, 1.0].
|
|
2808
2985
|
*/
|
|
2809
2986
|
alpha: number;
|
|
2810
2987
|
|
|
2811
2988
|
/**
|
|
2812
|
-
* ID of the user who published the stream
|
|
2989
|
+
* @brief ID of the user who published the stream
|
|
2813
2990
|
*/
|
|
2814
2991
|
userId: string;
|
|
2815
2992
|
|
|
2816
2993
|
/**
|
|
2817
|
-
* The normalization ratio of the x-coordinate against the whole image which ranging from [0.0,1.0)
|
|
2994
|
+
* @brief The normalization ratio of the x-coordinate against the whole image which ranging from [0.0,1.0)
|
|
2818
2995
|
*/
|
|
2819
2996
|
x: number;
|
|
2820
2997
|
|
|
2821
2998
|
/**
|
|
2822
|
-
* The normalized horizontal coordinate value of the top left end vertex of the user's view, ranging within [0.0, 1.0)
|
|
2999
|
+
* @brief The normalized horizontal coordinate value of the top left end vertex of the user's view, ranging within [0.0, 1.0)
|
|
2823
3000
|
*/
|
|
2824
3001
|
y: number;
|
|
2825
3002
|
|
|
2826
3003
|
/**
|
|
2827
|
-
* The normalized vertical coordinate value of the top left end vertex of the user's view, ranging within [0.0, 1.0)
|
|
3004
|
+
* @brief The normalized vertical coordinate value of the top left end vertex of the user's view, ranging within [0.0, 1.0)
|
|
2828
3005
|
*/
|
|
2829
3006
|
zorder: number;
|
|
2830
3007
|
|
|
2831
3008
|
/**
|
|
2832
|
-
* The normalized width of the user's view, ranging within (0.0, 1.0]
|
|
3009
|
+
* @brief The normalized width of the user's view, ranging within (0.0, 1.0]
|
|
2833
3010
|
*/
|
|
2834
3011
|
w: number;
|
|
2835
3012
|
|
|
2836
3013
|
/**
|
|
2837
|
-
* The normalized height of the user's view, ranging within (0.0, 1.0]
|
|
3014
|
+
* @brief The normalized height of the user's view, ranging within (0.0, 1.0]
|
|
2838
3015
|
*/
|
|
2839
3016
|
h: number;
|
|
2840
3017
|
|
|
2841
3018
|
/**
|
|
2842
|
-
* The view mode to be set. See the following options: <br>
|
|
3019
|
+
* @brief The view mode to be set. See the following options: <br>
|
|
2843
3020
|
* + 1: Fill and Crop. The video is enlarged or shrunk with fixed aspect ratio, and completely fills the windows. The region of the video which exceeds the window will be cropped. <br>
|
|
2844
3021
|
* + 2: Fit. The video is enlarged or shrunk with fixed aspect ratio, and is shown completely in the windows. The region of the window, which is not filled with video, is filled with black background. <br>
|
|
2845
3022
|
* + 3: Stretch. The video's aspect ratio is changed as it's automatically stretched to completely fill the bounding box it's contained in, but the whole image is visible.
|
|
@@ -2847,7 +3024,7 @@ export interface LiveTranscodeLayoutRegion {
|
|
|
2847
3024
|
renderMode?: number;
|
|
2848
3025
|
|
|
2849
3026
|
/**
|
|
2850
|
-
* The content to be set. The default value is 0. See the following options: <br>
|
|
3027
|
+
* @brief The content to be set. The default value is 0. See the following options: <br>
|
|
2851
3028
|
* + 0: Push both audio and video stream. <br>
|
|
2852
3029
|
* + 1: Push audio stream only. <br>
|
|
2853
3030
|
* + 2: Push video stream only.
|
|
@@ -2855,86 +3032,102 @@ export interface LiveTranscodeLayoutRegion {
|
|
|
2855
3032
|
contentControl?: number;
|
|
2856
3033
|
|
|
2857
3034
|
/**
|
|
2858
|
-
* Whether the stream comes from screen sharing
|
|
3035
|
+
* @brief Whether the stream comes from screen sharing
|
|
2859
3036
|
*/
|
|
2860
3037
|
isScreenStream: boolean;
|
|
2861
3038
|
|
|
2862
3039
|
/**
|
|
2863
|
-
* Whether the source user of the stream is a local user.
|
|
3040
|
+
* @brief Whether the source user of the stream is a local user.
|
|
2864
3041
|
*/
|
|
2865
3042
|
isLocalUser: boolean;
|
|
2866
3043
|
}
|
|
2867
3044
|
|
|
2868
3045
|
/**
|
|
2869
|
-
* Information of the remote stream
|
|
3046
|
+
* @brief Information of the remote stream
|
|
2870
3047
|
*/
|
|
2871
3048
|
export interface RemoteStreamKey {
|
|
2872
3049
|
|
|
2873
3050
|
/**
|
|
2874
|
-
* Room identification
|
|
3051
|
+
* @brief Room identification
|
|
2875
3052
|
*/
|
|
2876
3053
|
roomId: string;
|
|
2877
3054
|
|
|
2878
3055
|
/**
|
|
2879
|
-
* User identification
|
|
3056
|
+
* @brief User identification
|
|
2880
3057
|
*/
|
|
2881
3058
|
userId: string;
|
|
2882
3059
|
|
|
2883
3060
|
/**
|
|
2884
|
-
* Mainstream or screen-sharing stream. Refer to [StreamIndex](#streamIndex) for details.
|
|
3061
|
+
* @brief Mainstream or screen-sharing stream. Refer to [StreamIndex](#streamIndex) for details.
|
|
2885
3062
|
*/
|
|
2886
3063
|
streamIndex: StreamIndex;
|
|
2887
3064
|
}
|
|
3065
|
+
|
|
3066
|
+
/**
|
|
3067
|
+
* @brief Login status
|
|
3068
|
+
*/
|
|
2888
3069
|
export declare enum USER_ONLINE_STATUS {
|
|
3070
|
+
|
|
3071
|
+
/**
|
|
3072
|
+
* @brief Offline. And cannot send or receive any P2P message.
|
|
3073
|
+
*/
|
|
2889
3074
|
OFFLINE = 0,
|
|
3075
|
+
|
|
3076
|
+
/**
|
|
3077
|
+
* @brief Online
|
|
3078
|
+
*/
|
|
2890
3079
|
ONLINE = 1,
|
|
3080
|
+
|
|
3081
|
+
/**
|
|
3082
|
+
* @brief Unreachable. And cannot send or receive any P2P message.
|
|
3083
|
+
*/
|
|
2891
3084
|
UNREACHABLE = 2
|
|
2892
3085
|
}
|
|
2893
3086
|
|
|
2894
3087
|
/**
|
|
2895
|
-
* Point-to-point text message
|
|
3088
|
+
* @brief Point-to-point text message
|
|
2896
3089
|
*/
|
|
2897
3090
|
export interface UserMessageEvent {
|
|
2898
3091
|
|
|
2899
3092
|
/**
|
|
2900
|
-
* The user who sent the message
|
|
3093
|
+
* @brief The user who sent the message
|
|
2901
3094
|
*/
|
|
2902
3095
|
userId: string;
|
|
2903
3096
|
|
|
2904
3097
|
/**
|
|
2905
|
-
* Point-to-point text message
|
|
3098
|
+
* @brief Point-to-point text message
|
|
2906
3099
|
*/
|
|
2907
3100
|
message: Object | string;
|
|
2908
3101
|
}
|
|
2909
3102
|
|
|
2910
3103
|
/**
|
|
2911
|
-
* Point-to-point binary message
|
|
3104
|
+
* @brief Point-to-point binary message
|
|
2912
3105
|
*/
|
|
2913
3106
|
export interface UserBinaryMessageEvent {
|
|
2914
3107
|
|
|
2915
3108
|
/**
|
|
2916
|
-
* The user who sent the message
|
|
3109
|
+
* @brief The user who sent the message
|
|
2917
3110
|
*/
|
|
2918
3111
|
userId: string;
|
|
2919
3112
|
|
|
2920
3113
|
/**
|
|
2921
|
-
* Point-to-point binary message
|
|
3114
|
+
* @brief Point-to-point binary message
|
|
2922
3115
|
*/
|
|
2923
3116
|
message: ArrayBuffer;
|
|
2924
3117
|
}
|
|
2925
3118
|
|
|
2926
3119
|
/**
|
|
2927
|
-
* Event during pushing stream to CDN
|
|
3120
|
+
* @brief Event during pushing stream to CDN
|
|
2928
3121
|
*/
|
|
2929
3122
|
export interface LiveTranscodingResultEvent {
|
|
2930
3123
|
|
|
2931
3124
|
/**
|
|
2932
|
-
* Event number during pushing stream to CDN
|
|
3125
|
+
* @brief Event number during pushing stream to CDN
|
|
2933
3126
|
*/
|
|
2934
3127
|
code: number;
|
|
2935
3128
|
|
|
2936
3129
|
/**
|
|
2937
|
-
* Event details during pushing stream to CDN
|
|
3130
|
+
* @brief Event details during pushing stream to CDN
|
|
2938
3131
|
*/
|
|
2939
3132
|
message: string;
|
|
2940
3133
|
}
|
|
@@ -2958,46 +3151,44 @@ declare function getParameter(key: keyof typeof Config): string | string[] | nev
|
|
|
2958
3151
|
export interface IVERTC {
|
|
2959
3152
|
|
|
2960
3153
|
/**
|
|
2961
|
-
* Call this API to create an IRTCEngine instance that provides RTC service. <br>
|
|
3154
|
+
* @brief Call this API to create an IRTCEngine instance that provides RTC service. <br>
|
|
2962
3155
|
* Call this API before calling any other APIs within the RTC SDK.<br>
|
|
2963
3156
|
* Calling this API repeatedly will create multiple IRTCEngine instances.
|
|
2964
3157
|
* @param appId A unique identifier for each application. You can apply appIDs on the RTC console. <br>
|
|
2965
3158
|
* Instances generated by different AppIDs are independent in RTC service. Users served by one AppID cannot communicate with users served by another AppID.
|
|
2966
|
-
* @return Return an IRTCEngine
|
|
2967
|
-
* @notes
|
|
2968
|
-
* + Call destroyEngine{@link #destroyEngine} respectively to destroy each IRTCEngine instance.
|
|
3159
|
+
* @return Return an `IRTCEngine` instance if you call this API successfully.
|
|
3160
|
+
* @notes + Call [destroyEngine](#destroyengine) respectively to destroy each IRTCEngine instance.
|
|
2969
3161
|
* + As each IRTCEngine instance is resource consuming, we recommend creating no more than 2 engine instances on each device at the same time.
|
|
2970
3162
|
* @region Engine Management
|
|
2971
3163
|
*/
|
|
2972
3164
|
createEngine(appId: string): IRTCEngine;
|
|
2973
3165
|
|
|
2974
3166
|
/**
|
|
2975
|
-
* Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
|
|
2976
|
-
* @
|
|
2977
|
-
*
|
|
2978
|
-
* + By calling this API, this IRTCEngine{@link #IRTCEngine} instance and resource related will be wiped from memory. And any interaction with the media server will end. <br>
|
|
3167
|
+
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
|
|
3168
|
+
* @param engine By calling this API, this `IRTCEngine` instance and resource related will be wiped from memory. And any interaction with the media server will end.
|
|
3169
|
+
* @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended. <br>
|
|
2979
3170
|
* + Calling this API will block the main thread until it completes the exiting process. Therefore, do not include this API in a callback. Nor wait in a callback for the execution of this API in the main thread, thus causing a deadlock.
|
|
2980
3171
|
* @region Engine Management
|
|
2981
3172
|
*/
|
|
2982
3173
|
destroyEngine(engine: IRTCEngine): void;
|
|
2983
3174
|
|
|
2984
3175
|
/**
|
|
2985
|
-
* Get the current version of the SDK.
|
|
3176
|
+
* @brief Get the current version of the SDK.
|
|
2986
3177
|
* @return The current SDK version.
|
|
2987
3178
|
* @region Engine Management
|
|
2988
3179
|
*/
|
|
2989
3180
|
getSdkVersion(): string;
|
|
2990
3181
|
|
|
2991
3182
|
/**
|
|
2992
|
-
* Call this API to enumerate media devices and their IDs, such as microphone, camera, and headset.
|
|
3183
|
+
* @brief Call this API to enumerate media devices and their IDs, such as microphone, camera, and headset.
|
|
2993
3184
|
* Call this API to get deviceIds used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice), [startVideoCapture](#startvideocapture), and [startAudioCapture](#startaudiocapture).
|
|
2994
|
-
* @return A list of all media devices
|
|
3185
|
+
* @return A list of all media devices.
|
|
2995
3186
|
* @region Device Management
|
|
2996
3187
|
*/
|
|
2997
3188
|
getDevices(): Promise<RTCDevice[]>;
|
|
2998
3189
|
|
|
2999
3190
|
/**
|
|
3000
|
-
* Call this API to request for access to video and audio devices.
|
|
3191
|
+
* @brief Call this API to request for access to video and audio devices.
|
|
3001
3192
|
* @param options The device type you need
|
|
3002
3193
|
* <li>`video: boolean` Video devices<li>`audio:boolean` Audio devices</li>
|
|
3003
3194
|
* @return <li>`video: boolean` Video devices<li>`audio:boolean` Audio devices</li>
|
|
@@ -3012,31 +3203,31 @@ export interface IVERTC {
|
|
|
3012
3203
|
}>;
|
|
3013
3204
|
|
|
3014
3205
|
/**
|
|
3015
|
-
* Call this API to enumerate microphone devices.
|
|
3206
|
+
* @brief Call this API to enumerate microphone devices.
|
|
3016
3207
|
* Call this API to get Device IDs used to specify the device when calling [startAudioCapture](#startaudiocapture).
|
|
3017
|
-
* @return A list including all microphone devices
|
|
3208
|
+
* @return A list including all microphone devices.
|
|
3018
3209
|
* @region Device Management
|
|
3019
3210
|
*/
|
|
3020
3211
|
getMicrophones: () => Promise<RTCDevice[]>;
|
|
3021
3212
|
|
|
3022
3213
|
/**
|
|
3023
|
-
* Call this API to enumerate audio and video devices and their IDs, such as microphone, camera, and headset.
|
|
3214
|
+
* @brief Call this API to enumerate audio and video devices and their IDs, such as microphone, camera, and headset.
|
|
3024
3215
|
* Call this API to get Device IDs used to specify the device when calling [startVideoCapture](#startvideocapture).
|
|
3025
|
-
* @return A list including all camera devices.
|
|
3216
|
+
* @return A list including all camera devices.
|
|
3026
3217
|
* @region Device Management
|
|
3027
3218
|
*/
|
|
3028
3219
|
getCameras: () => Promise<RTCDevice[]>;
|
|
3029
3220
|
|
|
3030
3221
|
/**
|
|
3031
|
-
* Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
|
|
3222
|
+
* @brief Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
|
|
3032
3223
|
* Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice).
|
|
3033
|
-
* @return A list including all audio playback devices.
|
|
3224
|
+
* @return A list including all audio playback devices.
|
|
3034
3225
|
* @region Device Management
|
|
3035
3226
|
*/
|
|
3036
3227
|
getAudioPlayback: () => Promise<RTCDevice[]>;
|
|
3037
3228
|
|
|
3038
3229
|
/**
|
|
3039
|
-
* Call this API to check whether the browser is supported.
|
|
3230
|
+
* @brief Call this API to check whether the browser is supported.
|
|
3040
3231
|
* @return
|
|
3041
3232
|
* + `True`: Supported
|
|
3042
3233
|
* - `False`: Not Supported
|
|
@@ -3065,6 +3256,7 @@ declare class VERTC implements IVERTC {
|
|
|
3065
3256
|
events: typeof EngineEventsTypes;
|
|
3066
3257
|
ErrorCode: typeof ErrorCode;
|
|
3067
3258
|
platform: string;
|
|
3259
|
+
private _monitor;
|
|
3068
3260
|
}
|
|
3069
3261
|
declare const _default: VERTC;
|
|
3070
3262
|
export default _default;
|