@byteplus/rtc 4.36.1 → 4.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +357 -319
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -2,551 +2,571 @@
|
|
|
2
2
|
|
|
3
3
|
import { EventArgs, EventEmitter, EventNames, ValidEventTypes } from 'eventemitter3';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
* @list 104477
|
|
7
|
-
* @detail 104478
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @list 104477
|
|
11
|
-
* @detail 104478
|
|
12
|
-
*/
|
|
13
|
-
export interface IAudioMixingManager {
|
|
5
|
+
declare enum ErrorCode {
|
|
14
6
|
|
|
15
7
|
/**
|
|
16
|
-
*
|
|
17
|
-
* 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.
|
|
18
|
-
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
|
|
19
|
-
* If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
|
|
20
|
-
* @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.
|
|
21
|
-
* @param config Mix Sound configuration <br>
|
|
22
|
-
* 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.
|
|
23
|
-
* @return
|
|
24
|
-
* @notes <br>
|
|
25
|
-
* + If you have already loaded the sound effect into memory through preloadAudioMixing{@link #preloadAudioMixing}, make sure that the ID here is the same as the ID set by preloadAudioMixing{@link #preloadAudioMixing}. <br>
|
|
26
|
-
* + After you start playing the audio file and mixing, you can call the stopAudioMixing{@link #stopAudioMixing} method to stop playing the audio file. <br>
|
|
27
|
-
* + The mixing data of this method comes from an external file, while the mixing data of enableAudioMixingFrame{@link #enableAudioMixingFrame} comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
|
|
28
|
-
* @region Advanced Feature
|
|
8
|
+
* Invalid argument of the `engine` object for calling destroyEngine
|
|
29
9
|
*/
|
|
30
|
-
|
|
10
|
+
INVALID_ENGINE = "INVALID_ENGINE",
|
|
31
11
|
|
|
32
12
|
/**
|
|
33
|
-
*
|
|
34
|
-
* @param id ID of the mixing
|
|
35
|
-
* @notes <br>
|
|
36
|
-
* + After calling startAudioMixing{@link #startAudioMixing} method to start playing audio files and mixes, you can call this method to stop playing audio files and mixes. <br>
|
|
37
|
-
* + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
|
|
38
|
-
* @region Advanced Feature
|
|
13
|
+
* Invalid argument
|
|
39
14
|
*/
|
|
40
|
-
|
|
15
|
+
INVALID_PARAMS = "INVALID_PARAMS",
|
|
41
16
|
|
|
42
17
|
/**
|
|
43
|
-
*
|
|
44
|
-
* @param id ID of the mixing
|
|
45
|
-
* @notes <br>
|
|
46
|
-
* + After calling startAudioMixing{@link #startAudioMixing} method to start playing audio files and mixes, you can call this method to pause playing audio files and mixes. <br>
|
|
47
|
-
* + After calling this method to pause playing audio files and mixing, you can call the resumeAudioMixing{@link #resumeAudioMixing} method to resume playing and mixing. <br>
|
|
48
|
-
* @region Advanced Feature
|
|
18
|
+
* Token is invalid or has expired.
|
|
49
19
|
*/
|
|
50
|
-
|
|
20
|
+
INVALID_TOKEN = "INVALID_TOKEN",
|
|
51
21
|
|
|
52
22
|
/**
|
|
53
|
-
*
|
|
54
|
-
* @param id Mixing ID
|
|
55
|
-
* @notes After calling the pauseAudioMixing{@link #pauseAudioMixing} method to pause playing audio files and mixing, you can resume playing and mixing by calling this method. <br>
|
|
56
|
-
* @region Advanced Feature
|
|
23
|
+
* Failure of joining room
|
|
57
24
|
*/
|
|
58
|
-
|
|
25
|
+
JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
|
|
59
26
|
|
|
60
27
|
/**
|
|
61
|
-
*
|
|
62
|
-
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
|
|
63
|
-
* If this method is called repeatedly with the same ID, the latter overrides the previous. <br>
|
|
64
|
-
* If you call startAudioMixing{@link #startAudioMixing} and then call this method with the same ID, the previous mix stopped, and then the next mix was loaded. <br>
|
|
65
|
-
* After calling this method with an ID to preload A.mp3, if you need to call startAudioMixing{@link #startAudioMixing} to play B.mp3 with the same ID, please call unloadAudioMixing{@link #unloadAudioMixing} to uninstall A.mp3 first, otherwise you will report an error AUDIO_MIXING_ERROR_LOAD_CONFLICT.
|
|
66
|
-
* @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio. <br>
|
|
67
|
-
* @return
|
|
68
|
-
* @notes <br>
|
|
69
|
-
* + When you need to play an audio file frequently, call this method to preload the file. When playing, you can only load the file once to reduce CPU usage. <br>
|
|
70
|
-
* + This method pre-loads the specified audio file, and only calling startAudioMixing{@link #startAudioMixing} API can you start playing the specified audio file. <br>
|
|
71
|
-
* + The specified audio file preloaded by calling this method can be unloaded through unloadAudioMixing{@link #unloadAudioMixing}.
|
|
72
|
-
* @region Advanced Feature
|
|
28
|
+
* Join the same room repeatedly.
|
|
73
29
|
*/
|
|
74
|
-
|
|
30
|
+
REPEAT_JOIN = "REPEAT_JOIN",
|
|
75
31
|
|
|
76
32
|
/**
|
|
77
|
-
*
|
|
78
|
-
* @param id Mix ID
|
|
79
|
-
* @region Advanced Feature
|
|
33
|
+
* Publish media stream repeatedly.
|
|
80
34
|
*/
|
|
81
|
-
|
|
35
|
+
REPEAT_PUBLISH = "REPEAT_PUBLISH",
|
|
82
36
|
|
|
83
37
|
/**
|
|
84
|
-
*
|
|
85
|
-
* @param id Mixing ID
|
|
86
|
-
* @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`. <br>
|
|
87
|
-
* + 0: Mute <br>
|
|
88
|
-
* + 100: Original volume <br>
|
|
89
|
-
* + 400: Maximum volume (with overflow protection)
|
|
90
|
-
* @region Advanced Feature
|
|
38
|
+
* Publish before joining a room.
|
|
91
39
|
*/
|
|
92
|
-
|
|
40
|
+
PUBLISH_BEFORE_JOIN = "PUBLISH_BEFORE_JOIN",
|
|
93
41
|
|
|
94
42
|
/**
|
|
95
|
-
*
|
|
96
|
-
* @param id Audio mix id
|
|
97
|
-
* @return <br>
|
|
98
|
-
* + `0`: Failure<br>
|
|
99
|
-
* + `>0`: Successful. Volume<br>
|
|
100
|
-
* @region Advanced Feature
|
|
43
|
+
* Un-publish before joining a room.
|
|
101
44
|
*/
|
|
102
|
-
|
|
45
|
+
UNPUBLISH_BEFORE_JOIN = "UNPUBLISH_BEFORE_JOIN",
|
|
103
46
|
|
|
104
47
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @param id Mix ID
|
|
107
|
-
* @return <br>
|
|
108
|
-
* + > 0: Success, audio file duration, in milliseconds. <br>
|
|
109
|
-
* + < 0: Failure
|
|
110
|
-
* @notes Before calling this method to obtain the length of the audio file, you need to call preloadAudioMixing{@link #preloadAudioMixing} or startAudioMixing{@link #startAudioMixing}.
|
|
111
|
-
* @region Advanced Feature
|
|
48
|
+
* Subscribe before joining a room.
|
|
112
49
|
*/
|
|
113
|
-
|
|
50
|
+
SUBSCRIBE_BEFORE_JOIN = "SUBSCRIBE_BEFORE_JOIN",
|
|
114
51
|
|
|
115
52
|
/**
|
|
116
|
-
*
|
|
117
|
-
* @param id Mix ID
|
|
118
|
-
* @return <br>
|
|
119
|
-
* + > 0: Success, audio file playback progress, in milliseconds. <br>
|
|
120
|
-
* + < 0: Failed
|
|
121
|
-
* @notes Before calling this method to get the audio file playback progress, you need to call startAudioMixing{@link #startAudioMixing} to start playing the audio file.
|
|
122
|
-
* @region Advanced Feature
|
|
53
|
+
* Unsubscribe before joining a room.
|
|
123
54
|
*/
|
|
124
|
-
|
|
55
|
+
UNSUBSCRIBE_BEFORE_JOIN = "UNSUBSCRIBE_BEFORE_JOIN",
|
|
125
56
|
|
|
126
57
|
/**
|
|
127
|
-
*
|
|
128
|
-
* @param id Mixing ID
|
|
129
|
-
* @param position The starting playback position of the audio file in milliseconds.
|
|
130
|
-
* @notes <br>
|
|
131
|
-
* + This method allows you to play an audio file from a specified position as appropriate, without having to play an audio file in its entirety from the beginning to finish. <br>
|
|
132
|
-
* + Before calling this method to set the playback position of the audio file, you need to call startAudioMixing{@link #startAudioMixing} to start playing the audio file.
|
|
133
|
-
* @region Advanced Feature
|
|
58
|
+
* Request to publish media stream as an invisible user.
|
|
134
59
|
*/
|
|
135
|
-
|
|
60
|
+
NO_PUBLISH_PERMISSION = "NO_PUBLISH_PERMISSION",
|
|
136
61
|
|
|
137
62
|
/**
|
|
138
|
-
*
|
|
139
|
-
* To mix multiple PCM audio data, call this API multiple times with different ids.
|
|
140
|
-
* @param type Mixing type <br>
|
|
141
|
-
* Whether the PCM data is mixed locally and sent to the remotes.
|
|
142
|
-
* @notes <br>
|
|
143
|
-
* + After this API, you must call pushAudioMixingFrame{@link #pushAudioMixingFrame} to start mixing. <br>
|
|
144
|
-
* + To end PCM mixing, use disableAudioMixingFrame{@link #disableAudioMixingFrame}.
|
|
145
|
-
* @region Advanced Feature
|
|
63
|
+
* Request to subscribe or unsubscribe a stream that doesn't exist.
|
|
146
64
|
*/
|
|
147
|
-
|
|
65
|
+
STREAM_NOT_EXIST = "STREAM_NOT_EXIST",
|
|
148
66
|
|
|
149
67
|
/**
|
|
150
|
-
*
|
|
151
|
-
* @region Advanced Feature
|
|
68
|
+
* Request to publish an empty stream.
|
|
152
69
|
*/
|
|
153
|
-
|
|
70
|
+
EMPTY_STREAM = "EMPTY_STREAM",
|
|
154
71
|
|
|
155
72
|
/**
|
|
156
|
-
*
|
|
157
|
-
* @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
|
|
158
|
-
* @notes Before calling this method, you must start the external audio stream mixing through enableAudioMixingFrame{@link #enableAudioMixingFrame}. <br>
|
|
159
|
-
* @region Advanced Feature
|
|
73
|
+
* Network disconnected. RTC SDk will emit this error code if you call publish, subscribe or the other related methods while the user has not joined a room.
|
|
160
74
|
*/
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* @type keytype
|
|
166
|
-
* Mix playback channel type
|
|
167
|
-
*/
|
|
168
|
-
export declare enum AudioMixingDualMonoMode {
|
|
75
|
+
NOT_CONNECTED_YET = "NOT_CONNECTED_YET",
|
|
169
76
|
|
|
170
77
|
/**
|
|
171
|
-
*
|
|
78
|
+
* Request to send message before the user has joined a room.
|
|
172
79
|
*/
|
|
173
|
-
|
|
80
|
+
IM_BEFORE_JOIN = "IM_BEFORE_JOIN",
|
|
174
81
|
|
|
175
82
|
/**
|
|
176
|
-
*
|
|
83
|
+
* The user does not exist.
|
|
177
84
|
*/
|
|
178
|
-
|
|
85
|
+
USER_NOT_EXIST = "USER_NOT_EXIST",
|
|
179
86
|
|
|
180
87
|
/**
|
|
181
|
-
*
|
|
88
|
+
* The user has joined the room.
|
|
182
89
|
*/
|
|
183
|
-
|
|
90
|
+
ALREADY_IN_ROOM = "ALREADY_IN_ROOM",
|
|
184
91
|
|
|
185
92
|
/**
|
|
186
|
-
*
|
|
93
|
+
* The user is kicked out because a user with the same userId joined the room.
|
|
187
94
|
*/
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* @type keytype
|
|
193
|
-
* Mixing type
|
|
194
|
-
*/
|
|
195
|
-
export declare enum AudioMixingType {
|
|
95
|
+
DUPLICATE_LOGIN = "DUPLICATE_LOGIN",
|
|
196
96
|
|
|
197
97
|
/**
|
|
198
|
-
*
|
|
98
|
+
* Enable capture repeatedly.
|
|
199
99
|
*/
|
|
200
|
-
|
|
100
|
+
REPEAT_CAPTURE = "REPEAT_CAPTURE",
|
|
201
101
|
|
|
202
102
|
/**
|
|
203
|
-
*
|
|
103
|
+
* Failure of video capture
|
|
204
104
|
*/
|
|
205
|
-
|
|
105
|
+
GET_VIDEO_TRACK_FAILED = "GET_VIDEO_TRACK_FAILED",
|
|
206
106
|
|
|
207
107
|
/**
|
|
208
|
-
*
|
|
108
|
+
* Failure of getting audio track
|
|
209
109
|
*/
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
declare enum AudioMixingState {
|
|
213
|
-
|
|
214
|
-
AUDIO_MIXING_STATE_PRELOADED = 0,
|
|
215
|
-
|
|
216
|
-
AUDIO_MIXING_STATE_PLAYING = 1,
|
|
110
|
+
GET_AUDIO_TRACK_FAILED = "GET_AUDIO_TRACK_FAILED",
|
|
217
111
|
|
|
218
|
-
|
|
112
|
+
/**
|
|
113
|
+
* Failure of getting screen track
|
|
114
|
+
*/
|
|
115
|
+
GET_SCREEN_TRACK_FAILED = "GET_SCREEN_TRACK_FAILED",
|
|
219
116
|
|
|
220
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Stream type mismatched. RTC SDK will emit this error code when you enable the local media device after enabling the custom video module.
|
|
119
|
+
*/
|
|
120
|
+
STREAM_TYPE_NOT_MATCH = "STREAM_TYPE_NOT_MATCH",
|
|
221
121
|
|
|
222
|
-
|
|
122
|
+
/**
|
|
123
|
+
* Cannot find the DOM specified to play the video.
|
|
124
|
+
*/
|
|
125
|
+
CANT_FIND_DOM = "CANT_FIND_DOM",
|
|
223
126
|
|
|
224
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Invalid device ID
|
|
129
|
+
*/
|
|
130
|
+
INVALID_DEVICE_ID = "INVALID_DEVICE_ID",
|
|
225
131
|
|
|
226
|
-
|
|
132
|
+
/**
|
|
133
|
+
* No permission for capture
|
|
134
|
+
*/
|
|
135
|
+
NO_PERMISSION = "NO_PERMISSION",
|
|
227
136
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
* @type keytype
|
|
233
|
-
* Mixing configuration
|
|
234
|
-
*/
|
|
235
|
-
export interface MixOption {
|
|
137
|
+
/**
|
|
138
|
+
* The browser does not support capture.
|
|
139
|
+
*/
|
|
140
|
+
NOT_SUPPORTED = "NOT_SUPPORTED",
|
|
236
141
|
|
|
237
142
|
/**
|
|
238
|
-
*
|
|
239
|
-
* @notes <br>
|
|
240
|
-
* + Play_count < = 0: Infinite loop <br>
|
|
241
|
-
* + Play_count == 1: Play once (default) <br>
|
|
242
|
-
* + Play_count > 1: Play play_count times
|
|
143
|
+
* Failure of requesting an ICE node
|
|
243
144
|
*/
|
|
244
|
-
|
|
145
|
+
ICE_SERVER_WRONG = "ICE_SERVER_WRONG",
|
|
245
146
|
|
|
246
147
|
/**
|
|
247
|
-
*
|
|
148
|
+
* Failure of establishing a datachannel
|
|
248
149
|
*/
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string | symbol> extends EventEmitter<EventTypes> {
|
|
252
|
-
constructor();
|
|
253
|
-
safeEmit<T extends EventNames<EventTypes>>(event: T, ...args: EventArgs<EventTypes, T>): boolean;
|
|
254
|
-
safeEmitAsPromise(event: string, ...args: any[]): Promise<any>;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Information of media device
|
|
259
|
-
*/
|
|
260
|
-
export interface RTCDevice {
|
|
150
|
+
ESTABLISH_DATACHANNEL_FAILED = "ESTABLISH_DATACHANNEL_FAILED",
|
|
261
151
|
|
|
262
152
|
/**
|
|
263
|
-
*
|
|
264
|
-
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
153
|
+
* Failure of loading network resource
|
|
265
154
|
*/
|
|
266
|
-
|
|
155
|
+
LOAD_RESOURCES_FAILED = "LOAD_RESOURCES_FAILED",
|
|
267
156
|
|
|
268
157
|
/**
|
|
269
|
-
*
|
|
270
|
-
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
158
|
+
* Failure of building the signal channel
|
|
271
159
|
*/
|
|
272
|
-
|
|
160
|
+
SIGNALING_CHANNEL_NOT_OPEN = "SIGNALING_CHANNEL_NOT_OPEN",
|
|
273
161
|
|
|
274
162
|
/**
|
|
275
|
-
*
|
|
276
|
-
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
163
|
+
* Request timeout
|
|
277
164
|
*/
|
|
278
|
-
|
|
165
|
+
TIME_OUT = "TIME_OUT",
|
|
279
166
|
|
|
280
167
|
/**
|
|
281
|
-
*
|
|
282
|
-
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
168
|
+
* Request is denied for the reason of network disconnected.
|
|
283
169
|
*/
|
|
284
|
-
|
|
170
|
+
REFUSE_OPERATION_IN_DISCONNECT = "REFUSE_OPERATION_IN_DISCONNECT",
|
|
285
171
|
|
|
286
172
|
/**
|
|
287
|
-
*
|
|
173
|
+
* Failure of building a peer-connection to the signal server for the failure of building transceiver
|
|
288
174
|
*/
|
|
289
|
-
|
|
290
|
-
}
|
|
291
|
-
declare enum ErrorCode {
|
|
175
|
+
ADD_TRANSCEIVER_FAILED = "ADD_TRANSCEIVER_FAILED",
|
|
292
176
|
|
|
293
177
|
/**
|
|
294
|
-
*
|
|
178
|
+
* Failure of updating media track
|
|
295
179
|
*/
|
|
296
|
-
|
|
180
|
+
UPDATE_TRACK_FAILED = "UPDATE_TRACK_FAILED",
|
|
297
181
|
|
|
298
182
|
/**
|
|
299
|
-
*
|
|
183
|
+
* Failure of publishing a media stream
|
|
300
184
|
*/
|
|
301
|
-
|
|
185
|
+
PUBLISH_FAILED = "PUBLISH_FAILED",
|
|
302
186
|
|
|
303
187
|
/**
|
|
304
|
-
*
|
|
188
|
+
* Failure of un-publishing a media stream
|
|
305
189
|
*/
|
|
306
|
-
|
|
190
|
+
UNPUBLISH_FAILED = "UNPUBLISH_FAILED",
|
|
307
191
|
|
|
308
192
|
/**
|
|
309
|
-
* Failure of
|
|
193
|
+
* Failure of subscribing a media stream
|
|
310
194
|
*/
|
|
311
|
-
|
|
195
|
+
SUBSCRIBE_FAILED = "SUBSCRIBE_FAILED",
|
|
312
196
|
|
|
313
197
|
/**
|
|
314
|
-
*
|
|
198
|
+
* Failure of unsubscribing a media stream
|
|
315
199
|
*/
|
|
316
|
-
|
|
200
|
+
UNSUBSCRIBE_FAILED = "UNSUBSCRIBE_FAILED",
|
|
317
201
|
|
|
318
202
|
/**
|
|
319
|
-
*
|
|
203
|
+
* Call [leaveRoom](#leaveroom)Process of publishing and subscribing will
|
|
204
|
+
* RTC SDK will emit this error code when you call the [leaveRoom](#leaveroom) during the process of publishing or subscribing.
|
|
320
205
|
*/
|
|
321
|
-
|
|
206
|
+
OPERATION_CANCEL = "OPERATION_CANCEL",
|
|
322
207
|
|
|
323
208
|
/**
|
|
324
|
-
*
|
|
209
|
+
* Unknown error
|
|
325
210
|
*/
|
|
326
|
-
|
|
211
|
+
UNEXPECTED_ERROR = "UNEXPECTED_ERROR",
|
|
212
|
+
ALREADY_LOGIN = "ALREADY_LOGIN",
|
|
213
|
+
LOGIN_FAILED = "LOGIN_FAILED",
|
|
214
|
+
NOT_LOGIN = "NOT_LOGIN",
|
|
215
|
+
RTM_DUPLICATE_LOGIN = "RTM_DUPLICATE_LOGIN",
|
|
216
|
+
RTM_TOKEN_ERROR = "RTM_TOKEN_ERROR",
|
|
217
|
+
/** RTM p2p消息错误码 */
|
|
218
|
+
USER_MESSAGE_TIMEOUT = "USER_MESSAGE_TIMEOUT",
|
|
219
|
+
USER_MESSAGE_BROKEN = "USER_MESSAGE_BROKEN",
|
|
220
|
+
USER_MESSAGE_NO_RECEIVER = "USER_MESSAGE_NO_RECEIVER",
|
|
221
|
+
USER_MESSAGE_NO_RELAYPATH = "USER_MESSAGE_NO_RELAYPATH",
|
|
222
|
+
USER_MESSAGE_SEND_TO_SERVER_ERROR = "USER_MESSAGE_SEND_TO_SERVER_ERROR",
|
|
223
|
+
USER_MESSAGE_SERVER_RESPONSE_ERROR = "USER_MESSAGE_SERVER_RESPONSE_ERROR",
|
|
224
|
+
USER_MESSAGE_NOT_JOIN = "USER_MESSAGE_NOT_JOIN",
|
|
225
|
+
USER_MESSAGE_INIT = "USER_MESSAGE_INIT",
|
|
226
|
+
USER_MESSAGE_NO_CONNECTION = "USER_MESSAGE_NO_CONNECTION",
|
|
227
|
+
USER_MESSAGE_EXCEED_MAX_LENGTH = "USER_MESSAGE_EXCEED_MAX_LENGTH",
|
|
228
|
+
USER_MESSAGE_EMPTY_USER = "USER_MESSAGE_EMPTY_USER",
|
|
229
|
+
USER_MESSAGE_NOT_LOGIN = "USER_MESSAGE_NOT_LOGIN",
|
|
230
|
+
USER_MESSAGE_SERVER_PARAMS_NOTSET = "USER_MESSAGE_SERVER_PARAMS_NOTSET",
|
|
231
|
+
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN"
|
|
232
|
+
}
|
|
233
|
+
declare enum AudioMixingError {
|
|
327
234
|
|
|
328
235
|
/**
|
|
329
|
-
*
|
|
236
|
+
* Normal
|
|
330
237
|
*/
|
|
331
|
-
|
|
238
|
+
AUDIO_MIXING_ERROR_OK = 0,
|
|
332
239
|
|
|
333
240
|
/**
|
|
334
|
-
*
|
|
241
|
+
* Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
335
242
|
*/
|
|
336
|
-
|
|
243
|
+
AUDIO_MIXING_ERROR_PRELOAD_FAILED = 1,
|
|
337
244
|
|
|
338
245
|
/**
|
|
339
|
-
*
|
|
246
|
+
* Audio mixing starts fails because of missing audio file or failure of reading the audio file.
|
|
340
247
|
*/
|
|
341
|
-
|
|
248
|
+
AUDIO_MIXING_ERROR_START_FAILED = 2,
|
|
342
249
|
|
|
343
250
|
/**
|
|
344
|
-
*
|
|
251
|
+
* Invalid audio mixing ID
|
|
345
252
|
*/
|
|
346
|
-
|
|
253
|
+
AUDIO_MIXING_ERROR_ID_NOT_FOUND = 3,
|
|
347
254
|
|
|
348
255
|
/**
|
|
349
|
-
*
|
|
256
|
+
* Invalid start position
|
|
350
257
|
*/
|
|
351
|
-
|
|
258
|
+
AUDIO_MIXING_ERROR_SET_POSITION_FAILED = 4,
|
|
352
259
|
|
|
353
260
|
/**
|
|
354
|
-
*
|
|
261
|
+
* Invalid volume argument. The volume value ranges [0, 400].
|
|
355
262
|
*/
|
|
356
|
-
|
|
263
|
+
AUDIO_MIXING_ERROR_INVALID_VOLUME = 5,
|
|
357
264
|
|
|
358
265
|
/**
|
|
359
|
-
*
|
|
266
|
+
* The audio file to be played does not match to the preload one. Call `unloadAudioMixing` to unload file and proceed.
|
|
360
267
|
*/
|
|
361
|
-
|
|
268
|
+
AUDIO_MIXING_ERROR_LOAD_CONFLICT = 6,
|
|
362
269
|
|
|
363
270
|
/**
|
|
364
|
-
*
|
|
271
|
+
* Type of the audio file to be played is not supported.
|
|
365
272
|
*/
|
|
366
|
-
|
|
273
|
+
AUDIO_MIXING_ERROR_ID_TYPE_NOT_MATCH = 7,
|
|
367
274
|
|
|
368
275
|
/**
|
|
369
|
-
*
|
|
276
|
+
* Invalid audio pitch
|
|
370
277
|
*/
|
|
371
|
-
|
|
278
|
+
AUDIO_MIXING_ERROR_ID_TYPE_INVALID_PITCH = 8,
|
|
372
279
|
|
|
373
280
|
/**
|
|
374
|
-
*
|
|
281
|
+
* Invalid audio track
|
|
375
282
|
*/
|
|
376
|
-
|
|
283
|
+
AUDIO_MIXING_ERROR_INVALID_AUDIO_TRACK = 9
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* @list 104477
|
|
287
|
+
* @detail 104478
|
|
288
|
+
*/
|
|
289
|
+
/**
|
|
290
|
+
* @list 104477
|
|
291
|
+
* @detail 104478
|
|
292
|
+
*/
|
|
293
|
+
export interface IAudioMixingManager {
|
|
377
294
|
|
|
378
295
|
/**
|
|
379
|
-
*
|
|
296
|
+
* Start playing audio files and mixes. <br>
|
|
297
|
+
* This method can be called many times by passing in different IDs and filepath to realize simultaneous playback of multiple mixing files and mixing overlay.
|
|
298
|
+
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
|
|
299
|
+
* If this method is repeatedly called with the same ID, the previous mix stops and the next mix starts.
|
|
300
|
+
* @param filePath Specify the file path either the absolute path of a local file or the url of online audio. Files with the extension of mp3 and aac are supported.
|
|
301
|
+
* @param config Mix Sound configuration <br>
|
|
302
|
+
* You can set the number of times the mix is played, whether the mix is played locally, and whether the mix is sent to the remote end. For details.
|
|
303
|
+
* @return
|
|
304
|
+
* @notes <br>
|
|
305
|
+
* + If you have already loaded the sound effect into memory through preloadAudioMixing{@link #preloadAudioMixing}, make sure that the ID here is the same as the ID set by preloadAudioMixing{@link #preloadAudioMixing}. <br>
|
|
306
|
+
* + After you start playing the audio file and mixing, you can call the stopAudioMixing{@link #stopAudioMixing} method to stop playing the audio file. <br>
|
|
307
|
+
* + The mixing data of this method comes from an external file, while the mixing data of enableAudioMixingFrame{@link #enableAudioMixingFrame} comes from an external cache and the audio format is PCM. These two mixing methods can coexist.
|
|
308
|
+
* @region Advanced Feature
|
|
380
309
|
*/
|
|
381
|
-
|
|
310
|
+
startAudioMixing(id: number, filePath: string, options: MixOption): Promise<void>;
|
|
382
311
|
|
|
383
312
|
/**
|
|
384
|
-
*
|
|
313
|
+
* Stop playing audio files and mixes
|
|
314
|
+
* @param id ID of the mixing
|
|
315
|
+
* @notes <br>
|
|
316
|
+
* + After calling startAudioMixing{@link #startAudioMixing} method to start playing audio files and mixes, you can call this method to stop playing audio files and mixes. <br>
|
|
317
|
+
* + After calling this method to stop playing the audio file, the audio file will be automatically uninstalled.
|
|
318
|
+
* @region Advanced Feature
|
|
385
319
|
*/
|
|
386
|
-
|
|
320
|
+
stopAudioMixing(id: number): void;
|
|
387
321
|
|
|
388
322
|
/**
|
|
389
|
-
*
|
|
323
|
+
* Pause playing audio files and mixes
|
|
324
|
+
* @param id ID of the mixing
|
|
325
|
+
* @notes <br>
|
|
326
|
+
* + After calling startAudioMixing{@link #startAudioMixing} method to start playing audio files and mixes, you can call this method to pause playing audio files and mixes. <br>
|
|
327
|
+
* + After calling this method to pause playing audio files and mixing, you can call the resumeAudioMixing{@link #resumeAudioMixing} method to resume playing and mixing. <br>
|
|
328
|
+
* @region Advanced Feature
|
|
390
329
|
*/
|
|
391
|
-
|
|
330
|
+
pauseAudioMixing(id: number): void;
|
|
392
331
|
|
|
393
332
|
/**
|
|
394
|
-
*
|
|
333
|
+
* Resume playing audio files and mixing
|
|
334
|
+
* @param id Mixing ID
|
|
335
|
+
* @notes After calling the pauseAudioMixing{@link #pauseAudioMixing} method to pause playing audio files and mixing, you can resume playing and mixing by calling this method. <br>
|
|
336
|
+
* @region Advanced Feature
|
|
395
337
|
*/
|
|
396
|
-
|
|
338
|
+
resumeAudioMixing(id: number): void;
|
|
397
339
|
|
|
398
340
|
/**
|
|
399
|
-
*
|
|
341
|
+
* Preload the specified audio file into memory
|
|
342
|
+
* @param id Mix ID. For identifying the mix, please ensure that the mix ID is unique. <br>
|
|
343
|
+
* If this method is called repeatedly with the same ID, the latter overrides the previous. <br>
|
|
344
|
+
* If you call startAudioMixing{@link #startAudioMixing} and then call this method with the same ID, the previous mix stopped, and then the next mix was loaded. <br>
|
|
345
|
+
* After calling this method with an ID to preload A.mp3, if you need to call startAudioMixing{@link #startAudioMixing} to play B.mp3 with the same ID, please call unloadAudioMixing{@link #unloadAudioMixing} to uninstall A.mp3 first, otherwise you will report an error AUDIO_MIXING_ERROR_LOAD_CONFLICT.
|
|
346
|
+
* @param filePath Used for mixing file paths. It can be the absolute path of the local file or the url of the online audio. <br>
|
|
347
|
+
* @return
|
|
348
|
+
* @notes <br>
|
|
349
|
+
* + When you need to play an audio file frequently, call this method to preload the file. When playing, you can only load the file once to reduce CPU usage. <br>
|
|
350
|
+
* + This method pre-loads the specified audio file, and only calling startAudioMixing{@link #startAudioMixing} API can you start playing the specified audio file. <br>
|
|
351
|
+
* + The specified audio file preloaded by calling this method can be unloaded through unloadAudioMixing{@link #unloadAudioMixing}.
|
|
352
|
+
* @region Advanced Feature
|
|
400
353
|
*/
|
|
401
|
-
|
|
354
|
+
preloadAudioMixing(id: number, filePath: string): Promise<void>;
|
|
402
355
|
|
|
403
356
|
/**
|
|
404
|
-
*
|
|
357
|
+
* Uninstall the specified audio file
|
|
358
|
+
* @param id Mix ID
|
|
359
|
+
* @region Advanced Feature
|
|
405
360
|
*/
|
|
406
|
-
|
|
361
|
+
unloadAudioMixing(id: number): void;
|
|
407
362
|
|
|
408
363
|
/**
|
|
409
|
-
*
|
|
364
|
+
* Adjust the volume of audio mixing, including audio files and PCM data.
|
|
365
|
+
* @param id Mixing ID
|
|
366
|
+
* @param volume The ratio of the mixing volume to the original volume. The range is `[0, 400]`. The recommended range is `[0, 100]`. <br>
|
|
367
|
+
* + 0: Mute <br>
|
|
368
|
+
* + 100: Original volume <br>
|
|
369
|
+
* + 400: Maximum volume (with overflow protection)
|
|
370
|
+
* @region Advanced Feature
|
|
410
371
|
*/
|
|
411
|
-
|
|
372
|
+
setAudioMixingVolume(id: number, volume: number): void;
|
|
412
373
|
|
|
413
374
|
/**
|
|
414
|
-
*
|
|
375
|
+
* Get volume of the audio files.
|
|
376
|
+
* @param id Audio mix id
|
|
377
|
+
* @return <br>
|
|
378
|
+
* + `0`: Failure<br>
|
|
379
|
+
* + `>0`: Successful. Volume<br>
|
|
380
|
+
* @region Advanced Feature
|
|
415
381
|
*/
|
|
416
|
-
|
|
382
|
+
getAudioMixingVolume(id: number): number;
|
|
417
383
|
|
|
418
384
|
/**
|
|
419
|
-
*
|
|
385
|
+
* Get audio file duration
|
|
386
|
+
* @param id Mix ID
|
|
387
|
+
* @return <br>
|
|
388
|
+
* + > 0: Success, audio file duration, in milliseconds. <br>
|
|
389
|
+
* + < 0: Failure
|
|
390
|
+
* @notes Before calling this method to obtain the length of the audio file, you need to call preloadAudioMixing{@link #preloadAudioMixing} or startAudioMixing{@link #startAudioMixing}.
|
|
391
|
+
* @region Advanced Feature
|
|
420
392
|
*/
|
|
421
|
-
|
|
393
|
+
getAudioMixingDuration(id: number): number;
|
|
422
394
|
|
|
423
395
|
/**
|
|
424
|
-
*
|
|
396
|
+
* Get audio file playback progress
|
|
397
|
+
* @param id Mix ID
|
|
398
|
+
* @return <br>
|
|
399
|
+
* + > 0: Success, audio file playback progress, in milliseconds. <br>
|
|
400
|
+
* + < 0: Failed
|
|
401
|
+
* @notes Before calling this method to get the audio file playback progress, you need to call startAudioMixing{@link #startAudioMixing} to start playing the audio file.
|
|
402
|
+
* @region Advanced Feature
|
|
425
403
|
*/
|
|
426
|
-
|
|
404
|
+
getAudioMixingCurrentPosition(id: number): number;
|
|
427
405
|
|
|
428
406
|
/**
|
|
429
|
-
*
|
|
407
|
+
* Set the starting playback position of the audio file
|
|
408
|
+
* @param id Mixing ID
|
|
409
|
+
* @param position The starting playback position of the audio file in milliseconds.
|
|
410
|
+
* @notes <br>
|
|
411
|
+
* + This method allows you to play an audio file from a specified position as appropriate, without having to play an audio file in its entirety from the beginning to finish. <br>
|
|
412
|
+
* + Before calling this method to set the playback position of the audio file, you need to call startAudioMixing{@link #startAudioMixing} to start playing the audio file.
|
|
413
|
+
* @region Advanced Feature
|
|
430
414
|
*/
|
|
431
|
-
|
|
415
|
+
setAudioMixingPosition(id: number, position: number): void;
|
|
432
416
|
|
|
433
417
|
/**
|
|
434
|
-
*
|
|
418
|
+
* Start PCM mixing. <br>
|
|
419
|
+
* To mix multiple PCM audio data, call this API multiple times with different ids.
|
|
420
|
+
* @param type Mixing type <br>
|
|
421
|
+
* Whether the PCM data is mixed locally and sent to the remotes.
|
|
422
|
+
* @notes <br>
|
|
423
|
+
* + After this API, you must call pushAudioMixingFrame{@link #pushAudioMixingFrame} to start mixing. <br>
|
|
424
|
+
* + To end PCM mixing, use disableAudioMixingFrame{@link #disableAudioMixingFrame}.
|
|
425
|
+
* @region Advanced Feature
|
|
435
426
|
*/
|
|
436
|
-
|
|
427
|
+
enableAudioMixingBuffer(type: AudioMixingType): void;
|
|
437
428
|
|
|
438
429
|
/**
|
|
439
|
-
*
|
|
430
|
+
* Disable PCM mixing.
|
|
431
|
+
* @region Advanced Feature
|
|
440
432
|
*/
|
|
441
|
-
|
|
433
|
+
disableAudioMixingBuffer(): void;
|
|
442
434
|
|
|
443
435
|
/**
|
|
444
|
-
*
|
|
436
|
+
* Push PCM audio frame data for mixing
|
|
437
|
+
* @param buffer Refer to [Browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)
|
|
438
|
+
* @notes Before calling this method, you must start the external audio stream mixing through enableAudioMixingFrame{@link #enableAudioMixingFrame}. <br>
|
|
439
|
+
* @region Advanced Feature
|
|
445
440
|
*/
|
|
446
|
-
|
|
441
|
+
pushAudioMixingBuffer(buffer: AudioBuffer): void;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* @type keytype
|
|
446
|
+
* Mix playback channel type
|
|
447
|
+
*/
|
|
448
|
+
export declare enum AudioMixingDualMonoMode {
|
|
447
449
|
|
|
448
450
|
/**
|
|
449
|
-
*
|
|
451
|
+
* Consistent with audio files
|
|
450
452
|
*/
|
|
451
|
-
|
|
453
|
+
AUTO = 0,
|
|
452
454
|
|
|
453
455
|
/**
|
|
454
|
-
*
|
|
456
|
+
* Only the left channel audio in the audio file can be heard
|
|
455
457
|
*/
|
|
456
|
-
|
|
458
|
+
MODE_L = 1,
|
|
457
459
|
|
|
458
460
|
/**
|
|
459
|
-
*
|
|
461
|
+
* Only the right channel audio in the audio file can be heard
|
|
460
462
|
*/
|
|
461
|
-
|
|
463
|
+
MODE_R = 2,
|
|
462
464
|
|
|
463
465
|
/**
|
|
464
|
-
*
|
|
466
|
+
* Can hear the left and right audio channels in the audio file at the same time
|
|
465
467
|
*/
|
|
466
|
-
|
|
468
|
+
MODE_MIX = 3
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* @type keytype
|
|
473
|
+
* Mixing type
|
|
474
|
+
*/
|
|
475
|
+
export declare enum AudioMixingType {
|
|
467
476
|
|
|
468
477
|
/**
|
|
469
|
-
*
|
|
478
|
+
* Played at the local device only
|
|
470
479
|
*/
|
|
471
|
-
|
|
480
|
+
PLAYOUT = 0,
|
|
472
481
|
|
|
473
482
|
/**
|
|
474
|
-
*
|
|
483
|
+
* Sent to the remote devices only
|
|
475
484
|
*/
|
|
476
|
-
|
|
485
|
+
PUBLISH = 1,
|
|
477
486
|
|
|
478
487
|
/**
|
|
479
|
-
*
|
|
488
|
+
* Played at the local device and sent to the remote devices.
|
|
480
489
|
*/
|
|
481
|
-
|
|
490
|
+
PLAYOUT_AND_PUBLISH = 2
|
|
491
|
+
}
|
|
492
|
+
declare enum AudioMixingState {
|
|
482
493
|
|
|
483
|
-
|
|
484
|
-
* Failure of unsubscribing a media stream
|
|
485
|
-
*/
|
|
486
|
-
UNSUBSCRIBE_FAILED = "UNSUBSCRIBE_FAILED",
|
|
494
|
+
AUDIO_MIXING_STATE_PRELOADED = 0,
|
|
487
495
|
|
|
488
|
-
|
|
489
|
-
* Call [leaveRoom](#leaveroom)Process of publishing and subscribing will
|
|
490
|
-
* RTC SDK will emit this error code when you call the [leaveRoom](#leaveroom) during the process of publishing or subscribing.
|
|
491
|
-
*/
|
|
492
|
-
OPERATION_CANCEL = "OPERATION_CANCEL",
|
|
496
|
+
AUDIO_MIXING_STATE_PLAYING = 1,
|
|
493
497
|
|
|
494
|
-
|
|
495
|
-
* Unknown error
|
|
496
|
-
*/
|
|
497
|
-
UNEXPECTED_ERROR = "UNEXPECTED_ERROR"
|
|
498
|
-
}
|
|
499
|
-
declare enum AudioMixingError {
|
|
498
|
+
AUDIO_MIXING_STATE_PAUSED = 2,
|
|
500
499
|
|
|
501
|
-
|
|
502
|
-
* Normal
|
|
503
|
-
*/
|
|
504
|
-
AUDIO_MIXING_ERROR_OK = 0,
|
|
500
|
+
AUDIO_MIXING_STATE_STOPPED = 3,
|
|
505
501
|
|
|
506
|
-
|
|
507
|
-
* Pre-load fails because of missing audio file or the length of the audio file exceeding 20s.
|
|
508
|
-
*/
|
|
509
|
-
AUDIO_MIXING_ERROR_PRELOAD_FAILED = 1,
|
|
502
|
+
AUDIO_MIXING_STATE_FAILED = 4,
|
|
510
503
|
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
504
|
+
AUDIO_MIXING_STATE_FINISHED = 5,
|
|
505
|
+
|
|
506
|
+
AUDIO_MIXING_STATE_PCM_ENABLED = 6,
|
|
507
|
+
|
|
508
|
+
AUDIO_MIXING_STATE_PCM_DISABLED = 7
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* @type keytype
|
|
513
|
+
* Mixing configuration
|
|
514
|
+
*/
|
|
515
|
+
export interface MixOption {
|
|
515
516
|
|
|
516
517
|
/**
|
|
517
|
-
*
|
|
518
|
+
* Mix playback times
|
|
519
|
+
* @notes <br>
|
|
520
|
+
* + Play_count < = 0: Infinite loop <br>
|
|
521
|
+
* + Play_count == 1: Play once (default) <br>
|
|
522
|
+
* + Play_count > 1: Play play_count times
|
|
518
523
|
*/
|
|
519
|
-
|
|
524
|
+
playCount: number;
|
|
520
525
|
|
|
521
526
|
/**
|
|
522
|
-
*
|
|
527
|
+
* For mixing playback types. Refer to [AudioMixingType](#audiomixingtype).
|
|
523
528
|
*/
|
|
524
|
-
|
|
529
|
+
type?: AudioMixingType;
|
|
530
|
+
}
|
|
531
|
+
declare class EnhancedEventEmitter<EventTypes extends ValidEventTypes = string | symbol> extends EventEmitter<EventTypes> {
|
|
532
|
+
constructor();
|
|
533
|
+
safeEmit<T extends EventNames<EventTypes>>(event: T, ...args: EventArgs<EventTypes, T>): boolean;
|
|
534
|
+
safeEmitAsPromise(event: string, ...args: any[]): Promise<any>;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Information of media device
|
|
539
|
+
*/
|
|
540
|
+
export interface RTCDevice {
|
|
525
541
|
|
|
526
542
|
/**
|
|
527
|
-
*
|
|
543
|
+
* Device ID
|
|
544
|
+
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
528
545
|
*/
|
|
529
|
-
|
|
546
|
+
deviceId: MediaDeviceInfo["deviceId"];
|
|
530
547
|
|
|
531
548
|
/**
|
|
532
|
-
*
|
|
549
|
+
* Device type
|
|
550
|
+
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
533
551
|
*/
|
|
534
|
-
|
|
552
|
+
deviceType: MediaDeviceInfo["kind"];
|
|
535
553
|
|
|
536
554
|
/**
|
|
537
|
-
*
|
|
555
|
+
* Device information
|
|
556
|
+
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
538
557
|
*/
|
|
539
|
-
|
|
558
|
+
deviceInfo: MediaDeviceInfo;
|
|
540
559
|
|
|
541
560
|
/**
|
|
542
|
-
*
|
|
561
|
+
* Device label
|
|
562
|
+
* Refer to the [browser documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo)
|
|
543
563
|
*/
|
|
544
|
-
|
|
564
|
+
deviceName: MediaDeviceInfo["label"];
|
|
545
565
|
|
|
546
566
|
/**
|
|
547
|
-
*
|
|
567
|
+
* Device state
|
|
548
568
|
*/
|
|
549
|
-
|
|
569
|
+
deviceState: "active" | "inactive";
|
|
550
570
|
}
|
|
551
571
|
|
|
552
572
|
/**
|
|
@@ -1209,7 +1229,9 @@ declare enum EngineEventsTypes {
|
|
|
1209
1229
|
onLiveTranscodingResult = "onLiveTranscodingResult",
|
|
1210
1230
|
onSEIMessageReceived = "onSEIMessageReceived",
|
|
1211
1231
|
onError = "onError",
|
|
1212
|
-
onAudioMixingStateChanged = "onAudioMixingStateChanged"
|
|
1232
|
+
onAudioMixingStateChanged = "onAudioMixingStateChanged",
|
|
1233
|
+
onUserMessageReceivedOutsideRoom = "onUserMessageReceivedOutsideRoom",
|
|
1234
|
+
onUserBinaryMessageReceivedOutsideRoom = "onUserBinaryMessageReceivedOutsideRoom"
|
|
1213
1235
|
}
|
|
1214
1236
|
|
|
1215
1237
|
/**
|
|
@@ -1601,7 +1623,7 @@ export interface IEngineEvents {
|
|
|
1601
1623
|
* @region Room Management Event
|
|
1602
1624
|
*/
|
|
1603
1625
|
[EngineEventsTypes.onError]: (event: {
|
|
1604
|
-
errorCode: ErrorCode.DUPLICATE_LOGIN;
|
|
1626
|
+
errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR;
|
|
1605
1627
|
}) => void;
|
|
1606
1628
|
|
|
1607
1629
|
/**
|
|
@@ -1610,6 +1632,8 @@ export interface IEngineEvents {
|
|
|
1610
1632
|
* @region Advanced Feature
|
|
1611
1633
|
*/
|
|
1612
1634
|
[EngineEventsTypes.onAudioMixingStateChanged]: (event: AudioMixingStateChangedEvent) => void;
|
|
1635
|
+
[EngineEventsTypes.onUserMessageReceivedOutsideRoom]: (event: UserMessageEvent) => void;
|
|
1636
|
+
[EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]: (event: UserBinaryMessageEvent) => void;
|
|
1613
1637
|
}
|
|
1614
1638
|
|
|
1615
1639
|
/**
|
|
@@ -2125,6 +2149,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2125
2149
|
* @region Video Management
|
|
2126
2150
|
*/
|
|
2127
2151
|
setVideoCaptureConfig(config: TrackCaptureConfig): Promise<void>;
|
|
2152
|
+
login(token: string | null, userId: string): Promise<void>;
|
|
2153
|
+
logout(): Promise<void>;
|
|
2154
|
+
updateLoginToken(token: string | null): Promise<void>;
|
|
2155
|
+
getPeerOnlineStatus(userId: string): Promise<USER_ONLINE_STATUS>;
|
|
2156
|
+
sendUserMessageOutsideRoom(userId: string, message: string): Promise<any>;
|
|
2157
|
+
sendUserBinaryMessageOutsideRoom(userId: string, message: ArrayBuffer): Promise<any>;
|
|
2158
|
+
setServerParams(signature: string, url: string): Promise<any>;
|
|
2159
|
+
sendServerMessage(message: string): Promise<any>;
|
|
2160
|
+
sendServerBinaryMessage(message: ArrayBuffer): Promise<any>;
|
|
2128
2161
|
}
|
|
2129
2162
|
|
|
2130
2163
|
/**
|
|
@@ -2741,7 +2774,7 @@ export interface LiveTranscodeAudioConfig {
|
|
|
2741
2774
|
/**
|
|
2742
2775
|
* The AAC profile to be set
|
|
2743
2776
|
*/
|
|
2744
|
-
AACProfile?: "LC" | "
|
|
2777
|
+
AACProfile?: "LC" | "HEv1" | "HEv2";
|
|
2745
2778
|
}
|
|
2746
2779
|
|
|
2747
2780
|
/**
|
|
@@ -2852,6 +2885,11 @@ export interface RemoteStreamKey {
|
|
|
2852
2885
|
*/
|
|
2853
2886
|
streamIndex: StreamIndex;
|
|
2854
2887
|
}
|
|
2888
|
+
export declare enum USER_ONLINE_STATUS {
|
|
2889
|
+
OFFLINE = 0,
|
|
2890
|
+
ONLINE = 1,
|
|
2891
|
+
UNREACHABLE = 2
|
|
2892
|
+
}
|
|
2855
2893
|
|
|
2856
2894
|
/**
|
|
2857
2895
|
* Point-to-point text message
|
|
@@ -3004,7 +3042,7 @@ export interface IVERTC {
|
|
|
3004
3042
|
* - `False`: Not Supported
|
|
3005
3043
|
* @region Engine Management
|
|
3006
3044
|
*/
|
|
3007
|
-
isSupported: () => boolean
|
|
3045
|
+
isSupported: () => Promise<boolean>;
|
|
3008
3046
|
}
|
|
3009
3047
|
declare class VERTC implements IVERTC {
|
|
3010
3048
|
getSdkVersion: () => string;
|
|
@@ -3023,7 +3061,7 @@ declare class VERTC implements IVERTC {
|
|
|
3023
3061
|
getAudioPlayback: () => Promise<RTCDevice[]>;
|
|
3024
3062
|
getParameter: typeof getParameter;
|
|
3025
3063
|
setParameter: typeof setParameter;
|
|
3026
|
-
isSupported: () => boolean
|
|
3064
|
+
isSupported: () => Promise<boolean>;
|
|
3027
3065
|
events: typeof EngineEventsTypes;
|
|
3028
3066
|
ErrorCode: typeof ErrorCode;
|
|
3029
3067
|
platform: string;
|