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