@byteplus/rtc 4.49.5 → 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 +637 -455
- 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,11 +796,16 @@ export interface RTCContext {
|
|
|
776
796
|
video: number;
|
|
777
797
|
};
|
|
778
798
|
};
|
|
799
|
+
activeSimStreams?: boolean[];
|
|
779
800
|
subscribeFallbackOption?: SubscribeFallbackOption;
|
|
780
801
|
userPriority?: Map<string, RemoteUserPriority>;
|
|
781
802
|
avSync: boolean;
|
|
782
803
|
}
|
|
783
804
|
export declare type RTCExtension = any;
|
|
805
|
+
/**
|
|
806
|
+
* 设置到pc上的视频编码参数
|
|
807
|
+
*/
|
|
808
|
+
export declare type VideoEncoderConfig_PC = Pick<VideoEncoderConfig, "maxKbps">;
|
|
784
809
|
declare enum StreamMixingEventType {
|
|
785
810
|
|
|
786
811
|
/**
|
|
@@ -1160,7 +1185,9 @@ export interface LocalVideoStats {
|
|
|
1160
1185
|
encodedFrameCount: number;
|
|
1161
1186
|
|
|
1162
1187
|
/**
|
|
1163
|
-
* @brief
|
|
1188
|
+
* @brief Video codec.
|
|
1189
|
+
* "H264": H.264 video codec.
|
|
1190
|
+
* "VP8": VP8 video codec.
|
|
1164
1191
|
*/
|
|
1165
1192
|
codecType: string;
|
|
1166
1193
|
|
|
@@ -1611,6 +1638,8 @@ declare enum EngineEventsTypes {
|
|
|
1611
1638
|
onVideoStreamBanned = "onVideoStreamBanned",
|
|
1612
1639
|
onAudioStreamBanned = "onAudioStreamBanned",
|
|
1613
1640
|
onLocalVideoSizeChanged = "onLocalVideoSizeChanged",
|
|
1641
|
+
onSubtitleStateChanged = "onSubtitleStateChanged",
|
|
1642
|
+
onSubtitleMessageReceived = "onSubtitleMessageReceived",
|
|
1614
1643
|
onServerParamsSetResult = "onServerParamsSetResult"
|
|
1615
1644
|
}
|
|
1616
1645
|
|
|
@@ -1798,7 +1827,6 @@ export interface LocalAudioPropertiesInfo {
|
|
|
1798
1827
|
streamIndex: StreamIndex;
|
|
1799
1828
|
|
|
1800
1829
|
/**
|
|
1801
|
-
* @type keytype
|
|
1802
1830
|
* @brief Audio information
|
|
1803
1831
|
*/
|
|
1804
1832
|
audioPropertiesInfo: AudioPropertiesInfo;
|
|
@@ -1926,8 +1954,8 @@ declare enum StreamMixingEventErrorCode {
|
|
|
1926
1954
|
|
|
1927
1955
|
/**
|
|
1928
1956
|
* @id EngineEvents
|
|
1929
|
-
* @list
|
|
1930
|
-
* @detail
|
|
1957
|
+
* @list overview
|
|
1958
|
+
* @detail callback
|
|
1931
1959
|
*/
|
|
1932
1960
|
export interface IEngineEvents {
|
|
1933
1961
|
|
|
@@ -1961,7 +1989,7 @@ export interface IEngineEvents {
|
|
|
1961
1989
|
|
|
1962
1990
|
/**
|
|
1963
1991
|
* @brief Callback on new media streams captured by camera/microphone in the room.
|
|
1964
|
-
* @notes You will receive this callback after a remote user successfully publishes media streams captured by camera/microphone in the room with [publishStream](#publishstream). Then you can choose whether to call [subscribeStream](#
|
|
1992
|
+
* @notes You will receive this callback after a remote user successfully publishes media streams captured by camera/microphone in the room with [publishStream](104478#publishstream). Then you can choose whether to call [subscribeStream](104478#subscribestream) to subscribe to the streams or not.
|
|
1965
1993
|
*/
|
|
1966
1994
|
[EngineEventsTypes.onUserPublishStream]: (event: {
|
|
1967
1995
|
|
|
@@ -1978,7 +2006,7 @@ export interface IEngineEvents {
|
|
|
1978
2006
|
|
|
1979
2007
|
/**
|
|
1980
2008
|
* @brief Callback on removal of remote media stream captured by camera/microphone.
|
|
1981
|
-
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [
|
|
2009
|
+
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [unpublishStream](104478#unpublishstream). Then you can choose whether to call [unsubscribeStream](104478#unsubscribestream) to unsubscribe from the streams or not.
|
|
1982
2010
|
*/
|
|
1983
2011
|
[EngineEventsTypes.onUserUnpublishStream]: (event: {
|
|
1984
2012
|
|
|
@@ -2000,7 +2028,7 @@ export interface IEngineEvents {
|
|
|
2000
2028
|
|
|
2001
2029
|
/**
|
|
2002
2030
|
* @brief Callback on new screen sharing media streams from remote users in the room.
|
|
2003
|
-
* @notes You will receive this callback after a remote user successfully published screen sharing streams in the room with [publishScreen](#publishscreen). Then you can choose whether to call [subscribeScreen](#
|
|
2031
|
+
* @notes You will receive this callback after a remote user successfully published screen sharing streams in the room with [publishScreen](104478#publishscreen). Then you can choose whether to call [subscribeScreen](104478#subscribescreen) to subscribe to the streams or not.
|
|
2004
2032
|
*/
|
|
2005
2033
|
[EngineEventsTypes.onUserPublishScreen]: (event: {
|
|
2006
2034
|
|
|
@@ -2017,7 +2045,7 @@ export interface IEngineEvents {
|
|
|
2017
2045
|
|
|
2018
2046
|
/**
|
|
2019
2047
|
* @brief Callback on removal of screen sharing media streams from remote users in the room.
|
|
2020
|
-
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [
|
|
2048
|
+
* @notes You will receive this callback after a remote user successfully unpublishes media streams captured by camera/microphone in the room with [unpublishScreen](104478#unpublishscreen). Then you can choose whether to call [unsubscribeScreen](104478#unsubscribescreen) to unsubscribe from the streams or not.
|
|
2021
2049
|
*/
|
|
2022
2050
|
[EngineEventsTypes.onUserUnpublishScreen]: (event: {
|
|
2023
2051
|
|
|
@@ -2152,7 +2180,7 @@ export interface IEngineEvents {
|
|
|
2152
2180
|
}) => void;
|
|
2153
2181
|
|
|
2154
2182
|
/**
|
|
2155
|
-
* @brief Receiving a point-to-point text message from one of the users in the room by calling [sendUserMessage](104478#
|
|
2183
|
+
* @brief Receiving a point-to-point text message from one of the users in the room by calling [sendUserMessage](104478#sendusermessage)
|
|
2156
2184
|
* @param event
|
|
2157
2185
|
* @region Message Event
|
|
2158
2186
|
*/
|
|
@@ -2203,7 +2231,7 @@ export interface IEngineEvents {
|
|
|
2203
2231
|
}) => void;
|
|
2204
2232
|
|
|
2205
2233
|
/**
|
|
2206
|
-
* @brief After calling [enableAudioPropertiesReport](104478#
|
|
2234
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information about local audio.
|
|
2207
2235
|
* Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms.
|
|
2208
2236
|
* @param event Information about local audio.
|
|
2209
2237
|
* @region Audio Managment
|
|
@@ -2211,7 +2239,7 @@ export interface IEngineEvents {
|
|
|
2211
2239
|
[EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
|
|
2212
2240
|
|
|
2213
2241
|
/**
|
|
2214
|
-
* @brief After calling [enableAudioPropertiesReport](104478#
|
|
2242
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableaudiopropertiesreport), you will periodically receive this callback for the information about the subscribed remote audio streams.
|
|
2215
2243
|
* The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism.
|
|
2216
2244
|
* @param event Information about remote audio.
|
|
2217
2245
|
* @region Audio Management
|
|
@@ -2232,7 +2260,7 @@ export interface IEngineEvents {
|
|
|
2232
2260
|
[EngineEventsTypes.onAudioPlaybackDeviceChanged]: (event: MediaDeviceInfo) => void;
|
|
2233
2261
|
|
|
2234
2262
|
/**
|
|
2235
|
-
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts audio capture by calling [startAudioCapture](104478#
|
|
2263
|
+
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts audio capture by calling [startAudioCapture](104478#startaudiocapture).
|
|
2236
2264
|
* @param event
|
|
2237
2265
|
* @region Audio Management Event
|
|
2238
2266
|
*/
|
|
@@ -2245,7 +2273,7 @@ export interface IEngineEvents {
|
|
|
2245
2273
|
}) => void;
|
|
2246
2274
|
|
|
2247
2275
|
/**
|
|
2248
|
-
* @brief The remote clients in the room will be informed of the state change via this event after the publisher stops audio capture by calling [stopAudioCapture](104478#
|
|
2276
|
+
* @brief The remote clients in the room will be informed of the state change via this event after the publisher stops audio capture by calling [stopAudioCapture](104478#stopaudiocapture).
|
|
2249
2277
|
* @param event
|
|
2250
2278
|
* @region Room Management Event
|
|
2251
2279
|
*/
|
|
@@ -2258,7 +2286,7 @@ export interface IEngineEvents {
|
|
|
2258
2286
|
}) => void;
|
|
2259
2287
|
|
|
2260
2288
|
/**
|
|
2261
|
-
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts video capture by calling [startVideoCapture](104478#
|
|
2289
|
+
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts video capture by calling [startVideoCapture](104478#startvideocapture).
|
|
2262
2290
|
* @param event
|
|
2263
2291
|
* @region Room Management Event
|
|
2264
2292
|
*/
|
|
@@ -2271,7 +2299,7 @@ export interface IEngineEvents {
|
|
|
2271
2299
|
}) => void;
|
|
2272
2300
|
|
|
2273
2301
|
/**
|
|
2274
|
-
The remote clients in the room will be informed of the state change via this event after the publisher stops video capture by calling [stopVideoCapture](104478#
|
|
2302
|
+
The remote clients in the room will be informed of the state change via this event after the publisher stops video capture by calling [stopVideoCapture](104478#stopvideocapture).
|
|
2275
2303
|
* @param event
|
|
2276
2304
|
* @region Room Management Event
|
|
2277
2305
|
*/
|
|
@@ -2388,7 +2416,7 @@ export interface IEngineEvents {
|
|
|
2388
2416
|
[EngineEventsTypes.onTokenWillExpire]: () => void;
|
|
2389
2417
|
|
|
2390
2418
|
/**
|
|
2391
|
-
* @brief Receives the callback when you call [startCloudProxy](104478#
|
|
2419
|
+
* @brief Receives the callback when you call [startCloudProxy](104478#startcloudproxy) to start cloud proxy, and the SDK connects the proxy server successfully.
|
|
2392
2420
|
* @param event
|
|
2393
2421
|
*/
|
|
2394
2422
|
[EngineEventsTypes.onCloudProxyConnected]: (event: CloudProxyConnectedEvent) => void;
|
|
@@ -2538,19 +2566,36 @@ export interface IEngineEvents {
|
|
|
2538
2566
|
};
|
|
2539
2567
|
}) => void;
|
|
2540
2568
|
|
|
2569
|
+
/**
|
|
2570
|
+
* @hidden currently not available
|
|
2571
|
+
* @brief Callback on subtitle states.
|
|
2572
|
+
* After you call [startSubtitle](104478#startsubtitle) and [stopSubtitle](104478#stopsubtitle), you will receive this callback which informs you of the states and error codes of the subtitling task, as well as detailed information on the third party services' errors.
|
|
2573
|
+
* @param event
|
|
2574
|
+
*/
|
|
2575
|
+
[EngineEventsTypes.onSubtitleStateChanged]: (e: SubtitleEvent) => void;
|
|
2576
|
+
|
|
2577
|
+
/**
|
|
2578
|
+
* @hidden currently not available
|
|
2579
|
+
* @brief Callback on subtitle messages.
|
|
2580
|
+
* After calling [startSubtitle](104478#startsubtitle) successfully, you will receive this callback which informs you of the related information on subtitles.
|
|
2581
|
+
* @param event
|
|
2582
|
+
*/
|
|
2583
|
+
[EngineEventsTypes.onSubtitleMessageReceived]: (e: SubtitleMessage[]) => void;
|
|
2584
|
+
|
|
2541
2585
|
/**
|
|
2542
2586
|
* @brief Event of whether the setting for the message server successes
|
|
2543
2587
|
* @param error Error code
|
|
2544
|
-
* @notes + This event notifies you the result after the call of [setServerParams](104478#
|
|
2545
|
-
* + If the client losts connection after the call of [setServerParams](104478#
|
|
2588
|
+
* @notes + This event notifies you the result after the call of [setServerParams](104478#setserverparams).
|
|
2589
|
+
* + If the client losts connection after the call of [setServerParams](104478#setserverparams) this event notifies once the client reconnects.
|
|
2546
2590
|
*/
|
|
2547
2591
|
[EngineEventsTypes.onServerParamsSetResult]: (error?: ErrorCode) => void;
|
|
2548
2592
|
}
|
|
2549
2593
|
|
|
2550
2594
|
/**
|
|
2551
2595
|
* @id RTCEngine
|
|
2552
|
-
*
|
|
2553
|
-
* @
|
|
2596
|
+
* <span id="irtcengine"></span>
|
|
2597
|
+
* @list overview
|
|
2598
|
+
* @detail api
|
|
2554
2599
|
*/
|
|
2555
2600
|
export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
2556
2601
|
|
|
@@ -2558,7 +2603,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2558
2603
|
* @brief Join the room.
|
|
2559
2604
|
* Call this method to join the room and make audio & video calls with other users in the room.
|
|
2560
2605
|
* @param token Dynamic key. It is used for authentication and verification of users entering the room.
|
|
2561
|
-
* You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level.
|
|
2606
|
+
* You need to bring Token to enter the room. When testing, you can use the console to generate temporary tokens. The official launch requires the use of the key SDK to generate and issue tokens at your server level. See [Use Token to complete authentication](70121) for token validity and generation method.
|
|
2562
2607
|
* Apps with different AppIDs are not interoperable.
|
|
2563
2608
|
* Make sure that the AppID used to generate the Token is the same as the AppID used to create the engine, otherwise it will cause the join room to fail.
|
|
2564
2609
|
* @param roomId The ID of the room to be added.
|
|
@@ -2572,7 +2617,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2572
2617
|
* @return
|
|
2573
2618
|
* @notes + In the same room with the same App ID, the user ID of each user must be unique. The user will be kicked out of the room when a user with the same userID joins the room because of the error of `DUPLICATE_LOGIN`.
|
|
2574
2619
|
* + Remote users will receive [onUserJoined](104479#onuserjoined) callback when a visible user joins the room. Call [setUserVisibility](#setuservisibility) to switch the visibility of the user.
|
|
2575
|
-
* + RTC SDK will try reconnect after losing connection to the server caused by a poor network connection. The remote user will receive [onUserJoined](104479#onuserjoined) if a visible user reconnected successfully.
|
|
2620
|
+
* + RTC SDK will try reconnect after losing connection to the server caused by a poor network connection. At this point, [onConnectionStateChanged](104479#onConnectionStateChanged) callback will be triggered and the SDK will automatically retry until it successfully reconnects to the server. The remote user will receive [onUserJoined](104479#onuserjoined) if a visible user reconnected successfully.
|
|
2576
2621
|
* @region Room Management
|
|
2577
2622
|
*/
|
|
2578
2623
|
joinRoom: (token: string | null, roomId: string, userInfo: UserInfo, roomConfig?: RoomConfig) => Promise<void>;
|
|
@@ -2589,7 +2634,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2589
2634
|
/**
|
|
2590
2635
|
* @hidden
|
|
2591
2636
|
* @brief Destroy engine
|
|
2592
|
-
* 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.
|
|
2593
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.
|
|
2594
2639
|
* + Calling this API will destroy all memory related to this `RTCEngine` instance, and stop any interaction with the media server.
|
|
2595
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.
|
|
@@ -2600,8 +2645,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2600
2645
|
/**
|
|
2601
2646
|
* @brief Publishes media streams captured by camera/microphone in the current room.
|
|
2602
2647
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
2603
|
-
* @notes +
|
|
2604
|
-
* + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2648
|
+
* @notes + An invisible user cannot publish media streams. Call [setUserVisibility](#setuservisibility) to change your visibility in the room.
|
|
2605
2649
|
* + Call [publishScreen](#publishscreen) to start screen sharing.
|
|
2606
2650
|
* + After you call this API, the other users in the room will receive [onUserPublishStream](104479#onuserpublishstream).
|
|
2607
2651
|
* + Call [unpublishStream](#unpublishstream) to stop publishing streams.
|
|
@@ -2707,15 +2751,13 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2707
2751
|
|
|
2708
2752
|
/**
|
|
2709
2753
|
* @brief Enable internal video capture. The default state is off.
|
|
2710
|
-
*
|
|
2711
|
-
*
|
|
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.
|
|
2712
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.
|
|
2713
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`.
|
|
2714
|
-
* The `frameRate`, `height`, `width` set in [setVideoEncoderConfig](104478#setvideoencoderconfig) for the max stream must match this return value accordingly.
|
|
2715
2758
|
* @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.
|
|
2716
|
-
*
|
|
2717
|
-
*
|
|
2718
|
-
* @region Video Management
|
|
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.
|
|
2719
2761
|
*/
|
|
2720
2762
|
startVideoCapture: (deviceId?: string) => Promise<MediaTrackSettings>;
|
|
2721
2763
|
|
|
@@ -2757,8 +2799,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2757
2799
|
* @brief Use the capture module provided by the RTC SDK to capture the current screen stream for sharing.
|
|
2758
2800
|
* @param screenConfig Specify properties for the sharing screen.
|
|
2759
2801
|
* @return
|
|
2760
|
-
* @notes + Call this API will start screen stream video capture but will not publish the captured video. Publishing a screen-sharing stream by calling [publishScreen](#
|
|
2761
|
-
* + To turn off screen video source capture, call [
|
|
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).
|
|
2762
2804
|
* + Before calling this API, you can call [setVideoEncoderConfig](#setvideoencoderconfig) to set the capture frame rate and encoding resolution of the screen video stream.
|
|
2763
2805
|
* @region Advanced Feature
|
|
2764
2806
|
*/
|
|
@@ -2767,7 +2809,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2767
2809
|
/**
|
|
2768
2810
|
* @brief Stop screen sharing.
|
|
2769
2811
|
* @return
|
|
2770
|
-
* @notes If the stream has been published, the other users in the room will receive the [onStreamRemove](104479#onstreamremove) event after the user stop screen sharing by calling this API.
|
|
2771
2812
|
* @region Advanced Feature
|
|
2772
2813
|
*/
|
|
2773
2814
|
stopScreenCapture: () => Promise<void>;
|
|
@@ -2785,7 +2826,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2785
2826
|
|
|
2786
2827
|
/**
|
|
2787
2828
|
* @brief Bind a view to the remote media stream and set the rendering mode for the rendering of the remote stream
|
|
2788
|
-
* It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream) is triggered.
|
|
2829
|
+
* It's recommended to call this API and bind a view once the event of [onUserPublishStream](104479#onuserpublishstream)/[onUserPublishScreen](104479#onuserpublishscreen) is triggered.
|
|
2789
2830
|
* Call this API again with a blank view to unbind the view from the remote video stream.
|
|
2790
2831
|
* @param streamIndex Video stream properties
|
|
2791
2832
|
* @param videoPlayer View information and rendering mode
|
|
@@ -2812,7 +2853,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2812
2853
|
|
|
2813
2854
|
/**
|
|
2814
2855
|
* @brief Play audio and video stream manually.
|
|
2815
|
-
* Call this API when user need to take part in the audio and video reaction after calling [createEngine](#createengine) and set to autoPlay to False.
|
|
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.
|
|
2816
2857
|
* @param userId ID of the user whose stream is intended to play
|
|
2817
2858
|
* Call this API without a parameter to start playing the local medias.
|
|
2818
2859
|
* @param mediaType Media stream type, used for specifying whether to publish audio stream or video stream.
|
|
@@ -2830,7 +2871,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2830
2871
|
* @return
|
|
2831
2872
|
* @notes + Calling this API does not change the capture state and the transmission state of the remote clients.
|
|
2832
2873
|
* + Calling this API does not cancel the subscription or change any subscription configuration.
|
|
2833
|
-
* + To resume, call [resumeAllSubscribedStream](#
|
|
2874
|
+
* + To resume, call [resumeAllSubscribedStream](#resumeallsubscribedstream).
|
|
2834
2875
|
* @region Media Stream Transmission
|
|
2835
2876
|
*/
|
|
2836
2877
|
pauseAllSubscribedStream: (mediaType: MediaType) => Promise<void>;
|
|
@@ -2904,29 +2945,28 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2904
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.
|
|
2905
2946
|
* The resolutions and the frame rates must be in descending order.
|
|
2906
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.
|
|
2907
|
-
* @notes + The
|
|
2908
|
-
* +
|
|
2909
|
-
* +
|
|
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.
|
|
2910
2953
|
* + This API is applicable to the video stream captured by the camera, see [setScreenEncoderConfig](#setscreenencoderconfig) for setting parameters for screen sharing video stream.
|
|
2911
|
-
* @region Video Management
|
|
2912
2954
|
*/
|
|
2913
2955
|
setVideoEncoderConfig: (descriptions: VideoEncoderConfig | VideoEncoderConfig[]) => Promise<void>;
|
|
2914
2956
|
|
|
2915
2957
|
/**
|
|
2916
|
-
* @type api
|
|
2917
|
-
* @author changzhenan
|
|
2918
|
-
* @region Video Management
|
|
2919
2958
|
* @brief Set the encoding configuration of the screen-sharing stream,which is also applied in video capture.
|
|
2920
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).
|
|
2921
|
-
* @param
|
|
2922
|
-
* @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.
|
|
2923
2963
|
*/
|
|
2924
2964
|
setScreenEncoderConfig: (description: ScreenEncoderConfig) => Promise<void>;
|
|
2925
2965
|
|
|
2926
2966
|
/**
|
|
2927
2967
|
* @brief Sets your expected configuration of the remote video stream that you want to subscribe to or have subscribed to.
|
|
2928
|
-
* @param userId
|
|
2929
|
-
* @param remoteVideoConfig
|
|
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.
|
|
2930
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.
|
|
2931
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.
|
|
2932
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).
|
|
@@ -2939,7 +2979,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2939
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.
|
|
2940
2980
|
* @param enabled
|
|
2941
2981
|
* @param + You must call this API before publishing the video streams.
|
|
2942
|
-
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#
|
|
2982
|
+
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setvideoencoderconfig).
|
|
2943
2983
|
*/
|
|
2944
2984
|
enableSimulcastMode: (enabled: boolean) => boolean;
|
|
2945
2985
|
|
|
@@ -2961,8 +3001,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2961
3001
|
* @brief Enable audio information prompts.
|
|
2962
3002
|
* @param config Audio information prompts-related configurations.
|
|
2963
3003
|
* @notes With the prompt on, you can:
|
|
2964
|
-
* + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#
|
|
2965
|
-
* + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#
|
|
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).
|
|
2966
3006
|
* @region Audio Management
|
|
2967
3007
|
*/
|
|
2968
3008
|
enableAudioPropertiesReport: (config?: AudioPropertiesConfig) => void;
|
|
@@ -2979,7 +3019,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2979
3019
|
|
|
2980
3020
|
/**
|
|
2981
3021
|
* @brief Update configuration needed when pushing media streams to CDN.
|
|
2982
|
-
* After calling [startLiveTranscoding](#startlivetranscoding) to enable the function of pushing streams to CDN, you can call this API to update the relevant configurations.
|
|
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.
|
|
2983
3023
|
* @param transcode Updated configurations. Some of the configurations cannot be updated. See [LiveTranscodeConfig](104481#livetranscodeconfig) for specific indications.
|
|
2984
3024
|
* @return
|
|
2985
3025
|
*/
|
|
@@ -2987,7 +3027,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2987
3027
|
|
|
2988
3028
|
/**
|
|
2989
3029
|
* @brief Stop pushing media streams to CDN
|
|
2990
|
-
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](#startlivetranscoding).
|
|
3030
|
+
* For starting pushing media streams to CDN. Refer to [startLiveTranscoding](104478#startlivetranscoding).
|
|
2991
3031
|
* @return
|
|
2992
3032
|
* @region Advanced Feature
|
|
2993
3033
|
*/
|
|
@@ -3004,7 +3044,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3004
3044
|
setBusinessId: (businessId: string) => boolean;
|
|
3005
3045
|
|
|
3006
3046
|
/**
|
|
3007
|
-
* @brief Set user visibility.
|
|
3047
|
+
* @brief Set user visibility. The local user is visible to others by default before calling this API.
|
|
3008
3048
|
* @param enable Visibility of the user in the room:
|
|
3009
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.
|
|
3010
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.
|
|
@@ -3019,7 +3059,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3019
3059
|
|
|
3020
3060
|
/**
|
|
3021
3061
|
* @brief Set a custom videoTrack as the video source.
|
|
3022
|
-
* 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.
|
|
3023
3063
|
* @param index specify a stream index.
|
|
3024
3064
|
* @param track specify a video track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
3025
3065
|
* @return
|
|
@@ -3029,7 +3069,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3029
3069
|
|
|
3030
3070
|
/**
|
|
3031
3071
|
* @brief Set a custom audioTrack as the audio source.
|
|
3032
|
-
* 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.
|
|
3033
3073
|
* @param index specify a stream index.
|
|
3034
3074
|
* @param track specify an audio track. See [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack).
|
|
3035
3075
|
* @return
|
|
@@ -3053,7 +3093,6 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3053
3093
|
* @param index audio stream index
|
|
3054
3094
|
* @param audioSourceType Type of the module for video capture
|
|
3055
3095
|
* @return
|
|
3056
|
-
* @region Audio Management
|
|
3057
3096
|
*/
|
|
3058
3097
|
setAudioSourceType: (index: StreamIndex, audioSourceType: AudioSourceType) => Promise<void>;
|
|
3059
3098
|
|
|
@@ -3068,16 +3107,19 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3068
3107
|
* @brief Configure the internal audio capture. Different browser has its own default settings.
|
|
3069
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.
|
|
3070
3109
|
* @return
|
|
3071
|
-
* @
|
|
3110
|
+
* @notes You should call this API before starting audio capture and publishing streams.
|
|
3072
3111
|
*/
|
|
3073
3112
|
setAudioCaptureConfig: (config: TrackCaptureConfig) => Promise<void>;
|
|
3074
3113
|
|
|
3075
3114
|
/**
|
|
3115
|
+
* @hidden
|
|
3116
|
+
* @deprecated since v4.51, use setVideoEncoderConfig instead.
|
|
3076
3117
|
* @brief Configure the internal video capture. Different browser has its own default settings.
|
|
3077
3118
|
* @param config Configuration for internal video capture. See [MediaTrackConstraints](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints).
|
|
3078
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).
|
|
3079
3120
|
* @return
|
|
3080
|
-
* @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.
|
|
3081
3123
|
*/
|
|
3082
3124
|
setVideoCaptureConfig: (config: TrackCaptureConfig) => Promise<MediaTrackSettings>;
|
|
3083
3125
|
|
|
@@ -3090,7 +3132,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3090
3132
|
* @param userInfo User information.
|
|
3091
3133
|
* @return
|
|
3092
3134
|
* @notes
|
|
3093
|
-
* + Call [logout](
|
|
3135
|
+
* + Call [logout](#logout) to log out the IM server.
|
|
3094
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`.
|
|
3095
3137
|
* @region Room Management
|
|
3096
3138
|
*/
|
|
@@ -3115,7 +3157,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3115
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.
|
|
3116
3158
|
* @param userId ID of the user whose status intended to know
|
|
3117
3159
|
* @return
|
|
3118
|
-
* @notes Call [login](
|
|
3160
|
+
* @notes Call [login](#login) before calling this API.
|
|
3119
3161
|
*/
|
|
3120
3162
|
getPeerOnlineStatus: (userId: string) => Promise<USER_ONLINE_STATUS>;
|
|
3121
3163
|
|
|
@@ -3124,8 +3166,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3124
3166
|
* @param userId ID of the recipient
|
|
3125
3167
|
* @param message Text message within 64 KB.
|
|
3126
3168
|
* @return
|
|
3127
|
-
* @notes + Call [login](
|
|
3128
|
-
* + 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.
|
|
3129
3171
|
*/
|
|
3130
3172
|
sendUserMessageOutsideRoom: (userId: string, message: string) => Promise<any>;
|
|
3131
3173
|
|
|
@@ -3140,7 +3182,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3140
3182
|
sendUserBinaryMessageOutsideRoom: (userId: string, message: ArrayBuffer) => Promise<any>;
|
|
3141
3183
|
|
|
3142
3184
|
/**
|
|
3143
|
-
* @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.
|
|
3144
3186
|
* @param signature Dynamic signature.
|
|
3145
3187
|
* @param url Address of the IM server
|
|
3146
3188
|
* @return
|
|
@@ -3200,7 +3242,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3200
3242
|
/**
|
|
3201
3243
|
* @hidden
|
|
3202
3244
|
* @brief Update the properties of the public stream published by the current user.
|
|
3203
|
-
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
3245
|
+
* Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
|
|
3204
3246
|
* @param publicStreamId The public stream's ID.
|
|
3205
3247
|
* The public stream must be published by the current user.
|
|
3206
3248
|
* @param publicStreamParam The public stream's parameters.
|
|
@@ -3212,7 +3254,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3212
3254
|
* @hidden
|
|
3213
3255
|
* @type api
|
|
3214
3256
|
* @brief Stops publishing the public stream.
|
|
3215
|
-
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
3257
|
+
* Call [startPushPublicStream](104478#startpushpublicstream) to start publishing a public stream.
|
|
3216
3258
|
* @param publicStreamId The public stream's ID.
|
|
3217
3259
|
* The public stream must be published by the current user.
|
|
3218
3260
|
* @return
|
|
@@ -3228,6 +3270,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3228
3270
|
* @return
|
|
3229
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.
|
|
3230
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).
|
|
3231
3274
|
* + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
|
|
3232
3275
|
*/
|
|
3233
3276
|
startPlayPublicStream: (publicStreamId: string) => Promise<void>;
|
|
@@ -3235,7 +3278,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3235
3278
|
/**
|
|
3236
3279
|
* @hidden
|
|
3237
3280
|
* @brief Unsubscribes from a designated public stream.
|
|
3238
|
-
* Call [startPlayPublicStream](#startplaypublicstream) to subscribe to the public stream.
|
|
3281
|
+
* Call [startPlayPublicStream](104478#startplaypublicstream) to subscribe to the public stream.
|
|
3239
3282
|
* @param publicStreamId The public stream's ID.
|
|
3240
3283
|
* @return
|
|
3241
3284
|
*/
|
|
@@ -3282,7 +3325,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3282
3325
|
|
|
3283
3326
|
/**
|
|
3284
3327
|
* @brief Set the priority of the remote user's media stream.
|
|
3285
|
-
* Use this API with [setSubscribeFallbackOption](#setsubscribefallbackoption).
|
|
3328
|
+
* Use this API with [setSubscribeFallbackOption](104478#setsubscribefallbackoption).
|
|
3286
3329
|
* With video stream fallback enabled and user priority specified, the stream quality of higher priority user is the last to be compromised.
|
|
3287
3330
|
* @param userId The ID of the remote user
|
|
3288
3331
|
* @param priority The priority of the remote user's media stream
|
|
@@ -3309,12 +3352,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3309
3352
|
|
|
3310
3353
|
/**
|
|
3311
3354
|
* @brief Start the capture and playback test for local audio devices.
|
|
3312
|
-
* We recommend to register [onLocalAudioPropertiesReport](104479#onlocalaudiopropertiesreport) callback via [enableAudioPropertiesReport](enableaudiopropertiesreport). Once the test starts, you can get the volume of the capturing audio by this callback.
|
|
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.
|
|
3313
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.
|
|
3314
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.
|
|
3315
3358
|
* @return Resolve when the test ends.
|
|
3316
3359
|
* @notes + You can call this API whether the user is in a room.
|
|
3317
|
-
* + The audio capturing will stop and begins to play the recording in 30 s after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#
|
|
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.
|
|
3318
3361
|
* + You must stop the test before starting another test for audio devices.
|
|
3319
3362
|
* + Call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop the test, including capturing and playing the recording.
|
|
3320
3363
|
* + This test performs locally and does not involve network connection testing.
|
|
@@ -3323,12 +3366,12 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3323
3366
|
|
|
3324
3367
|
/**
|
|
3325
3368
|
* @brief Call this API to stop recording in the test and start to play the recording.
|
|
3326
|
-
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](#stopaudiodeviceplaytest) to stop playing.
|
|
3369
|
+
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDevicePlayTest](104478#stopaudiodeviceplaytest) to stop playing.
|
|
3327
3370
|
*/
|
|
3328
3371
|
stopAudioDeviceRecordAndPlayTest: () => void;
|
|
3329
3372
|
|
|
3330
3373
|
/**
|
|
3331
|
-
* @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).
|
|
3332
3375
|
* Before the test ends by itself, you can call this API to stop the recording or playing.
|
|
3333
3376
|
*/
|
|
3334
3377
|
stopAudioDevicePlayTest: () => void;
|
|
@@ -3336,9 +3379,10 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3336
3379
|
/**
|
|
3337
3380
|
* @brief Set the sound quality.
|
|
3338
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.
|
|
3339
|
-
* @notes
|
|
3382
|
+
* @notes You should call this API before starting audio capture and publishing streams.
|
|
3383
|
+
* @return
|
|
3340
3384
|
*/
|
|
3341
|
-
setAudioProfile: (profile: AudioProfileType) => void
|
|
3385
|
+
setAudioProfile: (profile: AudioProfileType) => Promise<void>;
|
|
3342
3386
|
|
|
3343
3387
|
/**
|
|
3344
3388
|
* @brief Get the [MediaStreamTrack](https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack) of the local audios or videos.
|
|
@@ -3364,11 +3408,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3364
3408
|
* @param type Video or audio
|
|
3365
3409
|
* @return `undefined` for the MediaStreamTrack does not exist. For example, the local user has not subscribed to the remote stream.
|
|
3366
3410
|
* @notes + Call this API after the local user subscribe to the remote media stream.
|
|
3367
|
-
* + Callback of the MediaStreamTrack will inform you by the event of `ended` that the remote media stream stops, probably caused by the API call of [
|
|
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).
|
|
3368
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.
|
|
3369
3413
|
* + We recommend to call RTC APIs to enable your app with the following capabilities instead of using mediaStreamTrack.
|
|
3370
|
-
* 1. Get the video resolution or audio volume of the remote streams: [
|
|
3371
|
-
* 2. stop: [
|
|
3414
|
+
* 1. Get the video resolution or audio volume of the remote streams: [onRemoteStreamStats](70081#onremotestreamstats)
|
|
3415
|
+
* 2. stop: [unsubscribeStream](#unsubscribestream), [unsubscribeScreen](#unsubscribescreen)
|
|
3372
3416
|
*/
|
|
3373
3417
|
getRemoteStreamTrack: (userId: string, streamIndex: StreamIndex, type: "video" | "audio") => MediaStreamTrack | undefined;
|
|
3374
3418
|
|
|
@@ -3406,7 +3450,41 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
3406
3450
|
* • [AI Noise-Cancelling Extension](https://docs.byteplus.com/byteplus-rtc/docs/148647).
|
|
3407
3451
|
*/
|
|
3408
3452
|
registerExtension: (extension: RTCExtension) => Promise<void>;
|
|
3409
|
-
|
|
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;
|
|
3410
3488
|
}
|
|
3411
3489
|
|
|
3412
3490
|
/**
|
|
@@ -3497,32 +3575,34 @@ export declare enum ChannelProfile {
|
|
|
3497
3575
|
}
|
|
3498
3576
|
|
|
3499
3577
|
/**
|
|
3500
|
-
* @brief Room
|
|
3578
|
+
* @brief Room configurations.
|
|
3501
3579
|
*/
|
|
3502
3580
|
export interface RoomConfig {
|
|
3503
3581
|
|
|
3504
3582
|
/**
|
|
3505
3583
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3506
3584
|
* This does not include the screen stream.
|
|
3507
|
-
* Call
|
|
3585
|
+
* Call [publishStream](104478#publishstream) to publish media streams if you disable `isAutoPublish`.
|
|
3508
3586
|
*/
|
|
3509
3587
|
isAutoPublish?: boolean;
|
|
3510
3588
|
|
|
3511
3589
|
/**
|
|
3512
3590
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3513
3591
|
* This does not include the screen stream.
|
|
3514
|
-
*
|
|
3592
|
+
* You can call [subscribeStream](104478#subscribestream) and [unsubscribeStream](104478#unsubscribestream) to revise the subscription after entering the room.
|
|
3515
3593
|
*/
|
|
3516
3594
|
isAutoSubscribeAudio?: boolean;
|
|
3517
3595
|
|
|
3518
3596
|
/**
|
|
3519
3597
|
* @brief Enable/disable auto-subscribe video. Enable by default.
|
|
3520
3598
|
* This does not include the screen stream.
|
|
3521
|
-
*
|
|
3599
|
+
* You can call [subscribeStream](104478#subscribestream) and [unsubscribeStream](104478#unsubscribestream) to revise the subscription after entering the room.
|
|
3522
3600
|
*/
|
|
3523
3601
|
isAutoSubscribeVideo?: boolean;
|
|
3524
3602
|
|
|
3525
3603
|
/**
|
|
3604
|
+
* @hidden
|
|
3605
|
+
* @deprecated since 4.51, use setAudioProfile instead.
|
|
3526
3606
|
* @brief Room profile
|
|
3527
3607
|
* Choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
|
|
3528
3608
|
* Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
|
|
@@ -3891,22 +3971,25 @@ export interface ScreenConfig {
|
|
|
3891
3971
|
export interface VideoEncoderConfig {
|
|
3892
3972
|
|
|
3893
3973
|
/**
|
|
3894
|
-
* @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).
|
|
3895
3976
|
*/
|
|
3896
|
-
width:
|
|
3977
|
+
width: ConstrainULong;
|
|
3897
3978
|
|
|
3898
3979
|
/**
|
|
3899
|
-
* @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).
|
|
3900
3982
|
*/
|
|
3901
|
-
height:
|
|
3983
|
+
height: ConstrainULong;
|
|
3902
3984
|
|
|
3903
3985
|
/**
|
|
3904
|
-
* @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).
|
|
3905
3988
|
*/
|
|
3906
|
-
frameRate:
|
|
3989
|
+
frameRate: ConstrainDouble;
|
|
3907
3990
|
|
|
3908
3991
|
/**
|
|
3909
|
-
* @brief The maximum bitrate(>0
|
|
3992
|
+
* @brief The maximum bitrate in Kbps (>0). The default value is 600 Kbps.
|
|
3910
3993
|
*/
|
|
3911
3994
|
maxKbps: number;
|
|
3912
3995
|
}
|
|
@@ -3917,22 +4000,25 @@ export interface VideoEncoderConfig {
|
|
|
3917
4000
|
export interface ScreenEncoderConfig {
|
|
3918
4001
|
|
|
3919
4002
|
/**
|
|
3920
|
-
* @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).
|
|
3921
4005
|
*/
|
|
3922
|
-
width:
|
|
4006
|
+
width: ConstrainULong;
|
|
3923
4007
|
|
|
3924
4008
|
/**
|
|
3925
|
-
* @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).
|
|
3926
4011
|
*/
|
|
3927
|
-
height:
|
|
4012
|
+
height: ConstrainULong;
|
|
3928
4013
|
|
|
3929
4014
|
/**
|
|
3930
|
-
* @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).
|
|
3931
4017
|
*/
|
|
3932
|
-
frameRate:
|
|
4018
|
+
frameRate: ConstrainDouble;
|
|
3933
4019
|
|
|
3934
4020
|
/**
|
|
3935
|
-
* @brief The maximum bitrate(>0
|
|
4021
|
+
* @brief The maximum bitrate in Kbps (>0). The default value is 3000 Kbps.
|
|
3936
4022
|
*/
|
|
3937
4023
|
maxKbps: number;
|
|
3938
4024
|
|
|
@@ -4115,7 +4201,7 @@ export interface LiveTranscodeLayoutConfig {
|
|
|
4115
4201
|
regions: LiveTranscodeLayoutRegion[];
|
|
4116
4202
|
|
|
4117
4203
|
/**
|
|
4118
|
-
* @brief
|
|
4204
|
+
* @brief The data you need, up to 4KB in length.
|
|
4119
4205
|
*/
|
|
4120
4206
|
appData: string;
|
|
4121
4207
|
|
|
@@ -4579,7 +4665,7 @@ export declare enum AudioProfileType {
|
|
|
4579
4665
|
|
|
4580
4666
|
/**
|
|
4581
4667
|
* @brief Default sound quality
|
|
4582
|
-
* The sound quality
|
|
4668
|
+
* The sound quality set by the server
|
|
4583
4669
|
*/
|
|
4584
4670
|
default = 0,
|
|
4585
4671
|
|
|
@@ -4663,7 +4749,6 @@ export interface EngineConfig {
|
|
|
4663
4749
|
}
|
|
4664
4750
|
|
|
4665
4751
|
/**
|
|
4666
|
-
* @type keytype
|
|
4667
4752
|
* @brief Advanced Audio Coding (AAC) profile.
|
|
4668
4753
|
*/
|
|
4669
4754
|
export declare enum AAC_PROFILE {
|
|
@@ -4700,6 +4785,106 @@ export declare enum TRANSCODING_VIDEO_CODEC {
|
|
|
4700
4785
|
H265 = "H265"
|
|
4701
4786
|
}
|
|
4702
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
|
+
|
|
4703
4888
|
/**
|
|
4704
4889
|
* @brief Point-to-point text message
|
|
4705
4890
|
*/
|
|
@@ -4795,15 +4980,11 @@ declare const Config: {
|
|
|
4795
4980
|
};
|
|
4796
4981
|
declare function setParameter(key: keyof typeof Config, value: any): void;
|
|
4797
4982
|
declare function getParameter(key: keyof typeof Config): string | boolean | string[];
|
|
4798
|
-
|
|
4799
|
-
* @id VERTC
|
|
4800
|
-
* @list 104477
|
|
4801
|
-
* @detail 104478
|
|
4802
|
-
*/
|
|
4983
|
+
|
|
4803
4984
|
/**
|
|
4804
4985
|
* @id BytePlusRTC
|
|
4805
|
-
* @list
|
|
4806
|
-
* @detail
|
|
4986
|
+
* @list overview
|
|
4987
|
+
* @detail api
|
|
4807
4988
|
*/
|
|
4808
4989
|
export interface IVERTC {
|
|
4809
4990
|
|
|
@@ -4822,7 +5003,7 @@ export interface IVERTC {
|
|
|
4822
5003
|
createEngine: (appId: string, config?: EngineConfig) => IRTCEngine;
|
|
4823
5004
|
|
|
4824
5005
|
/**
|
|
4825
|
-
* @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).
|
|
4826
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.
|
|
4827
5008
|
* @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
|
|
4828
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.
|
|
@@ -4839,7 +5020,7 @@ export interface IVERTC {
|
|
|
4839
5020
|
|
|
4840
5021
|
/**
|
|
4841
5022
|
* @brief Call this API to enumerate media devices and their IDs, such as microphones, cameras, and headsets.
|
|
4842
|
-
* 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).
|
|
4843
5024
|
* @return A list of all media devices.
|
|
4844
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.
|
|
4845
5026
|
*/
|
|
@@ -4870,7 +5051,7 @@ export interface IVERTC {
|
|
|
4870
5051
|
|
|
4871
5052
|
/**
|
|
4872
5053
|
* @brief Call this API to enumerate microphone devices.
|
|
4873
|
-
* 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).
|
|
4874
5055
|
* @return A list including all microphone devices.
|
|
4875
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.
|
|
4876
5057
|
*/
|
|
@@ -4878,7 +5059,7 @@ export interface IVERTC {
|
|
|
4878
5059
|
|
|
4879
5060
|
/**
|
|
4880
5061
|
* @brief Call this API to enumerate audio and video devices and their IDs, such as microphones, cameras, and headsets.
|
|
4881
|
-
* 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).
|
|
4882
5063
|
* @return A list including all camera devices.
|
|
4883
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.
|
|
4884
5065
|
*/
|
|
@@ -4886,7 +5067,7 @@ export interface IVERTC {
|
|
|
4886
5067
|
|
|
4887
5068
|
/**
|
|
4888
5069
|
* @brief Call this API to enumerate audio playback devices and their IDs, such as speakers and headsets.
|
|
4889
|
-
* 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).
|
|
4890
5071
|
* @return A list including all audio playback devices.
|
|
4891
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.
|
|
4892
5073
|
*/
|
|
@@ -4915,18 +5096,18 @@ export interface IVERTC {
|
|
|
4915
5096
|
setLogConfig: ({ logLevel, LogfileSize }: {
|
|
4916
5097
|
|
|
4917
5098
|
/**
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
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
|
+
*/
|
|
4925
5106
|
logLevel?: "none" | "error" | "warning" | "info" | "trace";
|
|
4926
5107
|
|
|
4927
5108
|
/**
|
|
4928
|
-
|
|
4929
|
-
|
|
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
|
+
*/
|
|
4930
5111
|
LogfileSize?: number;
|
|
4931
5112
|
}) => void;
|
|
4932
5113
|
|
|
@@ -4959,6 +5140,7 @@ declare class VERTC implements IVERTC {
|
|
|
4959
5140
|
ErrorCode: typeof ErrorCode;
|
|
4960
5141
|
platform: string;
|
|
4961
5142
|
private _monitor;
|
|
5143
|
+
private _rtmMonitor;
|
|
4962
5144
|
downloadLog: (key?: string | undefined) => void;
|
|
4963
5145
|
setLogConfig: ({ logLevel, LogfileSize }: {
|
|
4964
5146
|
logLevel?: "none" | "error" | "warning" | "info" | "trace" | undefined;
|