@byteplus/rtc 4.49.4 → 4.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/extension-beauty/index.js +1 -1
- package/extension-beauty/index.umd.js +1 -1
- package/index.d.ts +638 -454
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +1 -1
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
|
*/
|
|
@@ -340,407 +626,140 @@ declare enum ErrorCode {
|
|
|
340
626
|
USER_MESSAGE_NOT_JOIN = "USER_MESSAGE_NOT_JOIN",
|
|
341
627
|
|
|
342
628
|
/**
|
|
629
|
+
* @hidden
|
|
630
|
+
* @deprecated
|
|
343
631
|
* @brief Connection has not initiated.
|
|
344
632
|
*/
|
|
345
633
|
USER_MESSAGE_INIT = "USER_MESSAGE_INIT",
|
|
346
634
|
|
|
347
635
|
/**
|
|
636
|
+
* @hidden
|
|
637
|
+
* @deprecated since 4.49, use USER_MESSAGE_UNKNOWN instead.
|
|
348
638
|
* @brief No available data connection
|
|
349
639
|
*/
|
|
350
640
|
USER_MESSAGE_NO_CONNECTION = "USER_MESSAGE_NO_CONNECTION",
|
|
351
641
|
|
|
352
642
|
/**
|
|
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
|
|
643
|
+
* @brief Sending a message before login to the IM server
|
|
523
644
|
*/
|
|
524
|
-
|
|
645
|
+
USER_MESSAGE_NOT_LOGIN = "USER_MESSAGE_NOT_LOGIN",
|
|
525
646
|
|
|
526
647
|
/**
|
|
527
|
-
* @brief
|
|
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
|
|
648
|
+
* @brief Lack of params of the IM server
|
|
533
649
|
*/
|
|
534
|
-
|
|
650
|
+
USER_MESSAGE_SERVER_PARAMS_NOTSET = "USER_MESSAGE_SERVER_PARAMS_NOTSET",
|
|
535
651
|
|
|
536
652
|
/**
|
|
537
|
-
* @brief
|
|
538
|
-
* @param id Mix ID
|
|
539
|
-
* @return + `> 0`: Success, audio file playback progress, in milliseconds.
|
|
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
|
|
653
|
+
* @brief Unknown error of messaging
|
|
543
654
|
*/
|
|
544
|
-
|
|
655
|
+
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN",
|
|
545
656
|
|
|
546
657
|
/**
|
|
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
|
|
658
|
+
* @brief The user publishes a public stream before joining room.
|
|
554
659
|
*/
|
|
555
|
-
|
|
660
|
+
START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN",
|
|
556
661
|
|
|
557
662
|
/**
|
|
558
|
-
* @brief
|
|
559
|
-
*
|
|
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
|
|
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.
|
|
565
665
|
*/
|
|
566
|
-
|
|
666
|
+
RECONNECT_FAILED = "RECONNECT_FAILED",
|
|
567
667
|
|
|
568
668
|
/**
|
|
569
|
-
* @brief
|
|
570
|
-
* @region Advanced Feature
|
|
669
|
+
* @brief Subtitles are already on. There is no need to call [startSubtitle](104478#startsubtitle) again.
|
|
571
670
|
*/
|
|
572
|
-
|
|
671
|
+
SUBTITLE_ALREADY_ON = "SUBTITLE_ALREADY_ON",
|
|
573
672
|
|
|
574
673
|
/**
|
|
575
|
-
* @
|
|
576
|
-
* @
|
|
577
|
-
* @notes Before calling this method, you must start the external audio stream mixing through [enableAudioMixingFrame](#enableaudiomixingframe).
|
|
578
|
-
* @region Advanced Feature
|
|
674
|
+
* @hidden currently not available
|
|
675
|
+
* @brief The substitling task didn't start, or call an API to update subtitles without turning on subtitles.
|
|
579
676
|
*/
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
/**
|
|
584
|
-
* @brief Mix playback channel type
|
|
585
|
-
*/
|
|
586
|
-
export declare enum AudioMixingDualMonoMode {
|
|
677
|
+
SUBTITLE_NOT_TURNED_ON = "SUBTITLE_NOT_TURNED_ON",
|
|
587
678
|
|
|
588
679
|
/**
|
|
589
|
-
* @brief
|
|
680
|
+
* @brief Errors occurred concerning cloud media processing. Please contact the technical support.
|
|
590
681
|
*/
|
|
591
|
-
|
|
682
|
+
SUBTITLE_ERR_POSTPROCESS = "SUBTITLE_ERR_POSTPROCESS",
|
|
592
683
|
|
|
593
684
|
/**
|
|
594
|
-
* @brief
|
|
685
|
+
* @brief Failed to connect to the thrid-party service. Please contact the technical support.
|
|
595
686
|
*/
|
|
596
|
-
|
|
687
|
+
SUBTITLE_ERR_CONNECTION_ERROR = "SUBTITLE_ERR_CONNECTION_ERROR",
|
|
597
688
|
|
|
598
689
|
/**
|
|
599
|
-
* @brief
|
|
690
|
+
* @brief Cloud media processing is timeout. Please contact the technical support.
|
|
600
691
|
*/
|
|
601
|
-
|
|
692
|
+
SUBTITLE_ERR_PROCESS_ERROR = "SUBTITLE_ERR_PROCESS_ERROR",
|
|
602
693
|
|
|
603
694
|
/**
|
|
604
|
-
* @brief
|
|
695
|
+
* @brief The client side failed to identity error codes sent by cloud media processing. Please contact the technical support.
|
|
605
696
|
*/
|
|
606
|
-
|
|
697
|
+
SUBTITLE_ERR_UNKNOWN = "SUBTITLE_ERR_UNKNOWN"
|
|
607
698
|
}
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* @brief Mixing type
|
|
611
|
-
*/
|
|
612
|
-
export declare enum AudioMixingType {
|
|
699
|
+
declare enum AudioMixingError {
|
|
613
700
|
|
|
614
701
|
/**
|
|
615
|
-
* @brief
|
|
702
|
+
* @brief Normal
|
|
616
703
|
*/
|
|
617
|
-
|
|
704
|
+
AUDIO_MIXING_ERROR_OK = 0,
|
|
618
705
|
|
|
619
706
|
/**
|
|
620
|
-
* @brief
|
|
707
|
+
* @brief Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
621
708
|
*/
|
|
622
|
-
|
|
709
|
+
AUDIO_MIXING_ERROR_PRELOAD_FAILED = 1,
|
|
623
710
|
|
|
624
711
|
/**
|
|
625
|
-
* @brief
|
|
712
|
+
* @brief Audio mixing starts fails because of missing audio file or failure of reading the audio file.
|
|
626
713
|
*/
|
|
627
|
-
|
|
628
|
-
}
|
|
629
|
-
declare enum AudioMixingState {
|
|
630
|
-
|
|
631
|
-
AUDIO_MIXING_STATE_PRELOADED = 0,
|
|
632
|
-
|
|
633
|
-
AUDIO_MIXING_STATE_PLAYING = 1,
|
|
634
|
-
|
|
635
|
-
AUDIO_MIXING_STATE_PAUSED = 2,
|
|
636
|
-
|
|
637
|
-
AUDIO_MIXING_STATE_STOPPED = 3,
|
|
638
|
-
|
|
639
|
-
AUDIO_MIXING_STATE_FAILED = 4,
|
|
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,10 +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>;
|
|
802
|
+
avSync: boolean;
|
|
781
803
|
}
|
|
782
804
|
export declare type RTCExtension = any;
|
|
805
|
+
/**
|
|
806
|
+
* 设置到pc上的视频编码参数
|
|
807
|
+
*/
|
|
808
|
+
export declare type VideoEncoderConfig_PC = Pick<VideoEncoderConfig, "maxKbps">;
|
|
783
809
|
declare enum StreamMixingEventType {
|
|
784
810
|
|
|
785
811
|
/**
|
|
@@ -1159,7 +1185,9 @@ export interface LocalVideoStats {
|
|
|
1159
1185
|
encodedFrameCount: number;
|
|
1160
1186
|
|
|
1161
1187
|
/**
|
|
1162
|
-
* @brief
|
|
1188
|
+
* @brief Video codec.
|
|
1189
|
+
* "H264": H.264 video codec.
|
|
1190
|
+
* "VP8": VP8 video codec.
|
|
1163
1191
|
*/
|
|
1164
1192
|
codecType: string;
|
|
1165
1193
|
|
|
@@ -1610,6 +1638,8 @@ declare enum EngineEventsTypes {
|
|
|
1610
1638
|
onVideoStreamBanned = "onVideoStreamBanned",
|
|
1611
1639
|
onAudioStreamBanned = "onAudioStreamBanned",
|
|
1612
1640
|
onLocalVideoSizeChanged = "onLocalVideoSizeChanged",
|
|
1641
|
+
onSubtitleStateChanged = "onSubtitleStateChanged",
|
|
1642
|
+
onSubtitleMessageReceived = "onSubtitleMessageReceived",
|
|
1613
1643
|
onServerParamsSetResult = "onServerParamsSetResult"
|
|
1614
1644
|
}
|
|
1615
1645
|
|
|
@@ -1797,7 +1827,6 @@ export interface LocalAudioPropertiesInfo {
|
|
|
1797
1827
|
streamIndex: StreamIndex;
|
|
1798
1828
|
|
|
1799
1829
|
/**
|
|
1800
|
-
* @type keytype
|
|
1801
1830
|
* @brief Audio information
|
|
1802
1831
|
*/
|
|
1803
1832
|
audioPropertiesInfo: AudioPropertiesInfo;
|
|
@@ -1925,8 +1954,8 @@ declare enum StreamMixingEventErrorCode {
|
|
|
1925
1954
|
|
|
1926
1955
|
/**
|
|
1927
1956
|
* @id EngineEvents
|
|
1928
|
-
* @list
|
|
1929
|
-
* @detail
|
|
1957
|
+
* @list overview
|
|
1958
|
+
* @detail callback
|
|
1930
1959
|
*/
|
|
1931
1960
|
export interface IEngineEvents {
|
|
1932
1961
|
|
|
@@ -1960,7 +1989,7 @@ export interface IEngineEvents {
|
|
|
1960
1989
|
|
|
1961
1990
|
/**
|
|
1962
1991
|
* @brief Callback on new media streams captured by camera/microphone in the room.
|
|
1963
|
-
* @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.
|
|
1964
1993
|
*/
|
|
1965
1994
|
[EngineEventsTypes.onUserPublishStream]: (event: {
|
|
1966
1995
|
|
|
@@ -1977,7 +2006,7 @@ export interface IEngineEvents {
|
|
|
1977
2006
|
|
|
1978
2007
|
/**
|
|
1979
2008
|
* @brief Callback on removal of remote media stream captured by camera/microphone.
|
|
1980
|
-
* @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.
|
|
1981
2010
|
*/
|
|
1982
2011
|
[EngineEventsTypes.onUserUnpublishStream]: (event: {
|
|
1983
2012
|
|
|
@@ -1999,7 +2028,7 @@ export interface IEngineEvents {
|
|
|
1999
2028
|
|
|
2000
2029
|
/**
|
|
2001
2030
|
* @brief Callback on new screen sharing media streams from remote users in the room.
|
|
2002
|
-
* @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.
|
|
2003
2032
|
*/
|
|
2004
2033
|
[EngineEventsTypes.onUserPublishScreen]: (event: {
|
|
2005
2034
|
|
|
@@ -2016,7 +2045,7 @@ export interface IEngineEvents {
|
|
|
2016
2045
|
|
|
2017
2046
|
/**
|
|
2018
2047
|
* @brief Callback on removal of screen sharing media streams from remote users in the room.
|
|
2019
|
-
* @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.
|
|
2020
2049
|
*/
|
|
2021
2050
|
[EngineEventsTypes.onUserUnpublishScreen]: (event: {
|
|
2022
2051
|
|
|
@@ -2151,7 +2180,7 @@ export interface IEngineEvents {
|
|
|
2151
2180
|
}) => void;
|
|
2152
2181
|
|
|
2153
2182
|
/**
|
|
2154
|
-
* @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)
|
|
2155
2184
|
* @param event
|
|
2156
2185
|
* @region Message Event
|
|
2157
2186
|
*/
|
|
@@ -2202,7 +2231,7 @@ export interface IEngineEvents {
|
|
|
2202
2231
|
}) => void;
|
|
2203
2232
|
|
|
2204
2233
|
/**
|
|
2205
|
-
* @brief After calling [enableAudioPropertiesReport](104478#
|
|
2234
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information about local audio.
|
|
2206
2235
|
* Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms.
|
|
2207
2236
|
* @param event Information about local audio.
|
|
2208
2237
|
* @region Audio Managment
|
|
@@ -2210,7 +2239,7 @@ export interface IEngineEvents {
|
|
|
2210
2239
|
[EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
|
|
2211
2240
|
|
|
2212
2241
|
/**
|
|
2213
|
-
* @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.
|
|
2214
2243
|
* The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism.
|
|
2215
2244
|
* @param event Information about remote audio.
|
|
2216
2245
|
* @region Audio Management
|
|
@@ -2231,7 +2260,7 @@ export interface IEngineEvents {
|
|
|
2231
2260
|
[EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: MediaDeviceInfo) => void;
|
|
2232
2261
|
|
|
2233
2262
|
/**
|
|
2234
|
-
* @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).
|
|
2235
2264
|
* @param event
|
|
2236
2265
|
* @region Audio Management Event
|
|
2237
2266
|
*/
|
|
@@ -2244,7 +2273,7 @@ export interface IEngineEvents {
|
|
|
2244
2273
|
}) => void;
|
|
2245
2274
|
|
|
2246
2275
|
/**
|
|
2247
|
-
* @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).
|
|
2248
2277
|
* @param event
|
|
2249
2278
|
* @region Room Management Event
|
|
2250
2279
|
*/
|
|
@@ -2257,7 +2286,7 @@ export interface IEngineEvents {
|
|
|
2257
2286
|
}) => void;
|
|
2258
2287
|
|
|
2259
2288
|
/**
|
|
2260
|
-
* @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).
|
|
2261
2290
|
* @param event
|
|
2262
2291
|
* @region Room Management Event
|
|
2263
2292
|
*/
|
|
@@ -2270,7 +2299,7 @@ export interface IEngineEvents {
|
|
|
2270
2299
|
}) => void;
|
|
2271
2300
|
|
|
2272
2301
|
/**
|
|
2273
|
-
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).
|
|
2274
2303
|
* @param event
|
|
2275
2304
|
* @region Room Management Event
|
|
2276
2305
|
*/
|
|
@@ -2387,7 +2416,7 @@ export interface IEngineEvents {
|
|
|
2387
2416
|
[EngineEventsTypes.onTokenWillExpire]: () => void;
|
|
2388
2417
|
|
|
2389
2418
|
/**
|
|
2390
|
-
* @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.
|
|
2391
2420
|
* @param event
|
|
2392
2421
|
*/
|
|
2393
2422
|
[EngineEventsTypes.onCloudProxyConnected]: (event: CloudProxyConnectedEvent) => void;
|
|
@@ -2537,19 +2566,36 @@ export interface IEngineEvents {
|
|
|
2537
2566
|
};
|
|
2538
2567
|
}) => void;
|
|
2539
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
|
+
|
|
2540
2585
|
/**
|
|
2541
2586
|
* @brief Event of whether the setting for the message server successes
|
|
2542
2587
|
* @param error Error code
|
|
2543
|
-
* @notes + This event notifies you the result after the call of [setServerParams](104478#
|
|
2544
|
-
* + 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.
|
|
2545
2590
|
*/
|
|
2546
2591
|
[EngineEventsTypes.onServerParamsSetResult]: (error?: ErrorCode) => void;
|
|
2547
2592
|
}
|
|
2548
2593
|
|
|
2549
2594
|
/**
|
|
2550
2595
|
* @id RTCEngine
|
|
2551
|
-
*
|
|
2552
|
-
* @
|
|
2596
|
+
* <span id="irtcengine"></span>
|
|
2597
|
+
* @list overview
|
|
2598
|
+
* @detail api
|
|
2553
2599
|
*/
|
|
2554
2600
|
export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
2555
2601
|
|
|
@@ -2557,7 +2603,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2557
2603
|
* @brief Join the room.
|
|
2558
2604
|
* Call this method to join the room and make audio & video calls with other users in the room.
|
|
2559
2605
|
* @param token Dynamic key. It is used for authentication and verification of users entering the room.
|
|
2560
|
-
* 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.
|
|
2561
2607
|
* Apps with different AppIDs are not interoperable.
|
|
2562
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.
|
|
2563
2609
|
* @param roomId The ID of the room to be added.
|
|
@@ -2571,7 +2617,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2571
2617
|
* @return
|
|
2572
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`.
|
|
2573
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.
|
|
2574
|
-
* + 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.
|
|
2575
2621
|
* @region Room Management
|
|
2576
2622
|
*/
|
|
2577
2623
|
joinRoom: (token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig) => Promise<void>;
|
|
@@ -2588,7 +2634,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2588
2634
|
/**
|
|
2589
2635
|
* @hidden
|
|
2590
2636
|
* @brief Destroy engine
|
|
2591
|
-
* Destroy the engine instances created by calling [createEngine](#createengine) and release all related resources.
|
|
2637
|
+
* Destroy the engine instances created by calling [createEngine](104478#createengine) and release all related resources.
|
|
2592
2638
|
* @notes + Make sure that the business scenarios related to the `RTCEngine` instances that need to be destroyed are all finished before calling this API.
|
|
2593
2639
|
* + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server.
|
|
2594
2640
|
* + 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.
|
|
@@ -2599,8 +2645,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2599
2645
|
/**
|
|
2600
2646
|
* @brief Publishes media streams captured by camera/microphone in the current room.
|
|
2601
2647
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
2602
|
-
* @notes +
|
|
2603
|
-
* + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2648
|
+
* @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2604
2649
|
* + Call [publishScreen](#publishscreen) to start screen sharing.
|
|
2605
2650
|
* + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream).
|
|
2606
2651
|
* + Call [unpublishStream](#unpublishstream) to stop publishing streams.
|
|
@@ -2706,15 +2751,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2706
2751
|
|
|
2707
2752
|
/**
|
|
2708
2753
|
* @brief Enable internal video capture. The default state is off.
|
|
2709
|
-
*
|
|
2710
|
-
*
|
|
2754
|
+
* Internal video capture refers to: capturing video using the built-in module.
|
|
2755
|
+
* 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.
|
|
2711
2756
|
* @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.
|
|
2712
2757
|
* @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`.
|
|
2713
|
-
* The `frameRate`, `height`, `width` set in [setVideoEncoderConfig](104478#setvideoencoderconfig) for the max stream must match this return value accordingly.
|
|
2714
2758
|
* @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
|
|
2715
|
-
*
|
|
2716
|
-
*
|
|
2717
|
-
* @region Video Management
|
|
2759
|
+
* + 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.
|
|
2760
|
+
* + Call [setVideoCaptureDevice](#setvideocapturedevice) to switch the camera used by the internal video capture module.
|
|
2718
2761
|
*/
|
|
2719
2762
|
startVideoCapture: (deviceId?: string) => Promise<MediaTrackSettings>;
|
|
2720
2763
|
|
|
@@ -2756,8 +2799,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2756
2799
|
* @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
|
|
2757
2800
|
* @param screenConfig Specify properties for the sharing screen.
|
|
2758
2801
|
* @return
|
|
2759
|
-
* @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](#
|
|
2760
|
-
* + To turn off screen video source capture, call [
|
|
2802
|
+
* @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).
|
|
2803
|
+
* + To turn off screen video source capture, call [stopScreenCapture](#stopscreencapture).
|
|
2761
2804
|
* + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
|
|
2762
2805
|
* @region Advanced Feature
|
|
2763
2806
|
*/
|
|
@@ -2766,7 +2809,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2766
2809
|
/**
|
|
2767
2810
|
* @brief Stop screen sharing.
|
|
2768
2811
|
* @return
|
|
2769
|
-
* @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.
|
|
2770
2812
|
* @region Advanced Feature
|
|
2771
2813
|
*/
|
|
2772
2814
|
stopScreenCapture: () => Promise<void>;
|
|
@@ -2784,7 +2826,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2784
2826
|
|
|
2785
2827
|
/**
|
|
2786
2828
|
* @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
|
|
2787
|
-
* It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream) is triggered.
|
|
2829
|
+
* It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream)/[onUserPublishScreen](104479#onuserpublishscreen) is triggered.
|
|
2788
2830
|
* Call this API again with a blank view to unbind the view from the remote video stream.
|
|
2789
2831
|
* @param streamIndex Video stream properties
|
|
2790
2832
|
* @param videoPlayer View information and rendering mode
|
|
@@ -2811,7 +2853,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2811
2853
|
|
|
2812
2854
|
/**
|
|
2813
2855
|
* @brief Play audio and video stream manually.
|
|
2814
|
-
* 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.
|
|
2856
|
+
* 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.
|
|
2815
2857
|
* @param userId ID of the user whose stream is intended to play
|
|
2816
2858
|
* Call this API without a parameter to start playing the local medias.
|
|
2817
2859
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
@@ -2829,7 +2871,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2829
2871
|
* @return
|
|
2830
2872
|
* @notes + Calling this API does not change the capture state and the transmission state of the remote clients.
|
|
2831
2873
|
* + Calling this API does not cancel the subscription or change any subscription configuration.
|
|
2832
|
-
* + To resume, call [resumeAllSubscribedStream](#
|
|
2874
|
+
* + To resume, call [resumeAllSubscribedStream](#resumeallsubscribedstream).
|
|
2833
2875
|
* @region Media Stream Transmission
|
|
2834
2876
|
*/
|
|
2835
2877
|
pauseAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
|
|
@@ -2903,29 +2945,28 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2903
2945
|
* 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.
|
|
2904
2946
|
* The resolutions and the frame rates must be in descending order.
|
|
2905
2947
|
* 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.
|
|
2906
|
-
* @notes + The
|
|
2907
|
-
* +
|
|
2908
|
-
* +
|
|
2948
|
+
* @notes + The default parameters are 640 × 480 px, 15 FPS, with 600 Kbps max bitrate.
|
|
2949
|
+
* + 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.
|
|
2950
|
+
* + 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.
|
|
2951
|
+
* + 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).
|
|
2952
|
+
* + 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.
|
|
2909
2953
|
* + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
|
|
2910
|
-
* @region Video Management
|
|
2911
2954
|
*/
|
|
2912
2955
|
setVideoEncoderConfig: (descriptions: VideoEncoderConfig | VideoEncoderConfig[]) => Promise<void>;
|
|
2913
2956
|
|
|
2914
2957
|
/**
|
|
2915
|
-
* @type api
|
|
2916
|
-
* @author changzhenan
|
|
2917
|
-
* @region Video Management
|
|
2918
2958
|
* @brief Set the encoding configuration of the screen-sharing stream,which is also applied in video capture.
|
|
2919
2959
|
* 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).
|
|
2920
|
-
* @param
|
|
2921
|
-
* @notes +
|
|
2960
|
+
* @param description The encoding configuration of the screen-sharing stream.
|
|
2961
|
+
* @notes + The default parameters are 1920 × 1080 px, 15 FPS, with 3000 Kbps max bitrate.
|
|
2962
|
+
* + We recommend that you set the encoding configuration before video capture. Otherwise, the video will be captured based on the default configuration.
|
|
2922
2963
|
*/
|
|
2923
2964
|
setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
|
|
2924
2965
|
|
|
2925
2966
|
/**
|
|
2926
2967
|
* @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
|
|
2927
|
-
* @param userId
|
|
2928
|
-
* @param remoteVideoConfig
|
|
2968
|
+
* @param userId ID of the remote video stream publisher you expect to configure subscription parameters for.
|
|
2969
|
+
* @param remoteVideoConfig The parameters you expect to configure for the remote video stream.
|
|
2929
2970
|
* @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.
|
|
2930
2971
|
* + 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.
|
|
2931
2972
|
* + 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).
|
|
@@ -2938,7 +2979,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2938
2979
|
* @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.
|
|
2939
2980
|
* @param enabled
|
|
2940
2981
|
* @param + You must call this API before publishing the video streams.
|
|
2941
|
-
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#
|
|
2982
|
+
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setvideoencoderconfig).
|
|
2942
2983
|
*/
|
|
2943
2984
|
enableSimulcastMode: (enabled: boolean) => boolean;
|
|
2944
2985
|
|
|
@@ -2960,8 +3001,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2960
3001
|
* @brief Enable audio information prompts.
|
|
2961
3002
|
* @param config Audio information prompts-related configurations.
|
|
2962
3003
|
* @notes With the prompt on, you can:
|
|
2963
|
-
* + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#
|
|
2964
|
-
* + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#
|
|
3004
|
+
* + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#onlocalaudiopropertiesreport).
|
|
3005
|
+
* + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onremoteaudiopropertiesreport).
|
|
2965
3006
|
* @region Audio Management
|
|
2966
3007
|
*/
|
|
2967
3008
|
enableAudioPropertiesReport: (config?: AudioPropertiesConfig) => void;
|
|
@@ -2978,7 +3019,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2978
3019
|
|
|
2979
3020
|
/**
|
|
2980
3021
|
* @brief Update configuration needed when pushing media streams to CDN.
|
|
2981
|
-
* After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
|
|
3022
|
+
* After calling [startLiveTranscoding](104478#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
|
|
2982
3023
|
* @param transcode Updated configurations. Some of the configurations cannot be updated. See [LiveTranscodeConfig](104481#livetranscodeconfig) for specific indications.
|
|
2983
3024
|
* @return
|
|
2984
3025
|
*/
|
|
@@ -2986,7 +3027,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2986
3027
|
|
|
2987
3028
|
/**
|
|
2988
3029
|
* @brief Stop pushing media streams to CDN
|
|
2989
|
-
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](#startlivetranscoding).
|
|
3030
|
+
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](104478#startlivetranscoding).
|
|
2990
3031
|
* @return
|
|
2991
3032
|
* @region Advanced Feature
|
|
2992
3033
|
*/
|
|
@@ -3003,7 +3044,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3003
3044
|
setBusinessId: (businessId: string) => boolean;
|
|
3004
3045
|
|
|
3005
3046
|
/**
|
|
3006
|
-
* @brief Set user visibility.
|
|
3047
|
+
* @brief Set user visibility. The local user is visible to others by default before calling this API.
|
|
3007
3048
|
* @param enable Visibility of the user in the room:
|
|
3008
3049
|
* + `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.
|
|
3009
3050
|
* + `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.
|
|
@@ -3018,7 +3059,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3018
3059
|
|
|
3019
3060
|
/**
|
|
3020
3061
|
* @brief Set a custom videoTrack as the video source.
|
|
3021
|
-
* Before calling this API, you must call [setVideoSourceType](#setvideosourcetype) to enable custom video capture.
|
|
3062
|
+
* Before calling this API, you must call [setVideoSourceType](104478#setvideosourcetype) to enable custom video capture.
|
|
3022
3063
|
* @param index specify a stream index.
|
|
3023
3064
|
* @param track specify a video track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
3024
3065
|
* @return
|
|
@@ -3028,7 +3069,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3028
3069
|
|
|
3029
3070
|
/**
|
|
3030
3071
|
* @brief Set a custom audioTrack as the audio source.
|
|
3031
|
-
* Before calling this API, you must call [setAudioSourceType](#setaudiosourcetype) to enable custom video capture.
|
|
3072
|
+
* Before calling this API, you must call [setAudioSourceType](104478#setaudiosourcetype) to enable custom video capture.
|
|
3032
3073
|
* @param index specify a stream index.
|
|
3033
3074
|
* @param track specify an audio track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
3034
3075
|
* @return
|
|
@@ -3052,7 +3093,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3052
3093
|
* @param index audio stream index
|
|
3053
3094
|
* @param audioSourceType Type of the module for video capture
|
|
3054
3095
|
* @return
|
|
3055
|
-
* @region Audio Management
|
|
3056
3096
|
*/
|
|
3057
3097
|
setAudioSourceType: (index: StreamIndex, audioSourceType: AudioSourceType) => Promise<void>;
|
|
3058
3098
|
|
|
@@ -3067,16 +3107,19 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3067
3107
|
* @brief Configure the internal audio capture. Different browser has its own default settings.
|
|
3068
3108
|
* @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.
|
|
3069
3109
|
* @return
|
|
3070
|
-
* @
|
|
3110
|
+
* @notes You should call this API before starting audio capture and publishing streams.
|
|
3071
3111
|
*/
|
|
3072
3112
|
setAudioCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
|
|
3073
3113
|
|
|
3074
3114
|
/**
|
|
3115
|
+
* @hidden
|
|
3116
|
+
* @deprecated since v4.51, use setVideoEncoderConfig instead.
|
|
3075
3117
|
* @brief Configure the internal video capture. Different browser has its own default settings.
|
|
3076
3118
|
* @param config Configuration for internal video capture. See [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints).
|
|
3077
3119
|
* 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).
|
|
3078
3120
|
* @return
|
|
3079
|
-
* @note You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
|
|
3121
|
+
* @note + You can call this API after creating the engine. We recommend to call this API before [startVideoCapture](#startvideocapture).
|
|
3122
|
+
* + 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.
|
|
3080
3123
|
*/
|
|
3081
3124
|
setVideoCaptureConfig: (config: TrackCaptureConfig) => Promise<MediaTrackSettings>;
|
|
3082
3125
|
|
|
@@ -3089,7 +3132,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3089
3132
|
* @param userInfo User information.
|
|
3090
3133
|
* @return
|
|
3091
3134
|
* @notes
|
|
3092
|
-
* + Call [logout](
|
|
3135
|
+
* + Call [logout](#logout) to log out the IM server.
|
|
3093
3136
|
* + 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`.
|
|
3094
3137
|
* @region Room Management
|
|
3095
3138
|
*/
|
|
@@ -3114,7 +3157,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3114
3157
|
* @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.
|
|
3115
3158
|
* @param userId ID of the user whose status intended to know
|
|
3116
3159
|
* @return
|
|
3117
|
-
* @notes Call [login](
|
|
3160
|
+
* @notes Call [login](#login) before calling this API.
|
|
3118
3161
|
*/
|
|
3119
3162
|
getPeerOnlineStatus: (userId: string) => Promise<USER_ONLINE_STATUS>;
|
|
3120
3163
|
|
|
@@ -3123,8 +3166,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3123
3166
|
* @param userId ID of the recipient
|
|
3124
3167
|
* @param message Text message within 64 KB.
|
|
3125
3168
|
* @return
|
|
3126
|
-
* @notes + Call [login](
|
|
3127
|
-
* + The recipient must be logged into the server and will receive the text message via [
|
|
3169
|
+
* @notes + Call [login](#login) before calling this API.
|
|
3170
|
+
* + 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.
|
|
3128
3171
|
*/
|
|
3129
3172
|
sendUserMessageOutsideRoom: (userId: string, message: string) => Promise<any>;
|
|
3130
3173
|
|
|
@@ -3139,7 +3182,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3139
3182
|
sendUserBinaryMessageOutsideRoom: (userId: string, message: ArrayBuffer) => Promise<any>;
|
|
3140
3183
|
|
|
3141
3184
|
/**
|
|
3142
|
-
* @brief Set the params of the server before calling [sendServerMessage](#
|
|
3185
|
+
* @brief Set the params of the server before calling [sendServerMessage](104478#sendservermessage) or [sendServerBinaryMessage](104478#sendserverbinarymessage) to send messages to the server.
|
|
3143
3186
|
* @param signature Dynamic signature.
|
|
3144
3187
|
* @param url Address of the IM server
|
|
3145
3188
|
* @return
|
|
@@ -3199,7 +3242,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3199
3242
|
/**
|
|
3200
3243
|
* @hidden
|
|
3201
3244
|
* @brief Update the properties of the public stream published by the current user.
|
|
3202
|
-
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
3245
|
+
* Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
|
|
3203
3246
|
* @param publicStreamId The public stream's ID.
|
|
3204
3247
|
* The public stream must be published by the current user.
|
|
3205
3248
|
* @param publicStreamParam The public stream's parameters.
|
|
@@ -3211,7 +3254,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3211
3254
|
* @hidden
|
|
3212
3255
|
* @type api
|
|
3213
3256
|
* @brief Stops publishing the public stream.
|
|
3214
|
-
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
3257
|
+
* Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
|
|
3215
3258
|
* @param publicStreamId The public stream's ID.
|
|
3216
3259
|
* The public stream must be published by the current user.
|
|
3217
3260
|
* @return
|
|
@@ -3227,6 +3270,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3227
3270
|
* @return
|
|
3228
3271
|
* @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.
|
|
3229
3272
|
* + After calling this API, you will receive [onFirstPublicStreamVideoFrameDecoded](104479#onfirstpublicstreamvideoframedecoded) and [onFirstPublicStreamAudioFrameDecoded](104479#onfirstpublicstreamaudioframedecoded) once the first frame has been decoded.
|
|
3273
|
+
* + If the public stream contains SEI message, you will receive the message by be informed through [onPublicStreamSEIMessageReceived](104479#onpublicstreamseimessagereceived).
|
|
3230
3274
|
* + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
|
|
3231
3275
|
*/
|
|
3232
3276
|
startPlayPublicStream: (publicStreamId: string) => Promise<void>;
|
|
@@ -3234,7 +3278,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3234
3278
|
/**
|
|
3235
3279
|
* @hidden
|
|
3236
3280
|
* @brief Unsubscribes from a designated public stream.
|
|
3237
|
-
* Call [startPlayPublicStream](#startplaypublicstream) to subscribe to the public stream.
|
|
3281
|
+
* Call [startPlayPublicStream](104478#startplaypublicstream) to subscribe to the public stream.
|
|
3238
3282
|
* @param publicStreamId The public stream's ID.
|
|
3239
3283
|
* @return
|
|
3240
3284
|
*/
|
|
@@ -3281,7 +3325,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3281
3325
|
|
|
3282
3326
|
/**
|
|
3283
3327
|
* @brief Set the priority of the remote user's media stream.
|
|
3284
|
-
* Use this API with [setSubscribeFallbackOption](#setsubscribefallbackoption).
|
|
3328
|
+
* Use this API with [setSubscribeFallbackOption](104478#setsubscribefallbackoption).
|
|
3285
3329
|
* With video stream fallback enabled and user priority specified, the stream quality of higher priority user is the last to be compromised.
|
|
3286
3330
|
* @param userId The ID of the remote user
|
|
3287
3331
|
* @param priority The priority of the remote user's media stream
|
|
@@ -3308,12 +3352,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3308
3352
|
|
|
3309
3353
|
/**
|
|
3310
3354
|
* @brief Start the capture and playback test for local audio devices.
|
|
3311
|
-
* 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.
|
|
3355
|
+
* 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.
|
|
3312
3356
|
* @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.
|
|
3313
3357
|
* @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.
|
|
3314
3358
|
* @return Resolve when the test ends.
|
|
3315
3359
|
* @notes + You can call this API whether the user is in a room.
|
|
3316
|
-
* + The audio capturing will stop and begins to play the recording in 30 s after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#
|
|
3360
|
+
* + 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.
|
|
3317
3361
|
* + You must stop the test before starting another test for audio devices.
|
|
3318
3362
|
* + Call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording.
|
|
3319
3363
|
* + This test performs locally and does not involve network connection testing.
|
|
@@ -3322,12 +3366,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3322
3366
|
|
|
3323
3367
|
/**
|
|
3324
3368
|
* @brief Call this API to stop recording in the test and start to play the recording.
|
|
3325
|
-
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
|
|
3369
|
+
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](104478#stopaudiodeviceplaytest) to stop playing.
|
|
3326
3370
|
*/
|
|
3327
3371
|
stopAudioDeviceRecordAndPlayTest: () => void;
|
|
3328
3372
|
|
|
3329
3373
|
/**
|
|
3330
|
-
* @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](#startaudiodevicerecordtest).
|
|
3374
|
+
* @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](104478#startaudiodevicerecordtest).
|
|
3331
3375
|
* Before the test ends by itself, you can call this API to stop the recording or playing.
|
|
3332
3376
|
*/
|
|
3333
3377
|
stopAudioDevicePlayTest: () => void;
|
|
@@ -3335,9 +3379,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3335
3379
|
/**
|
|
3336
3380
|
* @brief Set the sound quality.
|
|
3337
3381
|
* @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.
|
|
3338
|
-
* @notes
|
|
3382
|
+
* @notes You should call this API before starting audio capture and publishing streams.
|
|
3383
|
+
* @return
|
|
3339
3384
|
*/
|
|
3340
|
-
setAudioProfile: (profile: AudioProfileType) => void
|
|
3385
|
+
setAudioProfile: (profile: AudioProfileType) => Promise<void>;
|
|
3341
3386
|
|
|
3342
3387
|
/**
|
|
3343
3388
|
* @brief Get the [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) of the local audios or videos.
|
|
@@ -3363,11 +3408,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3363
3408
|
* @param type Video or audio
|
|
3364
3409
|
* @return `undefined` for the MediaStreamTrack does not exist. For example, the local user has not subscribed to the remote stream.
|
|
3365
3410
|
* @notes + Call this API after the local user subscribe to the remote media stream.
|
|
3366
|
-
* + 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 [
|
|
3411
|
+
* + 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).
|
|
3367
3412
|
* + 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.
|
|
3368
3413
|
* + We recommend to call RTC APIs to enable your app with the following capabilities instead of using mediaStreamTrack.
|
|
3369
|
-
* 1. Get the video resolution or audio volume of the remote streams: [
|
|
3370
|
-
* 2. stop: [
|
|
3414
|
+
* 1. Get the video resolution or audio volume of the remote streams: [onRemoteStreamStats](70081#onremotestreamstats)
|
|
3415
|
+
* 2. stop: [unsubscribeStream](#unsubscribestream), [unsubscribeScreen](#unsubscribescreen)
|
|
3371
3416
|
*/
|
|
3372
3417
|
getRemoteStreamTrack: (userId: string, streamIndex: StreamIndex, type: "video" | "audio") => MediaStreamTrack | undefined;
|
|
3373
3418
|
|
|
@@ -3405,6 +3450,41 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3405
3450
|
* • [AI Noise-Cancelling Extension](https://docs.byteplus.com/byteplus-rtc/docs/148647).
|
|
3406
3451
|
*/
|
|
3407
3452
|
registerExtension: (extension: RTCExtension) => Promise<void>;
|
|
3453
|
+
|
|
3454
|
+
/**
|
|
3455
|
+
* @hidden currently not available
|
|
3456
|
+
* @brief Turns on subtitles.
|
|
3457
|
+
* 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.
|
|
3458
|
+
* After calling this method, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you of whether subtitles are on.
|
|
3459
|
+
* @param config Subtitle configrations.
|
|
3460
|
+
* @return + `0`: Success.
|
|
3461
|
+
* + `!0`: Failure.
|
|
3462
|
+
* @notes
|
|
3463
|
+
* You must call this method after joining the room.
|
|
3464
|
+
* 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.
|
|
3465
|
+
* The language of your browser will be automatically set as the source language if you don't set it.
|
|
3466
|
+
*/
|
|
3467
|
+
startSubtitle: (config: RTCSubtitleConfig) => Promise<void>;
|
|
3468
|
+
|
|
3469
|
+
/**
|
|
3470
|
+
* @hidden currently not available
|
|
3471
|
+
* @brief Turns off subtitles.
|
|
3472
|
+
* After calling this method, you will receive the [onSubtitleStateChanged](104479#onsubtitlestatechanged) to inform you of whether subtitles are off.
|
|
3473
|
+
* @return + `0`: Success.
|
|
3474
|
+
* + `!0`: Failure.
|
|
3475
|
+
*/
|
|
3476
|
+
stopSubtitle: () => void;
|
|
3477
|
+
|
|
3478
|
+
/**
|
|
3479
|
+
* @brief Set whether the remote audio and video streams are rendered synchronously.
|
|
3480
|
+
* You can achieve ultra low latency by turning off the audio and video synchronization.
|
|
3481
|
+
* @param sync `true`: (Default) Turn on sync.
|
|
3482
|
+
* `false`: Turn off sync.
|
|
3483
|
+
* @return + `true`: Success.
|
|
3484
|
+
* + `false`: Failure.
|
|
3485
|
+
* @notes You must call this API before joining the room. Calling it afterward is invalid.
|
|
3486
|
+
*/
|
|
3487
|
+
setRemoteStreamRenderSync: (sync: boolean) => boolean;
|
|
3408
3488
|
}
|
|
3409
3489
|
|
|
3410
3490
|
/**
|
|
@@ -3495,32 +3575,34 @@ export declare enum ChannelProfile {
|
|
|
3495
3575
|
}
|
|
3496
3576
|
|
|
3497
3577
|
/**
|
|
3498
|
-
* @brief Room
|
|
3578
|
+
* @brief Room configurations.
|
|
3499
3579
|
*/
|
|
3500
3580
|
export interface RoomConfig {
|
|
3501
3581
|
|
|
3502
3582
|
/**
|
|
3503
3583
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3504
3584
|
* This does not include the screen stream.
|
|
3505
|
-
* Call
|
|
3585
|
+
* Call [publishStream](104478#publishstream) to publish media streams if you disable `isAutoPublish`.
|
|
3506
3586
|
*/
|
|
3507
3587
|
isAutoPublish?: boolean;
|
|
3508
3588
|
|
|
3509
3589
|
/**
|
|
3510
3590
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3511
3591
|
* This does not include the screen stream.
|
|
3512
|
-
*
|
|
3592
|
+
* You can call [subscribeStream](104478#subscribestream) and [unsubscribeStream](104478#unsubscribestream) to revise the subscription after entering the room.
|
|
3513
3593
|
*/
|
|
3514
3594
|
isAutoSubscribeAudio?: boolean;
|
|
3515
3595
|
|
|
3516
3596
|
/**
|
|
3517
3597
|
* @brief Enable/disable auto-subscribe video. Enable by default.
|
|
3518
3598
|
* This does not include the screen stream.
|
|
3519
|
-
*
|
|
3599
|
+
* You can call [subscribeStream](104478#subscribestream) and [unsubscribeStream](104478#unsubscribestream) to revise the subscription after entering the room.
|
|
3520
3600
|
*/
|
|
3521
3601
|
isAutoSubscribeVideo?: boolean;
|
|
3522
3602
|
|
|
3523
3603
|
/**
|
|
3604
|
+
* @hidden
|
|
3605
|
+
* @deprecated since 4.51, use setAudioProfile instead.
|
|
3524
3606
|
* @brief Room profile
|
|
3525
3607
|
* Choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
|
|
3526
3608
|
* Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
|
|
@@ -3889,22 +3971,25 @@ export interface ScreenConfig {
|
|
|
3889
3971
|
export interface VideoEncoderConfig {
|
|
3890
3972
|
|
|
3891
3973
|
/**
|
|
3892
|
-
* @brief
|
|
3974
|
+
* @brief Video width in pixels. The default value is 640 px。
|
|
3975
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3893
3976
|
*/
|
|
3894
|
-
width:
|
|
3977
|
+
width: ConstrainULong;
|
|
3895
3978
|
|
|
3896
3979
|
/**
|
|
3897
|
-
* @brief
|
|
3980
|
+
* @brief Video height in pixels. The default value is 480 px。
|
|
3981
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3898
3982
|
*/
|
|
3899
|
-
height:
|
|
3983
|
+
height: ConstrainULong;
|
|
3900
3984
|
|
|
3901
3985
|
/**
|
|
3902
|
-
* @brief
|
|
3986
|
+
* @brief Video framerate in FPS. The default value is 15 FPS。
|
|
3987
|
+
* The input can be a number or a [ConstrainDouble](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constraindouble).
|
|
3903
3988
|
*/
|
|
3904
|
-
frameRate:
|
|
3989
|
+
frameRate: ConstrainDouble;
|
|
3905
3990
|
|
|
3906
3991
|
/**
|
|
3907
|
-
* @brief The maximum bitrate(>0
|
|
3992
|
+
* @brief The maximum bitrate in Kbps (>0). The default value is 600 Kbps.
|
|
3908
3993
|
*/
|
|
3909
3994
|
maxKbps: number;
|
|
3910
3995
|
}
|
|
@@ -3915,22 +4000,25 @@ export interface VideoEncoderConfig {
|
|
|
3915
4000
|
export interface ScreenEncoderConfig {
|
|
3916
4001
|
|
|
3917
4002
|
/**
|
|
3918
|
-
* @brief
|
|
4003
|
+
* @brief Video width in pixels. The default value is 1920 px。
|
|
4004
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3919
4005
|
*/
|
|
3920
|
-
width:
|
|
4006
|
+
width: ConstrainULong;
|
|
3921
4007
|
|
|
3922
4008
|
/**
|
|
3923
|
-
* @brief
|
|
4009
|
+
* @brief Video height in pixels. The default value is 1080 px。
|
|
4010
|
+
* The input can be a number or a [ConstrainULong](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constrainulong).
|
|
3924
4011
|
*/
|
|
3925
|
-
height:
|
|
4012
|
+
height: ConstrainULong;
|
|
3926
4013
|
|
|
3927
4014
|
/**
|
|
3928
|
-
* @brief
|
|
4015
|
+
* @brief Video framerate in FPS. The default value is 15 FPS。
|
|
4016
|
+
* The input can be a number or a [ConstrainDouble](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints#constraindouble).
|
|
3929
4017
|
*/
|
|
3930
|
-
frameRate:
|
|
4018
|
+
frameRate: ConstrainDouble;
|
|
3931
4019
|
|
|
3932
4020
|
/**
|
|
3933
|
-
* @brief The maximum bitrate(>0
|
|
4021
|
+
* @brief The maximum bitrate in Kbps (>0). The default value is 3000 Kbps.
|
|
3934
4022
|
*/
|
|
3935
4023
|
maxKbps: number;
|
|
3936
4024
|
|
|
@@ -4113,7 +4201,7 @@ export interface LiveTranscodeLayoutConfig {
|
|
|
4113
4201
|
regions: LiveTranscodeLayoutRegion[];
|
|
4114
4202
|
|
|
4115
4203
|
/**
|
|
4116
|
-
* @brief
|
|
4204
|
+
* @brief The data you need, up to 4KB in length.
|
|
4117
4205
|
*/
|
|
4118
4206
|
appData: string;
|
|
4119
4207
|
|
|
@@ -4577,7 +4665,7 @@ export declare enum AudioProfileType {
|
|
|
4577
4665
|
|
|
4578
4666
|
/**
|
|
4579
4667
|
* @brief Default sound quality
|
|
4580
|
-
* The sound quality
|
|
4668
|
+
* The sound quality set by the server
|
|
4581
4669
|
*/
|
|
4582
4670
|
default = 0,
|
|
4583
4671
|
|
|
@@ -4661,7 +4749,6 @@ export interface EngineConfig {
|
|
|
4661
4749
|
}
|
|
4662
4750
|
|
|
4663
4751
|
/**
|
|
4664
|
-
* @type keytype
|
|
4665
4752
|
* @brief Advanced Audio Coding (AAC) profile.
|
|
4666
4753
|
*/
|
|
4667
4754
|
export declare enum AAC_PROFILE {
|
|
@@ -4698,6 +4785,106 @@ export declare enum TRANSCODING_VIDEO_CODEC {
|
|
|
4698
4785
|
H265 = "H265"
|
|
4699
4786
|
}
|
|
4700
4787
|
|
|
4788
|
+
/**
|
|
4789
|
+
* @brief Subtitle configrations.
|
|
4790
|
+
*/
|
|
4791
|
+
export interface RTCSubtitleConfig {
|
|
4792
|
+
|
|
4793
|
+
/**
|
|
4794
|
+
* @brief Target language.
|
|
4795
|
+
*/
|
|
4796
|
+
targetLanguage?: string;
|
|
4797
|
+
|
|
4798
|
+
/**
|
|
4799
|
+
* @brief Subtitle mode.
|
|
4800
|
+
*/
|
|
4801
|
+
mode: SUBTITLE_MODE;
|
|
4802
|
+
}
|
|
4803
|
+
|
|
4804
|
+
/**
|
|
4805
|
+
* @brief Subtitle mode.
|
|
4806
|
+
*/
|
|
4807
|
+
export declare enum SUBTITLE_MODE {
|
|
4808
|
+
|
|
4809
|
+
/**
|
|
4810
|
+
* @brief The recognition mode. In this mode, the speech of a users in the room will be recognized and converted into captions.
|
|
4811
|
+
*/
|
|
4812
|
+
ASR_ONLY = 0,
|
|
4813
|
+
|
|
4814
|
+
/**
|
|
4815
|
+
* @brief The translation mode. In this mode, the speech of a users in the room will be converted into captions and then translated.
|
|
4816
|
+
*/
|
|
4817
|
+
ASR_AND_TRANSLATION = 1
|
|
4818
|
+
}
|
|
4819
|
+
|
|
4820
|
+
/**
|
|
4821
|
+
* @brief The states of the subtitling task.
|
|
4822
|
+
*/
|
|
4823
|
+
export interface SubtitleEvent {
|
|
4824
|
+
|
|
4825
|
+
/**
|
|
4826
|
+
* @brief Types of the states of the subtitling task.
|
|
4827
|
+
*/
|
|
4828
|
+
event: SubtitleEventType;
|
|
4829
|
+
|
|
4830
|
+
/**
|
|
4831
|
+
* @brief Error codes of the subtitling task.
|
|
4832
|
+
*/
|
|
4833
|
+
errorCode?: ErrorCode;
|
|
4834
|
+
|
|
4835
|
+
/**
|
|
4836
|
+
* @brief Related information about subtitles.
|
|
4837
|
+
*/
|
|
4838
|
+
errorMessage?: string;
|
|
4839
|
+
}
|
|
4840
|
+
|
|
4841
|
+
/**
|
|
4842
|
+
* @brief Types of the states of the subtitling task.
|
|
4843
|
+
*/
|
|
4844
|
+
export declare enum SubtitleEventType {
|
|
4845
|
+
|
|
4846
|
+
/**
|
|
4847
|
+
* @brief Subtitles are on.
|
|
4848
|
+
*/
|
|
4849
|
+
STARTED = 0,
|
|
4850
|
+
|
|
4851
|
+
/**
|
|
4852
|
+
* @brief Subtitles are off.
|
|
4853
|
+
*/
|
|
4854
|
+
STOPPED = 1,
|
|
4855
|
+
|
|
4856
|
+
/**
|
|
4857
|
+
* @brief Errors occurred concerning the subtitling task.
|
|
4858
|
+
*/
|
|
4859
|
+
ERROR = 2
|
|
4860
|
+
}
|
|
4861
|
+
|
|
4862
|
+
/**
|
|
4863
|
+
* @brief Related information about subtitles.
|
|
4864
|
+
*/
|
|
4865
|
+
export interface SubtitleMessage {
|
|
4866
|
+
|
|
4867
|
+
/**
|
|
4868
|
+
* @brief The speaker's ID.
|
|
4869
|
+
*/
|
|
4870
|
+
userId: string;
|
|
4871
|
+
|
|
4872
|
+
/**
|
|
4873
|
+
* @brief Transcribed or translated texts of the speaker's speech, encoded in UTF-8 format.
|
|
4874
|
+
*/
|
|
4875
|
+
text: string;
|
|
4876
|
+
|
|
4877
|
+
/**
|
|
4878
|
+
* @brief Whether transcribed texts are complete sentences. True means yes and False means no.
|
|
4879
|
+
*/
|
|
4880
|
+
definite: boolean;
|
|
4881
|
+
|
|
4882
|
+
/**
|
|
4883
|
+
* @brief Incremental sequence numbers assigned to transcribed or translated texts of the speaker's speech. Complete and incomplete sentences are numbered individually.
|
|
4884
|
+
*/
|
|
4885
|
+
sequence: number;
|
|
4886
|
+
}
|
|
4887
|
+
|
|
4701
4888
|
/**
|
|
4702
4889
|
* @brief Point-to-point text message
|
|
4703
4890
|
*/
|
|
@@ -4793,15 +4980,11 @@ declare const Config: {
|
|
|
4793
4980
|
};
|
|
4794
4981
|
declare function setParameter(key: keyof typeof Config, value: any): void;
|
|
4795
4982
|
declare function getParameter(key: keyof typeof Config): string | boolean | string[];
|
|
4796
|
-
|
|
4797
|
-
* @id VERTC
|
|
4798
|
-
* @list 104477
|
|
4799
|
-
* @detail 104478
|
|
4800
|
-
*/
|
|
4983
|
+
|
|
4801
4984
|
/**
|
|
4802
4985
|
* @id BytePlusRTC
|
|
4803
|
-
* @list
|
|
4804
|
-
* @detail
|
|
4986
|
+
* @list overview
|
|
4987
|
+
* @detail api
|
|
4805
4988
|
*/
|
|
4806
4989
|
export interface IVERTC {
|
|
4807
4990
|
|
|
@@ -4820,7 +5003,7 @@ export interface IVERTC {
|
|
|
4820
5003
|
createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
|
|
4821
5004
|
|
|
4822
5005
|
/**
|
|
4823
|
-
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
|
|
5006
|
+
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](104478#createengine).
|
|
4824
5007
|
* @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.
|
|
4825
5008
|
* @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
|
|
4826
5009
|
* + 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.
|
|
@@ -4837,7 +5020,7 @@ export interface IVERTC {
|
|
|
4837
5020
|
|
|
4838
5021
|
/**
|
|
4839
5022
|
* @brief Call this API to enumerate media devices and their IDs, such as microphones, cameras, and headsets.
|
|
4840
|
-
* Call this API to get deviceId used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice), [startVideoCapture](#startvideocapture), and [startAudioCapture](#startaudiocapture).
|
|
5023
|
+
* Call this API to get deviceId used to specify the device when calling [setAudioPlaybackDevice](104478#setaudioplaybackdevice), [startVideoCapture](104478#startvideocapture), and [startAudioCapture](104478#startaudiocapture).
|
|
4841
5024
|
* @return A list of all media devices.
|
|
4842
5025
|
* @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.
|
|
4843
5026
|
*/
|
|
@@ -4868,7 +5051,7 @@ export interface IVERTC {
|
|
|
4868
5051
|
|
|
4869
5052
|
/**
|
|
4870
5053
|
* @brief Call this API to enumerate microphone devices.
|
|
4871
|
-
* Call this API to get Device IDs used to specify the device when calling [startAudioCapture](#startaudiocapture).
|
|
5054
|
+
* Call this API to get Device IDs used to specify the device when calling [startAudioCapture](104478#startaudiocapture) and [setAudioCaptureDevice](104478#setaudiocapturedevice).
|
|
4872
5055
|
* @return A list including all microphone devices.
|
|
4873
5056
|
* @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.
|
|
4874
5057
|
*/
|
|
@@ -4876,7 +5059,7 @@ export interface IVERTC {
|
|
|
4876
5059
|
|
|
4877
5060
|
/**
|
|
4878
5061
|
* @brief Call this API to enumerate audio and video devices and their IDs, such as microphones, cameras, and headsets.
|
|
4879
|
-
* Call this API to get Device IDs used to specify the device when calling [startVideoCapture](#startvideocapture).
|
|
5062
|
+
* Call this API to get Device IDs used to specify the device when calling [startVideoCapture](104478#startvideocapture) and [setVideoCaptureDevice](104478#setvideocapturedevice).
|
|
4880
5063
|
* @return A list including all camera devices.
|
|
4881
5064
|
* @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.
|
|
4882
5065
|
*/
|
|
@@ -4884,7 +5067,7 @@ export interface IVERTC {
|
|
|
4884
5067
|
|
|
4885
5068
|
/**
|
|
4886
5069
|
* @brief Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
|
|
4887
|
-
* Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](#setaudioplaybackdevice).
|
|
5070
|
+
* Call this API to get Device IDs used to specify the device when calling [setAudioPlaybackDevice](104478#setaudioplaybackdevice).
|
|
4888
5071
|
* @return A list including all audio playback devices.
|
|
4889
5072
|
* @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.
|
|
4890
5073
|
*/
|
|
@@ -4913,18 +5096,18 @@ export interface IVERTC {
|
|
|
4913
5096
|
setLogConfig: ({ logLevel, LogfileSize }: {
|
|
4914
5097
|
|
|
4915
5098
|
/**
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
5099
|
+
* @brief The logging level of local cache.
|
|
5100
|
+
* • `none`: (Default) Turn off logging.
|
|
5101
|
+
* • `error`: Error.
|
|
5102
|
+
* • `warning`: Warning.
|
|
5103
|
+
* • `info`: Information.
|
|
5104
|
+
* • `trace`: Trace.
|
|
5105
|
+
*/
|
|
4923
5106
|
logLevel?: "none" | "error" | "warning" | "info" | "trace";
|
|
4924
5107
|
|
|
4925
5108
|
/**
|
|
4926
|
-
|
|
4927
|
-
|
|
5109
|
+
* @brief The maximum cache space available for logs in MB. the range is 1 to 100 MB, and the default value is 10 MB.
|
|
5110
|
+
*/
|
|
4928
5111
|
LogfileSize?: number;
|
|
4929
5112
|
}) => void;
|
|
4930
5113
|
|
|
@@ -4957,6 +5140,7 @@ declare class VERTC implements IVERTC {
|
|
|
4957
5140
|
ErrorCode: typeof ErrorCode;
|
|
4958
5141
|
platform: string;
|
|
4959
5142
|
private _monitor;
|
|
5143
|
+
private _rtmMonitor;
|
|
4960
5144
|
downloadLog: (key?: string | undefined) => void;
|
|
4961
5145
|
setLogConfig: ({ logLevel, LogfileSize }: {
|
|
4962
5146
|
logLevel?: "none" | "error" | "warning" | "info" | "trace" | undefined;
|