@byteplus/rtc 4.49.8 → 4.51.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/extension-ainr/index.js +1 -1
- package/extension-ainr/index.umd.js +1 -1
- package/extension-beauty/index.js +1 -1
- package/extension-beauty/index.umd.js +1 -1
- package/index.d.ts +656 -467
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -2,6 +2,285 @@
|
|
|
2
2
|
|
|
3
3
|
import { EventArgs, EventEmitter, EventNames, ValidEventTypes } from 'eventemitter3';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @id AudioMixingManager
|
|
7
|
+
* @list overview
|
|
8
|
+
* @detail api
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* @id AudioMixingManager
|
|
12
|
+
* @list overview
|
|
13
|
+
* @detail api
|
|
14
|
+
*/
|
|
15
|
+
export interface IAudioMixingManager {
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* @brief Start playing audio files and mixes.
|
|
19
|
+
* 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.
|
|
20
|
+
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique.
|
|
21
|
+
* If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
|
|
22
|
+
* @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.
|
|
23
|
+
* @param config Mix Sound configuration.
|
|
24
|
+
* 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.
|
|
25
|
+
* @return
|
|
26
|
+
* @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).
|
|
27
|
+
* + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file.
|
|
28
|
+
* + The mixing data of this method comes from an external file, while the mixing data of [enableAudioMixingBuffer](#enableaudiomixingbuffer) comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
|
|
29
|
+
* @region Advanced Feature
|
|
30
|
+
*/
|
|
31
|
+
startAudioMixing: (id: number, filePath: string, options: MixOption) => Promise<void>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @brief Stop playing audio files and mixes
|
|
35
|
+
* @param id ID of the mixing
|
|
36
|
+
* @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.
|
|
37
|
+
* + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
|
|
38
|
+
* @region Advanced Feature
|
|
39
|
+
*/
|
|
40
|
+
stopAudioMixing: (id: number) => void;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @brief Pause playing audio files and mixes
|
|
44
|
+
* @param id ID of the mixing
|
|
45
|
+
* @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.
|
|
46
|
+
* + After calling this method to pause playing audio files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing.
|
|
47
|
+
* @region Advanced Feature
|
|
48
|
+
*/
|
|
49
|
+
pauseAudioMixing: (id: number) => void;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @brief Resume playing audio files and mixing
|
|
53
|
+
* @param id Mixing ID
|
|
54
|
+
* @notes After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing audio files and mixing, you can resume playing and mixing by calling this method.
|
|
55
|
+
* @region Advanced Feature
|
|
56
|
+
*/
|
|
57
|
+
resumeAudioMixing: (id: number) => void;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @brief Preload the specified audio file into memory
|
|
61
|
+
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique.
|
|
62
|
+
* If this method is called repeatedly with the same ID, the latter overrides the previous.
|
|
63
|
+
* 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.
|
|
64
|
+
* 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.
|
|
65
|
+
* @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio.
|
|
66
|
+
* @return
|
|
67
|
+
* @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.
|
|
68
|
+
* + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file.
|
|
69
|
+
* + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
|
|
70
|
+
* @region Advanced Feature
|
|
71
|
+
*/
|
|
72
|
+
preloadAudioMixing: (id: number, filePath: string) => Promise<void>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @brief Uninstall the specified audio file
|
|
76
|
+
* @param id Mix ID
|
|
77
|
+
* @region Advanced Feature
|
|
78
|
+
*/
|
|
79
|
+
unloadAudioMixing: (id: number) => void;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @brief Adjust the volume of audio mixing, including audio files and PCM data.
|
|
83
|
+
* @param id Mixing ID
|
|
84
|
+
* @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`.
|
|
85
|
+
* + 0: Mute
|
|
86
|
+
* + 100: Original volume
|
|
87
|
+
* + 400: Maximum volume (with overflow protection)
|
|
88
|
+
* @region Advanced Feature
|
|
89
|
+
*/
|
|
90
|
+
setAudioMixingVolume: (id: number, volume: number) => void;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @brief Get volume of the audio files.
|
|
94
|
+
* @param id Audio mix id
|
|
95
|
+
* @return + `0`: Failure
|
|
96
|
+
* + `>0`: Successful. Volume
|
|
97
|
+
* @region Advanced Feature
|
|
98
|
+
*/
|
|
99
|
+
getAudioMixingVolume: (id: number) => number;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @brief Get audio file duration
|
|
103
|
+
* @param id Mix ID
|
|
104
|
+
* @return + `> 0`: Success, audio file duration, in milliseconds.
|
|
105
|
+
* + `< 0`: Failure
|
|
106
|
+
* @notes Before calling this method to obtain the length of the audio file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing).
|
|
107
|
+
* @region Advanced Feature
|
|
108
|
+
*/
|
|
109
|
+
getAudioMixingDuration: (id: number) => number;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @brief Get audio file playback progress
|
|
113
|
+
* @param id Mix ID
|
|
114
|
+
* @return + `> 0`: Success, audio file playback progress, in milliseconds.
|
|
115
|
+
* + `< 0`: Failed
|
|
116
|
+
* @notes Before calling this method to get the audio file playback progress, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
|
|
117
|
+
* @region Advanced Feature
|
|
118
|
+
*/
|
|
119
|
+
getAudioMixingCurrentPosition: (id: number) => number;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* @brief Set the starting playback position of the audio file
|
|
123
|
+
* @param id Mixing ID
|
|
124
|
+
* @param position The starting playback position of the audio file in milliseconds.
|
|
125
|
+
* 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.
|
|
126
|
+
* @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.
|
|
127
|
+
* + 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.
|
|
128
|
+
* @region Advanced Feature
|
|
129
|
+
*/
|
|
130
|
+
setAudioMixingPosition: (id: number, position: number) => void;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* @brief Start PCM mixing.
|
|
134
|
+
* To mix multiple PCM audio data, call this API multiple times with different ids.
|
|
135
|
+
* @param type Mixing type.
|
|
136
|
+
* Whether the PCM data is mixed locally and sent to the remotes.
|
|
137
|
+
* @notes + After this API, you must call [pushAudioMixingBuffer](#pushaudiomixingbuffer) to start mixing.
|
|
138
|
+
* + To end PCM mixing, use [disableAudioMixingBuffer](#disableaudiomixingbuffer).
|
|
139
|
+
* @region Advanced Feature
|
|
140
|
+
*/
|
|
141
|
+
enableAudioMixingBuffer: (type: AudioMixingType) => void;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @brief Disable PCM mixing.
|
|
145
|
+
* @region Advanced Feature
|
|
146
|
+
*/
|
|
147
|
+
disableAudioMixingBuffer: () => void;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @brief Push PCM audio frame data for mixing
|
|
151
|
+
* @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
|
|
152
|
+
* @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingBuffer](#enableaudiomixingbuffer).
|
|
153
|
+
* @region Advanced Feature
|
|
154
|
+
*/
|
|
155
|
+
pushAudioMixingBuffer: (buffer: AudioBuffer) => void;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* @brief Mix playback channel type
|
|
160
|
+
*/
|
|
161
|
+
export declare enum AudioMixingDualMonoMode {
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* @brief Consistent with audio files
|
|
165
|
+
*/
|
|
166
|
+
AUTO = 0,
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @brief Only the left channel audio in the audio file can be heard
|
|
170
|
+
*/
|
|
171
|
+
MODE_L = 1,
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @brief Only the right channel audio in the audio file can be heard
|
|
175
|
+
*/
|
|
176
|
+
MODE_R = 2,
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @brief Can hear the left and right audio channels in the audio file at the same time
|
|
180
|
+
*/
|
|
181
|
+
MODE_MIX = 3
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* @brief Mixing type
|
|
186
|
+
*/
|
|
187
|
+
export declare enum AudioMixingType {
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* @brief Played at the local device only
|
|
191
|
+
*/
|
|
192
|
+
PLAYOUT = 0,
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* @brief Sent to the remote devices only
|
|
196
|
+
*/
|
|
197
|
+
PUBLISH = 1,
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @brief Played at the local device and sent to the remote devices.
|
|
201
|
+
*/
|
|
202
|
+
PLAYOUT_AND_PUBLISH = 2
|
|
203
|
+
}
|
|
204
|
+
declare enum AudioMixingState {
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* @brief Mix loaded
|
|
208
|
+
*/
|
|
209
|
+
AUDIO_MIXING_STATE_PRELOADED = 0,
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* @brief Mix is playing
|
|
213
|
+
*/
|
|
214
|
+
AUDIO_MIXING_STATE_PLAYING = 1,
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @brief Mix Pause
|
|
218
|
+
*/
|
|
219
|
+
AUDIO_MIXING_STATE_PAUSED = 2,
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @brief Mixing stopped
|
|
223
|
+
*/
|
|
224
|
+
AUDIO_MIXING_STATE_STOPPED = 3,
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* @brief Mix playback failed
|
|
228
|
+
*/
|
|
229
|
+
AUDIO_MIXING_STATE_FAILED = 4,
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* @brief End of mixing
|
|
233
|
+
*/
|
|
234
|
+
AUDIO_MIXING_STATE_FINISHED = 5,
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @brief Prepare PCM Mix
|
|
238
|
+
*/
|
|
239
|
+
AUDIO_MIXING_STATE_PCM_ENABLED = 6,
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @brief End of PCM mix playback
|
|
243
|
+
*/
|
|
244
|
+
AUDIO_MIXING_STATE_PCM_DISABLED = 7
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* @brief Mixing configuration
|
|
249
|
+
*/
|
|
250
|
+
export interface MixOption {
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* @brief Mix playback times
|
|
254
|
+
* @notes + Play_count < = 0: Infinite loop
|
|
255
|
+
* + Play_count == 1: Play once (default)
|
|
256
|
+
* + Play_count > 1: Play play_count times
|
|
257
|
+
*/
|
|
258
|
+
playCount: number;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* @brief For mixing playback types.
|
|
262
|
+
*/
|
|
263
|
+
type?: AudioMixingType;
|
|
264
|
+
}
|
|
265
|
+
declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string | symbol> extends EventEmitter<EventTypes> {
|
|
266
|
+
safeEmit<T extends EventNames<EventTypes>>(event: T, ...args: EventArgs<EventTypes, T>): boolean;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* @brief Information and state of a media device.
|
|
271
|
+
*/
|
|
272
|
+
export interface DeviceInfo {
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @brief Information of a media device. See [MediaDeviceInfo](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo).
|
|
276
|
+
*/
|
|
277
|
+
mediaDeviceInfo: MediaDeviceInfo;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* @brief Device state.
|
|
281
|
+
*/
|
|
282
|
+
deviceState: "active" | "inactive";
|
|
283
|
+
}
|
|
5
284
|
declare enum ErrorCode {
|
|
6
285
|
|
|
7
286
|
/**
|
|
@@ -320,10 +599,17 @@ declare enum ErrorCode {
|
|
|
320
599
|
USER_MESSAGE_NO_RECEIVER = "USER_MESSAGE_NO_RECEIVER",
|
|
321
600
|
|
|
322
601
|
/**
|
|
602
|
+
* @hidden
|
|
603
|
+
* @deprecated since 4.49, use USER_MESSAGE_NO_RECEIVER instead.
|
|
323
604
|
* @brief No relay path
|
|
324
605
|
*/
|
|
325
606
|
USER_MESSAGE_NO_RELAYPATH = "USER_MESSAGE_NO_RELAYPATH",
|
|
326
607
|
|
|
608
|
+
/**
|
|
609
|
+
* @brief Exceeds QPS limit
|
|
610
|
+
*/
|
|
611
|
+
USER_MESSAGE_EXCEED_QPS = "USER_MESSAGE_EXCEED_QPS",
|
|
612
|
+
|
|
327
613
|
/**
|
|
328
614
|
* @brief No response after sending messages to a server probably due to Http request failure
|
|
329
615
|
*/
|
|
@@ -338,409 +624,142 @@ declare enum ErrorCode {
|
|
|
338
624
|
* @brief The user has not joined any room.
|
|
339
625
|
*/
|
|
340
626
|
USER_MESSAGE_NOT_JOIN = "USER_MESSAGE_NOT_JOIN",
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* @
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
/**
|
|
348
|
-
* @brief No available data connection
|
|
349
|
-
*/
|
|
350
|
-
USER_MESSAGE_NO_CONNECTION = "USER_MESSAGE_NO_CONNECTION",
|
|
351
|
-
|
|
352
|
-
/**
|
|
353
|
-
* @brief Sending a message before login to the IM server
|
|
354
|
-
*/
|
|
355
|
-
USER_MESSAGE_NOT_LOGIN = "USER_MESSAGE_NOT_LOGIN",
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* @brief Lack of params of the IM server
|
|
359
|
-
*/
|
|
360
|
-
USER_MESSAGE_SERVER_PARAMS_NOTSET = "USER_MESSAGE_SERVER_PARAMS_NOTSET",
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* @brief Unknown error of messaging
|
|
364
|
-
*/
|
|
365
|
-
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN",
|
|
366
|
-
|
|
367
|
-
/**
|
|
368
|
-
* @brief The user publishes a public stream before joining room.
|
|
369
|
-
*/
|
|
370
|
-
START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN",
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* @brief Reconnection with the server fails and SDK will no longer automatically retry.
|
|
374
|
-
* Please leave room first and join room again, or contact technical support.
|
|
375
|
-
*/
|
|
376
|
-
RECONNECT_FAILED = "RECONNECT_FAILED"
|
|
377
|
-
}
|
|
378
|
-
declare enum AudioMixingError {
|
|
379
|
-
|
|
380
|
-
/**
|
|
381
|
-
* @brief Normal
|
|
382
|
-
*/
|
|
383
|
-
AUDIO_MIXING_ERROR_OK = 0,
|
|
384
|
-
|
|
385
|
-
/**
|
|
386
|
-
* @brief Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
387
|
-
*/
|
|
388
|
-
AUDIO_MIXING_ERROR_PRELOAD_FAILED = 1,
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* @brief Audio mixing starts fails because of missing audio file or failure of reading the audio file.
|
|
392
|
-
*/
|
|
393
|
-
AUDIO_MIXING_ERROR_START_FAILED = 2,
|
|
394
|
-
|
|
395
|
-
/**
|
|
396
|
-
* @brief Invalid audio mixing ID
|
|
397
|
-
*/
|
|
398
|
-
AUDIO_MIXING_ERROR_ID_NOT_FOUND = 3,
|
|
399
|
-
|
|
400
|
-
/**
|
|
401
|
-
* @brief Invalid start position
|
|
402
|
-
*/
|
|
403
|
-
AUDIO_MIXING_ERROR_SET_POSITION_FAILED = 4,
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* @brief Invalid volume argument. The volume value ranges [0, 400].
|
|
407
|
-
*/
|
|
408
|
-
AUDIO_MIXING_ERROR_INVALID_VOLUME = 5,
|
|
409
|
-
|
|
410
|
-
/**
|
|
411
|
-
* @brief The audio file to be played does not match to the preload one. Call `unloadAudioMixing` to unload file and proceed.
|
|
412
|
-
*/
|
|
413
|
-
AUDIO_MIXING_ERROR_LOAD_CONFLICT = 6,
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* @brief Type of the audio file to be played is not supported.
|
|
417
|
-
*/
|
|
418
|
-
AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH = 7,
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* @brief Invalid audio pitch
|
|
422
|
-
*/
|
|
423
|
-
AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH = 8,
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* @brief Invalid audio track
|
|
427
|
-
*/
|
|
428
|
-
AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK = 9
|
|
429
|
-
}
|
|
430
|
-
/**
|
|
431
|
-
* @id AudioMixingManager
|
|
432
|
-
* @list 104477
|
|
433
|
-
* @detail 104478
|
|
434
|
-
*/
|
|
435
|
-
/**
|
|
436
|
-
* @id AudioMixingManager
|
|
437
|
-
* @list 104477
|
|
438
|
-
* @detail 104478
|
|
439
|
-
*/
|
|
440
|
-
export interface IAudioMixingManager {
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* @brief Start playing audio files and mixes.
|
|
444
|
-
* 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.
|
|
445
|
-
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique.
|
|
446
|
-
* If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
|
|
447
|
-
* @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.
|
|
448
|
-
* @param config Mix Sound configuration.
|
|
449
|
-
* 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.
|
|
450
|
-
* @return
|
|
451
|
-
* @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).
|
|
452
|
-
* + After you start playing the audio file and mixing, you can call the [stopAudioMixing](#stopaudiomixing) method to stop playing the audio file.
|
|
453
|
-
* + 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.
|
|
454
|
-
* @region Advanced Feature
|
|
455
|
-
*/
|
|
456
|
-
startAudioMixing: (id: number, filePath: string, options: MixOption) => Promise<void>;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* @brief Stop playing audio files and mixes
|
|
460
|
-
* @param id ID of the mixing
|
|
461
|
-
* @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.
|
|
462
|
-
* + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
|
|
463
|
-
* @region Advanced Feature
|
|
464
|
-
*/
|
|
465
|
-
stopAudioMixing: (id: number) => void;
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* @brief Pause playing audio files and mixes
|
|
469
|
-
* @param id ID of the mixing
|
|
470
|
-
* @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.
|
|
471
|
-
* + After calling this method to pause playing audio files and mixing, you can call the [resumeAudioMixing](#resumeaudiomixing) method to resume playing and mixing.
|
|
472
|
-
* @region Advanced Feature
|
|
473
|
-
*/
|
|
474
|
-
pauseAudioMixing: (id: number) => void;
|
|
475
|
-
|
|
476
|
-
/**
|
|
477
|
-
* @brief Resume playing audio files and mixing
|
|
478
|
-
* @param id Mixing ID
|
|
479
|
-
* @notes After calling the [pauseAudioMixing](#pauseaudiomixing) method to pause playing audio files and mixing, you can resume playing and mixing by calling this method.
|
|
480
|
-
* @region Advanced Feature
|
|
481
|
-
*/
|
|
482
|
-
resumeAudioMixing: (id: number) => void;
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* @brief Preload the specified audio file into memory
|
|
486
|
-
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique.
|
|
487
|
-
* If this method is called repeatedly with the same ID, the latter overrides the previous.
|
|
488
|
-
* 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.
|
|
489
|
-
* 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.
|
|
490
|
-
* @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio.
|
|
491
|
-
* @return
|
|
492
|
-
* @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.
|
|
493
|
-
* + This method pre-loads the specified audio file, and only calling [startAudioMixing](#startaudiomixing) API can you start playing the specified audio file.
|
|
494
|
-
* + The specified audio file preloaded by calling this method can be unloaded through [unloadAudioMixing](#unloadaudiomixing).
|
|
495
|
-
* @region Advanced Feature
|
|
496
|
-
*/
|
|
497
|
-
preloadAudioMixing: (id: number, filePath: string) => Promise<void>;
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* @brief Uninstall the specified audio file
|
|
501
|
-
* @param id Mix ID
|
|
502
|
-
* @region Advanced Feature
|
|
503
|
-
*/
|
|
504
|
-
unloadAudioMixing: (id: number) => void;
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* @brief Adjust the volume of audio mixing, including audio files and PCM data.
|
|
508
|
-
* @param id Mixing ID
|
|
509
|
-
* @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`.
|
|
510
|
-
* + 0: Mute
|
|
511
|
-
* + 100: Original volume
|
|
512
|
-
* + 400: Maximum volume (with overflow protection)
|
|
513
|
-
* @region Advanced Feature
|
|
514
|
-
*/
|
|
515
|
-
setAudioMixingVolume: (id: number, volume: number) => void;
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* @brief Get volume of the audio files.
|
|
519
|
-
* @param id Audio mix id
|
|
520
|
-
* @return + `0`: Failure
|
|
521
|
-
* + `>0`: Successful. Volume
|
|
522
|
-
* @region Advanced Feature
|
|
523
|
-
*/
|
|
524
|
-
getAudioMixingVolume: (id: number) => number;
|
|
525
|
-
|
|
526
|
-
/**
|
|
527
|
-
* @brief Get audio file duration
|
|
528
|
-
* @param id Mix ID
|
|
529
|
-
* @return + `> 0`: Success, audio file duration, in milliseconds.
|
|
530
|
-
* + `< 0`: Failure
|
|
531
|
-
* @notes Before calling this method to obtain the length of the audio file, you need to call [preloadAudioMixing](#preloadaudiomixing) or [startAudioMixing](#startaudiomixing).
|
|
532
|
-
* @region Advanced Feature
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* @hidden
|
|
630
|
+
* @deprecated
|
|
631
|
+
* @brief Connection has not initiated.
|
|
533
632
|
*/
|
|
534
|
-
|
|
633
|
+
USER_MESSAGE_INIT = "USER_MESSAGE_INIT",
|
|
535
634
|
|
|
536
635
|
/**
|
|
537
|
-
* @
|
|
538
|
-
* @
|
|
539
|
-
* @
|
|
540
|
-
* + `< 0`: Failed
|
|
541
|
-
* @notes Before calling this method to get the audio file playback progress, you need to call [startAudioMixing](#startaudiomixing) to start playing the audio file.
|
|
542
|
-
* @region Advanced Feature
|
|
636
|
+
* @hidden
|
|
637
|
+
* @deprecated since 4.49, use USER_MESSAGE_UNKNOWN instead.
|
|
638
|
+
* @brief No available data connection
|
|
543
639
|
*/
|
|
544
|
-
|
|
640
|
+
USER_MESSAGE_NO_CONNECTION = "USER_MESSAGE_NO_CONNECTION",
|
|
545
641
|
|
|
546
642
|
/**
|
|
547
|
-
* @brief
|
|
548
|
-
* @param id Mixing ID
|
|
549
|
-
* @param position The starting playback position of the audio file in milliseconds.
|
|
550
|
-
* 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.
|
|
551
|
-
* @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.
|
|
552
|
-
* + 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.
|
|
553
|
-
* @region Advanced Feature
|
|
643
|
+
* @brief Sending a message before login to the IM server
|
|
554
644
|
*/
|
|
555
|
-
|
|
645
|
+
USER_MESSAGE_NOT_LOGIN = "USER_MESSAGE_NOT_LOGIN",
|
|
556
646
|
|
|
557
647
|
/**
|
|
558
|
-
* @brief
|
|
559
|
-
* To mix multiple PCM audio data, call this API multiple times with different ids.
|
|
560
|
-
* @param type Mixing type.
|
|
561
|
-
* Whether the PCM data is mixed locally and sent to the remotes.
|
|
562
|
-
* @notes + After this API, you must call [pushAudioMixingFrame](#pushaudiomixingframe) to start mixing.
|
|
563
|
-
* + To end PCM mixing, use [disableAudioMixingFrame](#disableaudiomixingframe).
|
|
564
|
-
* @region Advanced Feature
|
|
648
|
+
* @brief Lack of params of the IM server
|
|
565
649
|
*/
|
|
566
|
-
|
|
650
|
+
USER_MESSAGE_SERVER_PARAMS_NOTSET = "USER_MESSAGE_SERVER_PARAMS_NOTSET",
|
|
567
651
|
|
|
568
652
|
/**
|
|
569
|
-
* @brief
|
|
570
|
-
* @region Advanced Feature
|
|
653
|
+
* @brief Unknown error of messaging
|
|
571
654
|
*/
|
|
572
|
-
|
|
655
|
+
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN",
|
|
573
656
|
|
|
574
657
|
/**
|
|
575
|
-
* @brief
|
|
576
|
-
* @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
|
|
577
|
-
* @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingFrame](#enableaudiomixingframe).
|
|
578
|
-
* @region Advanced Feature
|
|
658
|
+
* @brief The user publishes a public stream before joining room.
|
|
579
659
|
*/
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* @brief Mix playback channel type
|
|
585
|
-
*/
|
|
586
|
-
export declare enum AudioMixingDualMonoMode {
|
|
660
|
+
START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN",
|
|
587
661
|
|
|
588
662
|
/**
|
|
589
|
-
* @brief
|
|
663
|
+
* @brief Reconnection with the server fails and SDK will no longer automatically retry.
|
|
664
|
+
* Please leave room first and join room again, or contact technical support.
|
|
590
665
|
*/
|
|
591
|
-
|
|
666
|
+
RECONNECT_FAILED = "RECONNECT_FAILED",
|
|
592
667
|
|
|
593
668
|
/**
|
|
594
|
-
* @brief
|
|
669
|
+
* @brief Subtitles are already on. There is no need to call [startSubtitle](104478#startsubtitle) again.
|
|
595
670
|
*/
|
|
596
|
-
|
|
671
|
+
SUBTITLE_ALREADY_ON = "SUBTITLE_ALREADY_ON",
|
|
597
672
|
|
|
598
673
|
/**
|
|
599
|
-
* @
|
|
674
|
+
* @hidden currently not available
|
|
675
|
+
* @brief The substitling task didn't start, or call an API to update subtitles without turning on subtitles.
|
|
600
676
|
*/
|
|
601
|
-
|
|
677
|
+
SUBTITLE_NOT_TURNED_ON = "SUBTITLE_NOT_TURNED_ON",
|
|
602
678
|
|
|
603
679
|
/**
|
|
604
|
-
* @brief
|
|
680
|
+
* @brief Errors occurred concerning cloud media processing. Please contact the technical support.
|
|
605
681
|
*/
|
|
606
|
-
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* @brief Mixing type
|
|
611
|
-
*/
|
|
612
|
-
export declare enum AudioMixingType {
|
|
682
|
+
SUBTITLE_ERR_POSTPROCESS = "SUBTITLE_ERR_POSTPROCESS",
|
|
613
683
|
|
|
614
684
|
/**
|
|
615
|
-
* @brief
|
|
685
|
+
* @brief Failed to connect to the thrid-party service. Please contact the technical support.
|
|
616
686
|
*/
|
|
617
|
-
|
|
687
|
+
SUBTITLE_ERR_CONNECTION_ERROR = "SUBTITLE_ERR_CONNECTION_ERROR",
|
|
618
688
|
|
|
619
689
|
/**
|
|
620
|
-
* @brief
|
|
690
|
+
* @brief Cloud media processing is timeout. Please contact the technical support.
|
|
621
691
|
*/
|
|
622
|
-
|
|
692
|
+
SUBTITLE_ERR_PROCESS_ERROR = "SUBTITLE_ERR_PROCESS_ERROR",
|
|
623
693
|
|
|
624
694
|
/**
|
|
625
|
-
* @brief
|
|
695
|
+
* @brief The client side failed to identity error codes sent by cloud media processing. Please contact the technical support.
|
|
626
696
|
*/
|
|
627
|
-
|
|
697
|
+
SUBTITLE_ERR_UNKNOWN = "SUBTITLE_ERR_UNKNOWN"
|
|
628
698
|
}
|
|
629
|
-
declare enum
|
|
630
|
-
|
|
631
|
-
AUDIO_MIXING_STATE_PRELOADED = 0,
|
|
632
|
-
|
|
633
|
-
AUDIO_MIXING_STATE_PLAYING = 1,
|
|
699
|
+
declare enum AudioMixingError {
|
|
634
700
|
|
|
635
|
-
|
|
701
|
+
/**
|
|
702
|
+
* @brief Normal
|
|
703
|
+
*/
|
|
704
|
+
AUDIO_MIXING_ERROR_OK = 0,
|
|
636
705
|
|
|
637
|
-
|
|
706
|
+
/**
|
|
707
|
+
* @brief Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
708
|
+
*/
|
|
709
|
+
AUDIO_MIXING_ERROR_PRELOAD_FAILED = 1,
|
|
638
710
|
|
|
639
|
-
|
|
711
|
+
/**
|
|
712
|
+
* @brief Audio mixing starts fails because of missing audio file or failure of reading the audio file.
|
|
713
|
+
*/
|
|
714
|
+
AUDIO_MIXING_ERROR_START_FAILED = 2,
|
|
640
715
|
|
|
641
|
-
|
|
716
|
+
/**
|
|
717
|
+
* @brief Invalid audio mixing ID
|
|
718
|
+
*/
|
|
719
|
+
AUDIO_MIXING_ERROR_ID_NOT_FOUND = 3,
|
|
642
720
|
|
|
643
|
-
|
|
721
|
+
/**
|
|
722
|
+
* @brief Invalid start position
|
|
723
|
+
*/
|
|
724
|
+
AUDIO_MIXING_ERROR_SET_POSITION_FAILED = 4,
|
|
644
725
|
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
* @brief Mixing configuration
|
|
650
|
-
*/
|
|
651
|
-
export interface MixOption {
|
|
726
|
+
/**
|
|
727
|
+
* @brief Invalid volume argument. The volume value ranges [0, 400].
|
|
728
|
+
*/
|
|
729
|
+
AUDIO_MIXING_ERROR_INVALID_VOLUME = 5,
|
|
652
730
|
|
|
653
731
|
/**
|
|
654
|
-
* @brief
|
|
655
|
-
* @notes + Play_count < = 0: Infinite loop
|
|
656
|
-
* + Play_count == 1: Play once (default)
|
|
657
|
-
* + Play_count > 1: Play play_count times
|
|
732
|
+
* @brief The audio file to be played does not match to the preload one. Call `unloadAudioMixing` to unload file and proceed.
|
|
658
733
|
*/
|
|
659
|
-
|
|
734
|
+
AUDIO_MIXING_ERROR_LOAD_CONFLICT = 6,
|
|
660
735
|
|
|
661
736
|
/**
|
|
662
|
-
* @brief
|
|
737
|
+
* @brief Type of the audio file to be played is not supported.
|
|
663
738
|
*/
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string | symbol> extends EventEmitter<EventTypes> {
|
|
667
|
-
safeEmit<T extends EventNames<EventTypes>>(event: T, ...args: EventArgs<EventTypes, T>): boolean;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* @brief Information and state of a media device.
|
|
672
|
-
*/
|
|
673
|
-
export interface DeviceInfo {
|
|
739
|
+
AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH = 7,
|
|
674
740
|
|
|
675
741
|
/**
|
|
676
|
-
* @brief
|
|
742
|
+
* @brief Invalid audio pitch
|
|
677
743
|
*/
|
|
678
|
-
|
|
744
|
+
AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH = 8,
|
|
679
745
|
|
|
680
746
|
/**
|
|
681
|
-
* @brief
|
|
747
|
+
* @brief Invalid audio track
|
|
682
748
|
*/
|
|
683
|
-
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* {zh}
|
|
687
|
-
* 音频编码参数细节
|
|
688
|
-
*/
|
|
689
|
-
export interface AudioCodecProfile {
|
|
690
|
-
chn: number;
|
|
691
|
-
sr: number;
|
|
692
|
-
}
|
|
693
|
-
export interface IEngineBAC {
|
|
694
|
-
codec?: {
|
|
695
|
-
enc_fs?: number;
|
|
696
|
-
};
|
|
697
|
-
adm?: {
|
|
698
|
-
play?: AudioCodecProfile;
|
|
699
|
-
record?: AudioCodecProfile;
|
|
700
|
-
};
|
|
701
|
-
agc?: any;
|
|
702
|
-
aec?: any;
|
|
703
|
-
ans?: any;
|
|
704
|
-
}
|
|
705
|
-
export interface IEngineANM {
|
|
706
|
-
enc_param?: {
|
|
707
|
-
bitrate: number;
|
|
708
|
-
chn: number;
|
|
709
|
-
sr: number;
|
|
710
|
-
};
|
|
711
|
-
}
|
|
712
|
-
export interface IAudioConfig {
|
|
713
|
-
bitrate?: number;
|
|
714
|
-
encChannel?: number;
|
|
715
|
-
channel?: number;
|
|
716
|
-
playChannel?: number;
|
|
717
|
-
sampleRate?: number;
|
|
718
|
-
encSampleRate?: number;
|
|
719
|
-
playbackRate?: number;
|
|
720
|
-
agc?: boolean;
|
|
721
|
-
aec?: boolean;
|
|
722
|
-
ans?: boolean;
|
|
749
|
+
AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK = 9
|
|
723
750
|
}
|
|
724
751
|
declare class AudioProfileManager {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
agc?: boolean;
|
|
732
|
-
ans?: boolean;
|
|
733
|
-
constructor();
|
|
734
|
-
private _init;
|
|
735
|
-
updateEngineBAC(newProfile?: IEngineBAC): void;
|
|
736
|
-
updateEngineANM(newProfile?: IEngineANM): void;
|
|
752
|
+
private _appId;
|
|
753
|
+
private _roomId?;
|
|
754
|
+
private _constraints;
|
|
755
|
+
private _profile?;
|
|
756
|
+
constructor(_appId: string);
|
|
757
|
+
setRoomId(roomId?: string): void;
|
|
737
758
|
setAudioProfile(profile: AudioProfileType): void;
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
getOpusConfigStr(): string;
|
|
743
|
-
get config(): IAudioConfig;
|
|
759
|
+
getOpusConfigStr(conf?: string): string;
|
|
760
|
+
updateConstraints(conf: MediaTrackConstraints): void;
|
|
761
|
+
getConstraints(): MediaTrackConstraints;
|
|
762
|
+
private _getConfigByAudioProfile;
|
|
744
763
|
}
|
|
745
764
|
/**
|
|
746
765
|
* @brief Cloud proxy informatio
|
|
@@ -763,12 +782,13 @@ export interface CloudProxyInfo {
|
|
|
763
782
|
configProxy: string;
|
|
764
783
|
}
|
|
765
784
|
export interface RTCContext {
|
|
785
|
+
id: string;
|
|
766
786
|
audioProfileManager?: AudioProfileManager;
|
|
767
787
|
serverConfig?: {
|
|
768
788
|
videoCodec?: string;
|
|
769
|
-
audioRed
|
|
770
|
-
muteReplaceUnsub
|
|
771
|
-
simulcastOnDemand
|
|
789
|
+
audioRed?: boolean;
|
|
790
|
+
muteReplaceUnsub?: boolean;
|
|
791
|
+
simulcastOnDemand?: boolean;
|
|
772
792
|
};
|
|
773
793
|
streamRTT?: {
|
|
774
794
|
[streamId: string]: {
|
|
@@ -776,11 +796,16 @@ export interface RTCContext {
|
|
|
776
796
|
video: number;
|
|
777
797
|
};
|
|
778
798
|
};
|
|
799
|
+
activeSimStreams?: boolean[];
|
|
779
800
|
subscribeFallbackOption?: SubscribeFallbackOption;
|
|
780
801
|
userPriority?: Map<string, RemoteUserPriority>;
|
|
781
802
|
avSync: boolean;
|
|
782
803
|
}
|
|
783
804
|
export declare type RTCExtension = any;
|
|
805
|
+
/**
|
|
806
|
+
* 设置到pc上的视频编码参数
|
|
807
|
+
*/
|
|
808
|
+
export declare type VideoEncoderConfig_PC = Pick<VideoEncoderConfig, "maxKbps">;
|
|
784
809
|
declare enum StreamMixingEventType {
|
|
785
810
|
|
|
786
811
|
/**
|
|
@@ -1160,7 +1185,9 @@ export interface LocalVideoStats {
|
|
|
1160
1185
|
encodedFrameCount: number;
|
|
1161
1186
|
|
|
1162
1187
|
/**
|
|
1163
|
-
* @brief
|
|
1188
|
+
* @brief Video codec.
|
|
1189
|
+
* "H264": H.264 video codec.
|
|
1190
|
+
* "VP8": VP8 video codec.
|
|
1164
1191
|
*/
|
|
1165
1192
|
codecType: string;
|
|
1166
1193
|
|
|
@@ -1611,6 +1638,8 @@ declare enum EngineEventsTypes {
|
|
|
1611
1638
|
onVideoStreamBanned = "onVideoStreamBanned",
|
|
1612
1639
|
onAudioStreamBanned = "onAudioStreamBanned",
|
|
1613
1640
|
onLocalVideoSizeChanged = "onLocalVideoSizeChanged",
|
|
1641
|
+
onSubtitleStateChanged = "onSubtitleStateChanged",
|
|
1642
|
+
onSubtitleMessageReceived = "onSubtitleMessageReceived",
|
|
1614
1643
|
onServerParamsSetResult = "onServerParamsSetResult"
|
|
1615
1644
|
}
|
|
1616
1645
|
|
|
@@ -1798,7 +1827,6 @@ export interface LocalAudioPropertiesInfo {
|
|
|
1798
1827
|
streamIndex: StreamIndex;
|
|
1799
1828
|
|
|
1800
1829
|
/**
|
|
1801
|
-
* @type keytype
|
|
1802
1830
|
* @brief Audio information
|
|
1803
1831
|
*/
|
|
1804
1832
|
audioPropertiesInfo: AudioPropertiesInfo;
|
|
@@ -1926,8 +1954,8 @@ declare enum StreamMixingEventErrorCode {
|
|
|
1926
1954
|
|
|
1927
1955
|
/**
|
|
1928
1956
|
* @id EngineEvents
|
|
1929
|
-
* @list
|
|
1930
|
-
* @detail
|
|
1957
|
+
* @list overview
|
|
1958
|
+
* @detail callback
|
|
1931
1959
|
*/
|
|
1932
1960
|
export interface IEngineEvents {
|
|
1933
1961
|
|
|
@@ -1961,7 +1989,7 @@ export interface IEngineEvents {
|
|
|
1961
1989
|
|
|
1962
1990
|
/**
|
|
1963
1991
|
* @brief Callback on new media streams captured by camera/microphone in the room.
|
|
1964
|
-
* @notes You will receive this callback after a remote user successfully publishes media streams captured by camera/microphone in the room with [publishStream](#publishstream). Then you can choose whether to call [subscribeStream](#
|
|
1992
|
+
* @notes You will receive this callback after a remote user successfully publishes media streams captured by camera/microphone in the room with [publishStream](104478#publishstream). Then you can choose whether to call [subscribeStream](104478#subscribestream) to subscribe to the streams or not.
|
|
1965
1993
|
*/
|
|
1966
1994
|
[EngineEventsTypes.onUserPublishStream]: (event: {
|
|
1967
1995
|
|
|
@@ -1978,7 +2006,7 @@ export interface IEngineEvents {
|
|
|
1978
2006
|
|
|
1979
2007
|
/**
|
|
1980
2008
|
* @brief Callback on removal of remote media stream captured by camera/microphone.
|
|
1981
|
-
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [
|
|
2009
|
+
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [unpublishStream](104478#unpublishstream). Then you can choose whether to call [unsubscribeStream](104478#unsubscribestream) to unsubscribe from the streams or not.
|
|
1982
2010
|
*/
|
|
1983
2011
|
[EngineEventsTypes.onUserUnpublishStream]: (event: {
|
|
1984
2012
|
|
|
@@ -2000,7 +2028,7 @@ export interface IEngineEvents {
|
|
|
2000
2028
|
|
|
2001
2029
|
/**
|
|
2002
2030
|
* @brief Callback on new screen sharing media streams from remote users in the room.
|
|
2003
|
-
* @notes You will receive this callback after a remote user successfully published screen sharing streams in the room with [publishScreen](#publishscreen). Then you can choose whether to call [subscribeScreen](#
|
|
2031
|
+
* @notes You will receive this callback after a remote user successfully published screen sharing streams in the room with [publishScreen](104478#publishscreen). Then you can choose whether to call [subscribeScreen](104478#subscribescreen) to subscribe to the streams or not.
|
|
2004
2032
|
*/
|
|
2005
2033
|
[EngineEventsTypes.onUserPublishScreen]: (event: {
|
|
2006
2034
|
|
|
@@ -2017,7 +2045,7 @@ export interface IEngineEvents {
|
|
|
2017
2045
|
|
|
2018
2046
|
/**
|
|
2019
2047
|
* @brief Callback on removal of screen sharing media streams from remote users in the room.
|
|
2020
|
-
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [
|
|
2048
|
+
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [unpublishScreen](104478#unpublishscreen). Then you can choose whether to call [unsubscribeScreen](104478#unsubscribescreen) to unsubscribe from the streams or not.
|
|
2021
2049
|
*/
|
|
2022
2050
|
[EngineEventsTypes.onUserUnpublishScreen]: (event: {
|
|
2023
2051
|
|
|
@@ -2152,7 +2180,7 @@ export interface IEngineEvents {
|
|
|
2152
2180
|
}) => void;
|
|
2153
2181
|
|
|
2154
2182
|
/**
|
|
2155
|
-
* @brief Receiving a point-to-point text message from one of the users in the room by calling [sendUserMessage](104478#
|
|
2183
|
+
* @brief Receiving a point-to-point text message from one of the users in the room by calling [sendUserMessage](104478#sendusermessage)
|
|
2156
2184
|
* @param event
|
|
2157
2185
|
* @region Message Event
|
|
2158
2186
|
*/
|
|
@@ -2203,7 +2231,7 @@ export interface IEngineEvents {
|
|
|
2203
2231
|
}) => void;
|
|
2204
2232
|
|
|
2205
2233
|
/**
|
|
2206
|
-
* @brief After calling [enableAudioPropertiesReport](104478#
|
|
2234
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information about local audio.
|
|
2207
2235
|
* Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms.
|
|
2208
2236
|
* @param event Information about local audio.
|
|
2209
2237
|
* @region Audio Managment
|
|
@@ -2211,7 +2239,7 @@ export interface IEngineEvents {
|
|
|
2211
2239
|
[EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
|
|
2212
2240
|
|
|
2213
2241
|
/**
|
|
2214
|
-
* @brief After calling [enableAudioPropertiesReport](104478#
|
|
2242
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information about the subscribed remote audio streams.
|
|
2215
2243
|
* The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism.
|
|
2216
2244
|
* @param event Information about remote audio.
|
|
2217
2245
|
* @region Audio Management
|
|
@@ -2232,7 +2260,7 @@ export interface IEngineEvents {
|
|
|
2232
2260
|
[EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: MediaDeviceInfo) => void;
|
|
2233
2261
|
|
|
2234
2262
|
/**
|
|
2235
|
-
* @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#
|
|
2263
|
+
* @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).
|
|
2236
2264
|
* @param event
|
|
2237
2265
|
* @region Audio Management Event
|
|
2238
2266
|
*/
|
|
@@ -2245,7 +2273,7 @@ export interface IEngineEvents {
|
|
|
2245
2273
|
}) => void;
|
|
2246
2274
|
|
|
2247
2275
|
/**
|
|
2248
|
-
* @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#
|
|
2276
|
+
* @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).
|
|
2249
2277
|
* @param event
|
|
2250
2278
|
* @region Room Management Event
|
|
2251
2279
|
*/
|
|
@@ -2258,7 +2286,7 @@ export interface IEngineEvents {
|
|
|
2258
2286
|
}) => void;
|
|
2259
2287
|
|
|
2260
2288
|
/**
|
|
2261
|
-
* @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#
|
|
2289
|
+
* @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).
|
|
2262
2290
|
* @param event
|
|
2263
2291
|
* @region Room Management Event
|
|
2264
2292
|
*/
|
|
@@ -2271,7 +2299,7 @@ export interface IEngineEvents {
|
|
|
2271
2299
|
}) => void;
|
|
2272
2300
|
|
|
2273
2301
|
/**
|
|
2274
|
-
The remote clients in the room will be informed of the state change via this event after the publisher stops video capture by calling [stopVideoCapture](104478#
|
|
2302
|
+
The remote clients in the room will be informed of the state change via this event after the publisher stops video capture by calling [stopVideoCapture](104478#stopvideocapture).
|
|
2275
2303
|
* @param event
|
|
2276
2304
|
* @region Room Management Event
|
|
2277
2305
|
*/
|
|
@@ -2388,7 +2416,7 @@ export interface IEngineEvents {
|
|
|
2388
2416
|
[EngineEventsTypes.onTokenWillExpire]: () => void;
|
|
2389
2417
|
|
|
2390
2418
|
/**
|
|
2391
|
-
* @brief Receives the callback when you call [startCloudProxy](104478#
|
|
2419
|
+
* @brief Receives the callback when you call [startCloudProxy](104478#startcloudproxy) to start cloud proxy, and the SDK connects the proxy server successfully.
|
|
2392
2420
|
* @param event
|
|
2393
2421
|
*/
|
|
2394
2422
|
[EngineEventsTypes.onCloudProxyConnected]: (event: CloudProxyConnectedEvent) => void;
|
|
@@ -2538,19 +2566,36 @@ export interface IEngineEvents {
|
|
|
2538
2566
|
};
|
|
2539
2567
|
}) => void;
|
|
2540
2568
|
|
|
2569
|
+
/**
|
|
2570
|
+
* @hidden currently not available
|
|
2571
|
+
* @brief Callback on subtitle states.
|
|
2572
|
+
* After you call [startSubtitle](104478#startsubtitle) and [stopSubtitle](104478#stopsubtitle), you will receive this callback which informs you of the states and error codes of the subtitling task, as well as detailed information on the third party services' errors.
|
|
2573
|
+
* @param event
|
|
2574
|
+
*/
|
|
2575
|
+
[EngineEventsTypes.onSubtitleStateChanged]: (e: SubtitleEvent) => void;
|
|
2576
|
+
|
|
2577
|
+
/**
|
|
2578
|
+
* @hidden currently not available
|
|
2579
|
+
* @brief Callback on subtitle messages.
|
|
2580
|
+
* After calling [startSubtitle](104478#startsubtitle) successfully, you will receive this callback which informs you of the related information on subtitles.
|
|
2581
|
+
* @param event
|
|
2582
|
+
*/
|
|
2583
|
+
[EngineEventsTypes.onSubtitleMessageReceived]: (e: SubtitleMessage[]) => void;
|
|
2584
|
+
|
|
2541
2585
|
/**
|
|
2542
2586
|
* @brief Event of whether the setting for the message server successes
|
|
2543
2587
|
* @param error Error code
|
|
2544
|
-
* @notes + This event notifies you the result after the call of [setServerParams](104478#
|
|
2545
|
-
* + If the client losts connection after the call of [setServerParams](104478#
|
|
2588
|
+
* @notes + This event notifies you the result after the call of [setServerParams](104478#setserverparams).
|
|
2589
|
+
* + If the client losts connection after the call of [setServerParams](104478#setserverparams) this event notifies once the client reconnects.
|
|
2546
2590
|
*/
|
|
2547
2591
|
[EngineEventsTypes.onServerParamsSetResult]: (error?: ErrorCode) => void;
|
|
2548
2592
|
}
|
|
2549
2593
|
|
|
2550
2594
|
/**
|
|
2551
2595
|
* @id RTCEngine
|
|
2552
|
-
*
|
|
2553
|
-
* @
|
|
2596
|
+
* <span id="irtcengine"></span>
|
|
2597
|
+
* @list overview
|
|
2598
|
+
* @detail api
|
|
2554
2599
|
*/
|
|
2555
2600
|
export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
2556
2601
|
|
|
@@ -2558,7 +2603,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2558
2603
|
* @brief Join the room.
|
|
2559
2604
|
* Call this method to join the room and make audio & video calls with other users in the room.
|
|
2560
2605
|
* @param token Dynamic key. It is used for authentication and verification of users entering the room.
|
|
2561
|
-
* 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.
|
|
2606
|
+
* 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. See [Use Token to complete authentication](70121) for token validity and generation method.
|
|
2562
2607
|
* Apps with different AppIDs are not interoperable.
|
|
2563
2608
|
* Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail.
|
|
2564
2609
|
* @param roomId The ID of the room to be added.
|
|
@@ -2572,10 +2617,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2572
2617
|
* @return
|
|
2573
2618
|
* @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`.
|
|
2574
2619
|
* + 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.
|
|
2575
|
-
* + 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.
|
|
2620
|
+
* + RTC SDK will try reconnect after losing connection to the server caused by a poor network connection. At this point, [onConnectionStateChanged](104479#onConnectionStateChanged) callback will be triggered and the SDK will automatically retry until it successfully reconnects to the server. The remote user will receive [onUserJoined](104479#onuserjoined) if a visible user reconnected successfully.
|
|
2576
2621
|
* @region Room Management
|
|
2577
2622
|
*/
|
|
2578
2623
|
joinRoom: (token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig) => Promise<void>;
|
|
2624
|
+
setConnectionMode: (mode: ConnectionMode) => void;
|
|
2579
2625
|
|
|
2580
2626
|
/**
|
|
2581
2627
|
* @brief Leave the room.
|
|
@@ -2589,7 +2635,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2589
2635
|
/**
|
|
2590
2636
|
* @hidden
|
|
2591
2637
|
* @brief Destroy engine
|
|
2592
|
-
* Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources.
|
|
2638
|
+
* Destroy the engine instances created by calling [createEngine](104478#createengine) and release all related resources.
|
|
2593
2639
|
* @notes + Make sure that the business scenarios related to the `RTCEngine` instances that need to be destroyed are all finished before calling this API.
|
|
2594
2640
|
* + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server.
|
|
2595
2641
|
* + 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.
|
|
@@ -2600,8 +2646,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2600
2646
|
/**
|
|
2601
2647
|
* @brief Publishes media streams captured by camera/microphone in the current room.
|
|
2602
2648
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
2603
|
-
* @notes +
|
|
2604
|
-
* + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2649
|
+
* @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2605
2650
|
* + Call [publishScreen](#publishscreen) to start screen sharing.
|
|
2606
2651
|
* + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream).
|
|
2607
2652
|
* + Call [unpublishStream](#unpublishstream) to stop publishing streams.
|
|
@@ -2707,15 +2752,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2707
2752
|
|
|
2708
2753
|
/**
|
|
2709
2754
|
* @brief Enable internal video capture. The default state is off.
|
|
2710
|
-
*
|
|
2711
|
-
*
|
|
2755
|
+
* Internal video capture refers to: capturing video using the built-in module.
|
|
2756
|
+
* 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.
|
|
2712
2757
|
* @param deviceId ID of the capture device which you need to pass in to avoid exceptions such as no screen or a screen that is not the desired one. You can call [enumerateDevices](#enumeratedevices) to obtain the list of devices.
|
|
2713
2758
|
* @return The actual effective video capture parameters. See [MediaTrackSettings](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). Pay attention to the properties: `frameRate`, `height`, and `width`.
|
|
2714
|
-
* The `frameRate`, `height`, `width` set in [setVideoEncoderConfig](104478#setvideoencoderconfig) for the max stream must match this return value accordingly.
|
|
2715
2759
|
* @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
|
|
2716
|
-
*
|
|
2717
|
-
*
|
|
2718
|
-
* @region Video Management
|
|
2760
|
+
* + 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.
|
|
2761
|
+
* + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
|
|
2719
2762
|
*/
|
|
2720
2763
|
startVideoCapture: (deviceId?: string) => Promise<MediaTrackSettings>;
|
|
2721
2764
|
|
|
@@ -2757,8 +2800,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2757
2800
|
* @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
|
|
2758
2801
|
* @param screenConfig Specify properties for the sharing screen.
|
|
2759
2802
|
* @return
|
|
2760
|
-
* @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](#
|
|
2761
|
-
* + To turn off screen video source capture, call [
|
|
2803
|
+
* @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).
|
|
2804
|
+
* + To turn off screen video source capture, call [stopScreenCapture](#stopscreencapture).
|
|
2762
2805
|
* + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
|
|
2763
2806
|
* @region Advanced Feature
|
|
2764
2807
|
*/
|
|
@@ -2767,7 +2810,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2767
2810
|
/**
|
|
2768
2811
|
* @brief Stop screen sharing.
|
|
2769
2812
|
* @return
|
|
2770
|
-
* @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.
|
|
2771
2813
|
* @region Advanced Feature
|
|
2772
2814
|
*/
|
|
2773
2815
|
stopScreenCapture: () => Promise<void>;
|
|
@@ -2785,7 +2827,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2785
2827
|
|
|
2786
2828
|
/**
|
|
2787
2829
|
* @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
|
|
2788
|
-
* It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream) is triggered.
|
|
2830
|
+
* It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream)/[onUserPublishScreen](104479#onuserpublishscreen) is triggered.
|
|
2789
2831
|
* Call this API again with a blank view to unbind the view from the remote video stream.
|
|
2790
2832
|
* @param streamIndex Video stream properties
|
|
2791
2833
|
* @param videoPlayer View information and rendering mode
|
|
@@ -2812,7 +2854,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2812
2854
|
|
|
2813
2855
|
/**
|
|
2814
2856
|
* @brief Play audio and video stream manually.
|
|
2815
|
-
* Call this API when user need to take part in the audio and video reaction after calling [createEngine](#createengine) and set to autoPlay to False.
|
|
2857
|
+
* Call this API when user need to take part in the audio and video reaction after calling [createEngine](104478#createengine) and set to autoPlay to False.
|
|
2816
2858
|
* @param userId ID of the user whose stream is intended to play
|
|
2817
2859
|
* Call this API without a parameter to start playing the local medias.
|
|
2818
2860
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
@@ -2830,7 +2872,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2830
2872
|
* @return
|
|
2831
2873
|
* @notes + Calling this API does not change the capture state and the transmission state of the remote clients.
|
|
2832
2874
|
* + Calling this API does not cancel the subscription or change any subscription configuration.
|
|
2833
|
-
* + To resume, call [resumeAllSubscribedStream](#
|
|
2875
|
+
* + To resume, call [resumeAllSubscribedStream](#resumeallsubscribedstream).
|
|
2834
2876
|
* @region Media Stream Transmission
|
|
2835
2877
|
*/
|
|
2836
2878
|
pauseAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
|
|
@@ -2904,29 +2946,28 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2904
2946
|
* You can set parameters for up to 3 streams, SDK will always take the value of the first 3 streams when parameters for more streams are set.
|
|
2905
2947
|
* The resolutions and the frame rates must be in descending order.
|
|
2906
2948
|
* When the resolution of the max stream is in [540P, 1080P], you can simulcast 3 streams; when in [270P, 450P], you can simulcast 2 streams; when in [0, 180P], you can not enable simulcast.
|
|
2907
|
-
* @notes + The
|
|
2908
|
-
* +
|
|
2909
|
-
* +
|
|
2949
|
+
* @notes + The default parameters are 640 × 480 px, 15 FPS, with 600 Kbps max bitrate.
|
|
2950
|
+
* + You can call this API before and after publishing video streams. After the video stream is published, you cannot switch from single stream to multi-stream, or modify the number of published multi-stream layers.
|
|
2951
|
+
* + When simulcasting, it is recommended to cancel automatic publishing and publish audio/video streams manually by calling [publishStream](#publishstream), otherwise simulcast will not take effect.
|
|
2952
|
+
* + If the set parameters are not supported by the browser, RTC SDK will capture and encode according to the range of parameters supported by the browser, and report the actual parameters of the capture by [onLocalVideoSizeChanged](104479#onlocalvideosizechanged).
|
|
2953
|
+
* + You need to call [enableSimulcastMode](#enablesimulcastmode) to start simulcasting. If you set the parameters for multiple streams without calling [enableSimulcastMode](#enablesimulcastmode), only the stream with the largest resolution will be published, and the setting will take effect after simulcasting is enabled. If simulcasting is enabled, but only one stream's parameters are set, RTC SDK will automatically fill 1~2 groups of smaller stream parameters.
|
|
2910
2954
|
* + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
|
|
2911
|
-
* @region Video Management
|
|
2912
2955
|
*/
|
|
2913
2956
|
setVideoEncoderConfig: (descriptions: VideoEncoderConfig | VideoEncoderConfig[]) => Promise<void>;
|
|
2914
2957
|
|
|
2915
2958
|
/**
|
|
2916
|
-
* @type api
|
|
2917
|
-
* @author changzhenan
|
|
2918
|
-
* @region Video Management
|
|
2919
2959
|
* @brief Set the encoding configuration of the screen-sharing stream,which is also applied in video capture.
|
|
2920
2960
|
* If the configuration is not supported by your browser, the video will be captured based on the supported configuration. You will also receive the callback [onLocalVideoSizeChanged](104479#onlocalvideosizechanged).
|
|
2921
|
-
* @param
|
|
2922
|
-
* @notes +
|
|
2961
|
+
* @param description The encoding configuration of the screen-sharing stream.
|
|
2962
|
+
* @notes + The default parameters are 1920 × 1080 px, 15 FPS, with 3000 Kbps max bitrate.
|
|
2963
|
+
* + We recommend that you set the encoding configuration before video capture. Otherwise, the video will be captured based on the default configuration.
|
|
2923
2964
|
*/
|
|
2924
2965
|
setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
|
|
2925
2966
|
|
|
2926
2967
|
/**
|
|
2927
2968
|
* @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
|
|
2928
|
-
* @param userId
|
|
2929
|
-
* @param remoteVideoConfig
|
|
2969
|
+
* @param userId ID of the remote video stream publisher you expect to configure subscription parameters for.
|
|
2970
|
+
* @param remoteVideoConfig The parameters you expect to configure for the remote video stream.
|
|
2930
2971
|
* @notes + This API only works after the publisher calls [enableSimulcastMode](#enablesimulcastmode) to enable publishing multiple video streams, in which case the subscriber will receive a stream that is closest to the set configuration.
|
|
2931
2972
|
* + If you don't call this API after the publisher enables the function of publishing multiple streams, you will receive by default the video stream with the largest resolution set by the publisher.
|
|
2932
2973
|
* + You should call this API in the room. If you want to call it before entering the room, you should set the `remoteVideoConfig` in the roomConfig` when calling [joinRoom](#joinroom).
|
|
@@ -2939,7 +2980,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2939
2980
|
* @brief Enables the simulcast mode of the video stream captured by the camera at the publishing end.imulcasting, including resolution, frame rate, bitrate, scale mode, fallback strategy under poor network conditions.
|
|
2940
2981
|
* @param enabled
|
|
2941
2982
|
* @param + You must call this API before publishing the video streams.
|
|
2942
|
-
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#
|
|
2983
|
+
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setvideoencoderconfig).
|
|
2943
2984
|
*/
|
|
2944
2985
|
enableSimulcastMode: (enabled: boolean) => boolean;
|
|
2945
2986
|
|
|
@@ -2961,8 +3002,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2961
3002
|
* @brief Enable audio information prompts.
|
|
2962
3003
|
* @param config Audio information prompts-related configurations.
|
|
2963
3004
|
* @notes With the prompt on, you can:
|
|
2964
|
-
* + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#
|
|
2965
|
-
* + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#
|
|
3005
|
+
* + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#onlocalaudiopropertiesreport).
|
|
3006
|
+
* + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onremoteaudiopropertiesreport).
|
|
2966
3007
|
* @region Audio Management
|
|
2967
3008
|
*/
|
|
2968
3009
|
enableAudioPropertiesReport: (config?: AudioPropertiesConfig) => void;
|
|
@@ -2979,7 +3020,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2979
3020
|
|
|
2980
3021
|
/**
|
|
2981
3022
|
* @brief Update configuration needed when pushing media streams to CDN.
|
|
2982
|
-
* After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
|
|
3023
|
+
* After calling [startLiveTranscoding](104478#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
|
|
2983
3024
|
* @param transcode Updated configurations. Some of the configurations cannot be updated. See [LiveTranscodeConfig](104481#livetranscodeconfig) for specific indications.
|
|
2984
3025
|
* @return
|
|
2985
3026
|
*/
|
|
@@ -2987,7 +3028,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2987
3028
|
|
|
2988
3029
|
/**
|
|
2989
3030
|
* @brief Stop pushing media streams to CDN
|
|
2990
|
-
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](#startlivetranscoding).
|
|
3031
|
+
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](104478#startlivetranscoding).
|
|
2991
3032
|
* @return
|
|
2992
3033
|
* @region Advanced Feature
|
|
2993
3034
|
*/
|
|
@@ -3004,7 +3045,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3004
3045
|
setBusinessId: (businessId: string) => boolean;
|
|
3005
3046
|
|
|
3006
3047
|
/**
|
|
3007
|
-
* @brief Set user visibility.
|
|
3048
|
+
* @brief Set user visibility. The local user is visible to others by default before calling this API.
|
|
3008
3049
|
* @param enable Visibility of the user in the room:
|
|
3009
3050
|
* + `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.
|
|
3010
3051
|
* + `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.
|
|
@@ -3019,7 +3060,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3019
3060
|
|
|
3020
3061
|
/**
|
|
3021
3062
|
* @brief Set a custom videoTrack as the video source.
|
|
3022
|
-
* Before calling this API, you must call [setVideoSourceType](#setvideosourcetype) to enable custom video capture.
|
|
3063
|
+
* Before calling this API, you must call [setVideoSourceType](104478#setvideosourcetype) to enable custom video capture.
|
|
3023
3064
|
* @param index specify a stream index.
|
|
3024
3065
|
* @param track specify a video track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
3025
3066
|
* @return
|
|
@@ -3029,7 +3070,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3029
3070
|
|
|
3030
3071
|
/**
|
|
3031
3072
|
* @brief Set a custom audioTrack as the audio source.
|
|
3032
|
-
* Before calling this API, you must call [setAudioSourceType](#setaudiosourcetype) to enable custom video capture.
|
|
3073
|
+
* Before calling this API, you must call [setAudioSourceType](104478#setaudiosourcetype) to enable custom video capture.
|
|
3033
3074
|
* @param index specify a stream index.
|
|
3034
3075
|
* @param track specify an audio track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
3035
3076
|
* @return
|
|
@@ -3053,7 +3094,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3053
3094
|
* @param index audio stream index
|
|
3054
3095
|
* @param audioSourceType Type of the module for video capture
|
|
3055
3096
|
* @return
|
|
3056
|
-
* @region Audio Management
|
|
3057
3097
|
*/
|
|
3058
3098
|
setAudioSourceType: (index: StreamIndex, audioSourceType: AudioSourceType) => Promise<void>;
|
|
3059
3099
|
|
|
@@ -3068,16 +3108,19 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3068
3108
|
* @brief Configure the internal audio capture. Different browser has its own default settings.
|
|
3069
3109
|
* @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.
|
|
3070
3110
|
* @return
|
|
3071
|
-
* @
|
|
3111
|
+
* @notes You should call this API before starting audio capture and publishing streams.
|
|
3072
3112
|
*/
|
|
3073
3113
|
setAudioCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
|
|
3074
3114
|
|
|
3075
3115
|
/**
|
|
3116
|
+
* @hidden
|
|
3117
|
+
* @deprecated since v4.51, use setVideoEncoderConfig instead.
|
|
3076
3118
|
* @brief Configure the internal video capture. Different browser has its own default settings.
|
|
3077
3119
|
* @param config Configuration for internal video capture. See [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints).
|
|
3078
3120
|
* The input `frameRate`, `height`, `width` are only desired values. The true resolution and framerate of the internal capture are the return values of [startVideoCapture](104478#startvideocapture).
|
|
3079
3121
|
* @return
|
|
3080
|
-
* @note You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
|
|
3122
|
+
* @note + You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
|
|
3123
|
+
* + Since v4.51, the scaling ratio of capturing resolution to encoding resolution is fixed to 1. When the capturing resolution is modified, the actual sending resolution will be changed at the same time.
|
|
3081
3124
|
*/
|
|
3082
3125
|
setVideoCaptureConfig: (config: TrackCaptureConfig) => Promise<MediaTrackSettings>;
|
|
3083
3126
|
|
|
@@ -3090,7 +3133,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3090
3133
|
* @param userInfo User information.
|
|
3091
3134
|
* @return
|
|
3092
3135
|
* @notes
|
|
3093
|
-
* + Call [logout](
|
|
3136
|
+
* + Call [logout](#logout) to log out the IM server.
|
|
3094
3137
|
* + 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`.
|
|
3095
3138
|
* @region Room Management
|
|
3096
3139
|
*/
|
|
@@ -3115,7 +3158,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3115
3158
|
* @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.
|
|
3116
3159
|
* @param userId ID of the user whose status intended to know
|
|
3117
3160
|
* @return
|
|
3118
|
-
* @notes Call [login](
|
|
3161
|
+
* @notes Call [login](#login) before calling this API.
|
|
3119
3162
|
*/
|
|
3120
3163
|
getPeerOnlineStatus: (userId: string) => Promise<USER_ONLINE_STATUS>;
|
|
3121
3164
|
|
|
@@ -3124,8 +3167,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3124
3167
|
* @param userId ID of the recipient
|
|
3125
3168
|
* @param message Text message within 64 KB.
|
|
3126
3169
|
* @return
|
|
3127
|
-
* @notes + Call [login](
|
|
3128
|
-
* + The recipient must be logged into the server and will receive the text message via [
|
|
3170
|
+
* @notes + Call [login](#login) before calling this API.
|
|
3171
|
+
* + The recipient must be logged into the server and will receive the text message via [onUserMessageReceivedOutsideRoom](104479#onusermessagereceivedoutsideroom) if the message has been sent successfully.
|
|
3129
3172
|
*/
|
|
3130
3173
|
sendUserMessageOutsideRoom: (userId: string, message: string) => Promise<any>;
|
|
3131
3174
|
|
|
@@ -3140,7 +3183,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3140
3183
|
sendUserBinaryMessageOutsideRoom: (userId: string, message: ArrayBuffer) => Promise<any>;
|
|
3141
3184
|
|
|
3142
3185
|
/**
|
|
3143
|
-
* @brief Set the params of the server before calling [sendServerMessage](#
|
|
3186
|
+
* @brief Set the params of the server before calling [sendServerMessage](104478#sendservermessage) or [sendServerBinaryMessage](104478#sendserverbinarymessage) to send messages to the server.
|
|
3144
3187
|
* @param signature Dynamic signature.
|
|
3145
3188
|
* @param url Address of the IM server
|
|
3146
3189
|
* @return
|
|
@@ -3200,7 +3243,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3200
3243
|
/**
|
|
3201
3244
|
* @hidden
|
|
3202
3245
|
* @brief Update the properties of the public stream published by the current user.
|
|
3203
|
-
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
3246
|
+
* Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
|
|
3204
3247
|
* @param publicStreamId The public stream's ID.
|
|
3205
3248
|
* The public stream must be published by the current user.
|
|
3206
3249
|
* @param publicStreamParam The public stream's parameters.
|
|
@@ -3212,7 +3255,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3212
3255
|
* @hidden
|
|
3213
3256
|
* @type api
|
|
3214
3257
|
* @brief Stops publishing the public stream.
|
|
3215
|
-
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
3258
|
+
* Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
|
|
3216
3259
|
* @param publicStreamId The public stream's ID.
|
|
3217
3260
|
* The public stream must be published by the current user.
|
|
3218
3261
|
* @return
|
|
@@ -3228,6 +3271,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3228
3271
|
* @return
|
|
3229
3272
|
* @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.
|
|
3230
3273
|
* + After calling this API, you will receive [onFirstPublicStreamVideoFrameDecoded](104479#onfirstpublicstreamvideoframedecoded) and [onFirstPublicStreamAudioFrameDecoded](104479#onfirstpublicstreamaudioframedecoded) once the first frame has been decoded.
|
|
3274
|
+
* + If the public stream contains SEI message, you will receive the message by be informed through [onPublicStreamSEIMessageReceived](104479#onpublicstreamseimessagereceived).
|
|
3231
3275
|
* + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
|
|
3232
3276
|
*/
|
|
3233
3277
|
startPlayPublicStream: (publicStreamId: string) => Promise<void>;
|
|
@@ -3235,7 +3279,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3235
3279
|
/**
|
|
3236
3280
|
* @hidden
|
|
3237
3281
|
* @brief Unsubscribes from a designated public stream.
|
|
3238
|
-
* Call [startPlayPublicStream](#startplaypublicstream) to subscribe to the public stream.
|
|
3282
|
+
* Call [startPlayPublicStream](104478#startplaypublicstream) to subscribe to the public stream.
|
|
3239
3283
|
* @param publicStreamId The public stream's ID.
|
|
3240
3284
|
* @return
|
|
3241
3285
|
*/
|
|
@@ -3282,7 +3326,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3282
3326
|
|
|
3283
3327
|
/**
|
|
3284
3328
|
* @brief Set the priority of the remote user's media stream.
|
|
3285
|
-
* Use this API with [setSubscribeFallbackOption](#setsubscribefallbackoption).
|
|
3329
|
+
* Use this API with [setSubscribeFallbackOption](104478#setsubscribefallbackoption).
|
|
3286
3330
|
* With video stream fallback enabled and user priority specified, the stream quality of higher priority user is the last to be compromised.
|
|
3287
3331
|
* @param userId The ID of the remote user
|
|
3288
3332
|
* @param priority The priority of the remote user's media stream
|
|
@@ -3309,12 +3353,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3309
3353
|
|
|
3310
3354
|
/**
|
|
3311
3355
|
* @brief Start the capture and playback test for local audio devices.
|
|
3312
|
-
* We recommend to register [onLocalAudioPropertiesReport](104479#onlocalaudiopropertiesreport) callback via [enableAudioPropertiesReport](enableaudiopropertiesreport). Once the test starts, you can get the volume of the capturing audio by this callback.
|
|
3356
|
+
* We recommend to register [onLocalAudioPropertiesReport](104479#onlocalaudiopropertiesreport) callback via [enableAudioPropertiesReport](104478#enableaudiopropertiesreport). Once the test starts, you can get the volume of the capturing audio by this callback.
|
|
3313
3357
|
* @param indicationInterval The time interval between each callback of [onAudioPlaybackDeviceTestVolume](104479#onaudioplaybackdevicetestvolume) via which you get informed of the playback volume during the test. We recommend setting it to 200 ms. The minimal value is 100 ms.
|
|
3314
3358
|
* @param onAutoplayFailed Autoplay fails due to the limitation of the browser. We recommend to execute `resume` as soon as the user clicks on the UI element.
|
|
3315
3359
|
* @return Resolve when the test ends.
|
|
3316
3360
|
* @notes + You can call this API whether the user is in a room.
|
|
3317
|
-
* + The audio capturing will stop and begins to play the recording in 30 s after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#
|
|
3361
|
+
* + The audio capturing will stop and begins to play the recording in 30 s after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#stopaudiodevicerecordandplaytest) to stop capturing and start playing the recording.
|
|
3318
3362
|
* + You must stop the test before starting another test for audio devices.
|
|
3319
3363
|
* + Call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording.
|
|
3320
3364
|
* + This test performs locally and does not involve network connection testing.
|
|
@@ -3323,12 +3367,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3323
3367
|
|
|
3324
3368
|
/**
|
|
3325
3369
|
* @brief Call this API to stop recording in the test and start to play the recording.
|
|
3326
|
-
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
|
|
3370
|
+
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](104478#stopaudiodeviceplaytest) to stop playing.
|
|
3327
3371
|
*/
|
|
3328
3372
|
stopAudioDeviceRecordAndPlayTest: () => void;
|
|
3329
3373
|
|
|
3330
3374
|
/**
|
|
3331
|
-
* @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](#startaudiodevicerecordtest).
|
|
3375
|
+
* @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](104478#startaudiodevicerecordtest).
|
|
3332
3376
|
* Before the test ends by itself, you can call this API to stop the recording or playing.
|
|
3333
3377
|
*/
|
|
3334
3378
|
stopAudioDevicePlayTest: () => void;
|
|
@@ -3336,9 +3380,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3336
3380
|
/**
|
|
3337
3381
|
* @brief Set the sound quality.
|
|
3338
3382
|
* @param profile A sound quality option consists of a set of audio profiles and applying each brings a different listening experience. Choose the appropriate audio quality to meet the requirement of the scenario.
|
|
3339
|
-
* @notes
|
|
3383
|
+
* @notes You should call this API before starting audio capture and publishing streams.
|
|
3384
|
+
* @return
|
|
3340
3385
|
*/
|
|
3341
|
-
setAudioProfile: (profile: AudioProfileType) => void
|
|
3386
|
+
setAudioProfile: (profile: AudioProfileType) => Promise<void>;
|
|
3342
3387
|
|
|
3343
3388
|
/**
|
|
3344
3389
|
* @brief Get the [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) of the local audios or videos.
|
|
@@ -3364,11 +3409,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3364
3409
|
* @param type Video or audio
|
|
3365
3410
|
* @return `undefined` for the MediaStreamTrack does not exist. For example, the local user has not subscribed to the remote stream.
|
|
3366
3411
|
* @notes + Call this API after the local user subscribe to the remote media stream.
|
|
3367
|
-
* + Callback of the MediaStreamTrack will inform you by the event of `ended` that the remote media stream stops, probably caused by the API call of [
|
|
3412
|
+
* + Callback of the MediaStreamTrack will inform you by the event of `ended` that the remote media stream stops, probably caused by the API call of [unsubscribeStream](#unsubscribestream) or [unsubscribeScreen](#unsubscribescreen).
|
|
3368
3413
|
* + You can get video resolution and audio volume from the MediaStreamTrack. You can manage the track actions by the method of `stop` or `mute`. You can also change the properties of the stream, such as audio volume.
|
|
3369
3414
|
* + We recommend to call RTC APIs to enable your app with the following capabilities instead of using mediaStreamTrack.
|
|
3370
|
-
* 1. Get the video resolution or audio volume of the remote streams: [
|
|
3371
|
-
* 2. stop: [
|
|
3415
|
+
* 1. Get the video resolution or audio volume of the remote streams: [onRemoteStreamStats](70081#onremotestreamstats)
|
|
3416
|
+
* 2. stop: [unsubscribeStream](#unsubscribestream), [unsubscribeScreen](#unsubscribescreen)
|
|
3372
3417
|
*/
|
|
3373
3418
|
getRemoteStreamTrack: (userId: string, streamIndex: StreamIndex, type: "video" | "audio") => MediaStreamTrack | undefined;
|
|
3374
3419
|
|
|
@@ -3406,7 +3451,41 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3406
3451
|
* • [AI Noise-Cancelling Extension](https://docs.byteplus.com/byteplus-rtc/docs/148647).
|
|
3407
3452
|
*/
|
|
3408
3453
|
registerExtension: (extension: RTCExtension) => Promise<void>;
|
|
3409
|
-
|
|
3454
|
+
|
|
3455
|
+
/**
|
|
3456
|
+
* @hidden currently not available
|
|
3457
|
+
* @brief Turns on subtitles.
|
|
3458
|
+
* After calling this method, you can choose between the recognition and translation modes based on your needs. In the recognition mode, the speech of the speaker in the room will be recognized and converted into captions. In the translation mode, the transcribed text will be translated.You will receive the [onSubtitleMessageReceived](104479#onsubtitlemessagereceived) callback to informs you of related information about subtitles.
|
|
3459
|
+
* After calling this method, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you of whether subtitles are on.
|
|
3460
|
+
* @param config Subtitle configrations.
|
|
3461
|
+
* @return + `0`: Success.
|
|
3462
|
+
* + `!0`: Failure.
|
|
3463
|
+
* @notes
|
|
3464
|
+
* You must call this method after joining the room.
|
|
3465
|
+
* You can set your source language by calling `joinRoom` and importing a json formatted string `"SourceLanguage": "zh"` through the paramater of extraInfo. Only chinese, English and Japanese are supported.
|
|
3466
|
+
* The language of your browser will be automatically set as the source language if you don't set it.
|
|
3467
|
+
*/
|
|
3468
|
+
startSubtitle: (config: RTCSubtitleConfig) => Promise<void>;
|
|
3469
|
+
|
|
3470
|
+
/**
|
|
3471
|
+
* @hidden currently not available
|
|
3472
|
+
* @brief Turns off subtitles.
|
|
3473
|
+
* After calling this method, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you of whether subtitles are off.
|
|
3474
|
+
* @return + `0`: Success.
|
|
3475
|
+
* + `!0`: Failure.
|
|
3476
|
+
*/
|
|
3477
|
+
stopSubtitle: () => void;
|
|
3478
|
+
|
|
3479
|
+
/**
|
|
3480
|
+
* @brief Set whether the remote audio and video streams are rendered synchronously.
|
|
3481
|
+
* You can achieve ultra low latency by turning off the audio and video synchronization.
|
|
3482
|
+
* @param sync `true`: (Default) Turn on sync.
|
|
3483
|
+
* `false`: Turn off sync.
|
|
3484
|
+
* @return + `true`: Success.
|
|
3485
|
+
* + `false`: Failure.
|
|
3486
|
+
* @notes You must call this API before joining the room. Calling it afterward is invalid.
|
|
3487
|
+
*/
|
|
3488
|
+
setRemoteStreamRenderSync: (sync: boolean) => boolean;
|
|
3410
3489
|
}
|
|
3411
3490
|
|
|
3412
3491
|
/**
|
|
@@ -3497,32 +3576,34 @@ export declare enum ChannelProfile {
|
|
|
3497
3576
|
}
|
|
3498
3577
|
|
|
3499
3578
|
/**
|
|
3500
|
-
* @brief Room
|
|
3579
|
+
* @brief Room configurations.
|
|
3501
3580
|
*/
|
|
3502
3581
|
export interface RoomConfig {
|
|
3503
3582
|
|
|
3504
3583
|
/**
|
|
3505
3584
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3506
3585
|
* This does not include the screen stream.
|
|
3507
|
-
* Call
|
|
3586
|
+
* Call [publishStream](104478#publishstream) to publish media streams if you disable `isAutoPublish`.
|
|
3508
3587
|
*/
|
|
3509
3588
|
isAutoPublish?: boolean;
|
|
3510
3589
|
|
|
3511
3590
|
/**
|
|
3512
3591
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3513
3592
|
* This does not include the screen stream.
|
|
3514
|
-
*
|
|
3593
|
+
* You can call [subscribeStream](104478#subscribestream) and [unsubscribeStream](104478#unsubscribestream) to revise the subscription after entering the room.
|
|
3515
3594
|
*/
|
|
3516
3595
|
isAutoSubscribeAudio?: boolean;
|
|
3517
3596
|
|
|
3518
3597
|
/**
|
|
3519
3598
|
* @brief Enable/disable auto-subscribe video. Enable by default.
|
|
3520
3599
|
* This does not include the screen stream.
|
|
3521
|
-
*
|
|
3600
|
+
* You can call [subscribeStream](104478#subscribestream) and [unsubscribeStream](104478#unsubscribestream) to revise the subscription after entering the room.
|
|
3522
3601
|
*/
|
|
3523
3602
|
isAutoSubscribeVideo?: boolean;
|
|
3524
3603
|
|
|
3525
3604
|
/**
|
|
3605
|
+
* @hidden
|
|
3606
|
+
* @deprecated since 4.51, use setAudioProfile instead.
|
|
3526
3607
|
* @brief Room profile
|
|
3527
3608
|
* Choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
|
|
3528
3609
|
* Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
|
|
@@ -3891,22 +3972,25 @@ export interface ScreenConfig {
|
|
|
3891
3972
|
export interface VideoEncoderConfig {
|
|
3892
3973
|
|
|
3893
3974
|
/**
|
|
3894
|
-
* @brief
|
|
3975
|
+
* @brief Video width in pixels. The default value is 640 px。
|
|
3976
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3895
3977
|
*/
|
|
3896
|
-
width:
|
|
3978
|
+
width: ConstrainULong;
|
|
3897
3979
|
|
|
3898
3980
|
/**
|
|
3899
|
-
* @brief
|
|
3981
|
+
* @brief Video height in pixels. The default value is 480 px。
|
|
3982
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3900
3983
|
*/
|
|
3901
|
-
height:
|
|
3984
|
+
height: ConstrainULong;
|
|
3902
3985
|
|
|
3903
3986
|
/**
|
|
3904
|
-
* @brief
|
|
3987
|
+
* @brief Video framerate in FPS. The default value is 15 FPS。
|
|
3988
|
+
* The input can be a number or a [ConstrainDouble](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constraindouble).
|
|
3905
3989
|
*/
|
|
3906
|
-
frameRate:
|
|
3990
|
+
frameRate: ConstrainDouble;
|
|
3907
3991
|
|
|
3908
3992
|
/**
|
|
3909
|
-
* @brief The maximum bitrate(>0
|
|
3993
|
+
* @brief The maximum bitrate in Kbps (>0). The default value is 600 Kbps.
|
|
3910
3994
|
*/
|
|
3911
3995
|
maxKbps: number;
|
|
3912
3996
|
}
|
|
@@ -3917,22 +4001,25 @@ export interface VideoEncoderConfig {
|
|
|
3917
4001
|
export interface ScreenEncoderConfig {
|
|
3918
4002
|
|
|
3919
4003
|
/**
|
|
3920
|
-
* @brief
|
|
4004
|
+
* @brief Video width in pixels. The default value is 1920 px。
|
|
4005
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3921
4006
|
*/
|
|
3922
|
-
width:
|
|
4007
|
+
width: ConstrainULong;
|
|
3923
4008
|
|
|
3924
4009
|
/**
|
|
3925
|
-
* @brief
|
|
4010
|
+
* @brief Video height in pixels. The default value is 1080 px。
|
|
4011
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3926
4012
|
*/
|
|
3927
|
-
height:
|
|
4013
|
+
height: ConstrainULong;
|
|
3928
4014
|
|
|
3929
4015
|
/**
|
|
3930
|
-
* @brief
|
|
4016
|
+
* @brief Video framerate in FPS. The default value is 15 FPS。
|
|
4017
|
+
* The input can be a number or a [ConstrainDouble](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constraindouble).
|
|
3931
4018
|
*/
|
|
3932
|
-
frameRate:
|
|
4019
|
+
frameRate: ConstrainDouble;
|
|
3933
4020
|
|
|
3934
4021
|
/**
|
|
3935
|
-
* @brief The maximum bitrate(>0
|
|
4022
|
+
* @brief The maximum bitrate in Kbps (>0). The default value is 3000 Kbps.
|
|
3936
4023
|
*/
|
|
3937
4024
|
maxKbps: number;
|
|
3938
4025
|
|
|
@@ -4115,7 +4202,7 @@ export interface LiveTranscodeLayoutConfig {
|
|
|
4115
4202
|
regions: LiveTranscodeLayoutRegion[];
|
|
4116
4203
|
|
|
4117
4204
|
/**
|
|
4118
|
-
* @brief
|
|
4205
|
+
* @brief The data you need, up to 4KB in length.
|
|
4119
4206
|
*/
|
|
4120
4207
|
appData: string;
|
|
4121
4208
|
|
|
@@ -4579,7 +4666,7 @@ export declare enum AudioProfileType {
|
|
|
4579
4666
|
|
|
4580
4667
|
/**
|
|
4581
4668
|
* @brief Default sound quality
|
|
4582
|
-
* The sound quality
|
|
4669
|
+
* The sound quality set by the server
|
|
4583
4670
|
*/
|
|
4584
4671
|
default = 0,
|
|
4585
4672
|
|
|
@@ -4663,7 +4750,6 @@ export interface EngineConfig {
|
|
|
4663
4750
|
}
|
|
4664
4751
|
|
|
4665
4752
|
/**
|
|
4666
|
-
* @type keytype
|
|
4667
4753
|
* @brief Advanced Audio Coding (AAC) profile.
|
|
4668
4754
|
*/
|
|
4669
4755
|
export declare enum AAC_PROFILE {
|
|
@@ -4700,6 +4786,111 @@ export declare enum TRANSCODING_VIDEO_CODEC {
|
|
|
4700
4786
|
H265 = "H265"
|
|
4701
4787
|
}
|
|
4702
4788
|
|
|
4789
|
+
/**
|
|
4790
|
+
* @brief Subtitle configrations.
|
|
4791
|
+
*/
|
|
4792
|
+
export interface RTCSubtitleConfig {
|
|
4793
|
+
|
|
4794
|
+
/**
|
|
4795
|
+
* @brief Target language.
|
|
4796
|
+
*/
|
|
4797
|
+
targetLanguage?: string;
|
|
4798
|
+
|
|
4799
|
+
/**
|
|
4800
|
+
* @brief Subtitle mode.
|
|
4801
|
+
*/
|
|
4802
|
+
mode: SUBTITLE_MODE;
|
|
4803
|
+
}
|
|
4804
|
+
|
|
4805
|
+
/**
|
|
4806
|
+
* @brief Subtitle mode.
|
|
4807
|
+
*/
|
|
4808
|
+
export declare enum SUBTITLE_MODE {
|
|
4809
|
+
|
|
4810
|
+
/**
|
|
4811
|
+
* @brief The recognition mode. In this mode, the speech of a users in the room will be recognized and converted into captions.
|
|
4812
|
+
*/
|
|
4813
|
+
ASR_ONLY = 0,
|
|
4814
|
+
|
|
4815
|
+
/**
|
|
4816
|
+
* @brief The translation mode. In this mode, the speech of a users in the room will be converted into captions and then translated.
|
|
4817
|
+
*/
|
|
4818
|
+
ASR_AND_TRANSLATION = 1
|
|
4819
|
+
}
|
|
4820
|
+
|
|
4821
|
+
/**
|
|
4822
|
+
* @brief The states of the subtitling task.
|
|
4823
|
+
*/
|
|
4824
|
+
export interface SubtitleEvent {
|
|
4825
|
+
|
|
4826
|
+
/**
|
|
4827
|
+
* @brief Types of the states of the subtitling task.
|
|
4828
|
+
*/
|
|
4829
|
+
event: SubtitleEventType;
|
|
4830
|
+
|
|
4831
|
+
/**
|
|
4832
|
+
* @brief Error codes of the subtitling task.
|
|
4833
|
+
*/
|
|
4834
|
+
errorCode?: ErrorCode;
|
|
4835
|
+
|
|
4836
|
+
/**
|
|
4837
|
+
* @brief Related information about subtitles.
|
|
4838
|
+
*/
|
|
4839
|
+
errorMessage?: string;
|
|
4840
|
+
}
|
|
4841
|
+
|
|
4842
|
+
/**
|
|
4843
|
+
* @brief Types of the states of the subtitling task.
|
|
4844
|
+
*/
|
|
4845
|
+
export declare enum SubtitleEventType {
|
|
4846
|
+
|
|
4847
|
+
/**
|
|
4848
|
+
* @brief Subtitles are on.
|
|
4849
|
+
*/
|
|
4850
|
+
STARTED = 0,
|
|
4851
|
+
|
|
4852
|
+
/**
|
|
4853
|
+
* @brief Subtitles are off.
|
|
4854
|
+
*/
|
|
4855
|
+
STOPPED = 1,
|
|
4856
|
+
|
|
4857
|
+
/**
|
|
4858
|
+
* @brief Errors occurred concerning the subtitling task.
|
|
4859
|
+
*/
|
|
4860
|
+
ERROR = 2
|
|
4861
|
+
}
|
|
4862
|
+
|
|
4863
|
+
/**
|
|
4864
|
+
* @brief Related information about subtitles.
|
|
4865
|
+
*/
|
|
4866
|
+
export interface SubtitleMessage {
|
|
4867
|
+
|
|
4868
|
+
/**
|
|
4869
|
+
* @brief The speaker's ID.
|
|
4870
|
+
*/
|
|
4871
|
+
userId: string;
|
|
4872
|
+
|
|
4873
|
+
/**
|
|
4874
|
+
* @brief Transcribed or translated texts of the speaker's speech, encoded in UTF-8 format.
|
|
4875
|
+
*/
|
|
4876
|
+
text: string;
|
|
4877
|
+
|
|
4878
|
+
/**
|
|
4879
|
+
* @brief Whether transcribed texts are complete sentences. True means yes and False means no.
|
|
4880
|
+
*/
|
|
4881
|
+
definite: boolean;
|
|
4882
|
+
|
|
4883
|
+
/**
|
|
4884
|
+
* @brief Incremental sequence numbers assigned to transcribed or translated texts of the speaker's speech. Complete and incomplete sentences are numbered individually.
|
|
4885
|
+
*/
|
|
4886
|
+
sequence: number;
|
|
4887
|
+
}
|
|
4888
|
+
export declare enum ConnectionMode {
|
|
4889
|
+
AUTO = "auto",
|
|
4890
|
+
FORCE_TCP = "forceTCP",
|
|
4891
|
+
FORCE_UDP = "forceUDP"
|
|
4892
|
+
}
|
|
4893
|
+
|
|
4703
4894
|
/**
|
|
4704
4895
|
* @brief Point-to-point text message
|
|
4705
4896
|
*/
|
|
@@ -4786,15 +4977,11 @@ declare const Config: {
|
|
|
4786
4977
|
};
|
|
4787
4978
|
declare function setParameter(key: keyof typeof Config, value: any): void;
|
|
4788
4979
|
declare function getParameter(key: keyof typeof Config): any;
|
|
4789
|
-
|
|
4790
|
-
* @id VERTC
|
|
4791
|
-
* @list 104477
|
|
4792
|
-
* @detail 104478
|
|
4793
|
-
*/
|
|
4980
|
+
|
|
4794
4981
|
/**
|
|
4795
4982
|
* @id BytePlusRTC
|
|
4796
|
-
* @list
|
|
4797
|
-
* @detail
|
|
4983
|
+
* @list overview
|
|
4984
|
+
* @detail api
|
|
4798
4985
|
*/
|
|
4799
4986
|
export interface IVERTC {
|
|
4800
4987
|
|
|
@@ -4813,7 +5000,7 @@ export interface IVERTC {
|
|
|
4813
5000
|
createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
|
|
4814
5001
|
|
|
4815
5002
|
/**
|
|
4816
|
-
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
|
|
5003
|
+
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](104478#createengine).
|
|
4817
5004
|
* @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.
|
|
4818
5005
|
* @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
|
|
4819
5006
|
* + 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.
|
|
@@ -4830,7 +5017,7 @@ export interface IVERTC {
|
|
|
4830
5017
|
|
|
4831
5018
|
/**
|
|
4832
5019
|
* @brief Call this API to enumerate media devices and their IDs, such as microphones, cameras, and headsets.
|
|
4833
|
-
* Call this API to get deviceId used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice), [startVideoCapture](#startvideocapture), and [startAudioCapture](#startaudiocapture).
|
|
5020
|
+
* Call this API to get deviceId used to specify the device when calling [setAudioPlaybackDevice](104478#setaudioplaybackdevice), [startVideoCapture](104478#startvideocapture), and [startAudioCapture](104478#startaudiocapture).
|
|
4834
5021
|
* @return A list of all media devices.
|
|
4835
5022
|
* @notes Only when the browser has permission to the media devices can it enumerate the full device list. Make sure the media device access is turned on before calling this API.
|
|
4836
5023
|
*/
|
|
@@ -4861,7 +5048,7 @@ export interface IVERTC {
|
|
|
4861
5048
|
|
|
4862
5049
|
/**
|
|
4863
5050
|
* @brief Call this API to enumerate microphone devices.
|
|
4864
|
-
* Call this API to get Device IDs used to specify the device when calling [startAudioCapture](#startaudiocapture).
|
|
5051
|
+
* Call this API to get Device IDs used to specify the device when calling [startAudioCapture](104478#startaudiocapture) and [setAudioCaptureDevice](104478#setaudiocapturedevice).
|
|
4865
5052
|
* @return A list including all microphone devices.
|
|
4866
5053
|
* @notes Only when the browser has permission to the media devices can it enumerate the full device list. Make sure the media device access is turned on before calling this API.
|
|
4867
5054
|
*/
|
|
@@ -4869,7 +5056,7 @@ export interface IVERTC {
|
|
|
4869
5056
|
|
|
4870
5057
|
/**
|
|
4871
5058
|
* @brief Call this API to enumerate audio and video devices and their IDs, such as microphones, cameras, and headsets.
|
|
4872
|
-
* Call this API to get Device IDs used to specify the device when calling [startVideoCapture](#startvideocapture).
|
|
5059
|
+
* Call this API to get Device IDs used to specify the device when calling [startVideoCapture](104478#startvideocapture) and [setVideoCaptureDevice](104478#setvideocapturedevice).
|
|
4873
5060
|
* @return A list including all camera devices.
|
|
4874
5061
|
* @notes Only when the browser has permission to the media devices can it enumerate the full device list. Make sure the media device access is turned on before calling this API.
|
|
4875
5062
|
*/
|
|
@@ -4877,7 +5064,7 @@ export interface IVERTC {
|
|
|
4877
5064
|
|
|
4878
5065
|
/**
|
|
4879
5066
|
* @brief Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
|
|
4880
|
-
* Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice).
|
|
5067
|
+
* Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](104478#setaudioplaybackdevice).
|
|
4881
5068
|
* @return A list including all audio playback devices.
|
|
4882
5069
|
* @notes Only when the browser has permission to the media devices can it enumerate the full device list. Make sure the media device access is turned on before calling this API.
|
|
4883
5070
|
*/
|
|
@@ -4906,18 +5093,18 @@ export interface IVERTC {
|
|
|
4906
5093
|
setLogConfig: ({ logLevel, LogfileSize }: {
|
|
4907
5094
|
|
|
4908
5095
|
/**
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
5096
|
+
* @brief The logging level of local cache.
|
|
5097
|
+
* • `none`: (Default) Turn off logging.
|
|
5098
|
+
* • `error`: Error.
|
|
5099
|
+
* • `warning`: Warning.
|
|
5100
|
+
* • `info`: Information.
|
|
5101
|
+
* • `trace`: Trace.
|
|
5102
|
+
*/
|
|
4916
5103
|
logLevel?: "none" | "error" | "warning" | "info" | "trace";
|
|
4917
5104
|
|
|
4918
5105
|
/**
|
|
4919
|
-
|
|
4920
|
-
|
|
5106
|
+
* @brief The maximum cache space available for logs in MB. the range is 1 to 100 MB, and the default value is 10 MB.
|
|
5107
|
+
*/
|
|
4921
5108
|
LogfileSize?: number;
|
|
4922
5109
|
}) => void;
|
|
4923
5110
|
|
|
@@ -4946,10 +5133,12 @@ declare class VERTC implements IVERTC {
|
|
|
4946
5133
|
setParameter: typeof setParameter;
|
|
4947
5134
|
isSupported: () => Promise<boolean>;
|
|
4948
5135
|
getSupportedCodecs: () => Promise<string[]>;
|
|
5136
|
+
ConnectionMode: typeof ConnectionMode;
|
|
4949
5137
|
events: typeof EngineEventsTypes;
|
|
4950
5138
|
ErrorCode: typeof ErrorCode;
|
|
4951
5139
|
platform: string;
|
|
4952
5140
|
private _monitor;
|
|
5141
|
+
private _rtmMonitor;
|
|
4953
5142
|
downloadLog: (key?: string | undefined) => void;
|
|
4954
5143
|
setLogConfig: ({ logLevel, LogfileSize }: {
|
|
4955
5144
|
logLevel?: "none" | "error" | "warning" | "info" | "trace" | undefined;
|