agora-electron-sdk 4.3.0 → 4.3.1-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/gulpfile.js +11 -4
- package/js/Private/AgoraBase.js +121 -24
- package/js/Private/AgoraMediaBase.js +15 -3
- package/js/Private/IAgoraRtcEngine.js +3 -3
- package/js/Private/impl/AgoraMediaBaseImpl.js +11 -1
- package/js/Private/impl/IAgoraMediaEngineImpl.js +28 -0
- package/js/Private/impl/IAgoraMediaPlayerImpl.js +2 -2
- package/js/Private/impl/IAgoraMusicContentCenterImpl.js +1 -1
- package/js/Private/impl/IAgoraRtcEngineExImpl.js +37 -0
- package/js/Private/impl/IAgoraRtcEngineImpl.js +123 -11
- package/js/Private/impl/IAudioDeviceManagerImpl.js +2 -2
- package/js/Private/internal/IrisApiEngine.js +6 -0
- package/js/Private/internal/MediaEngineInternal.js +25 -5
- package/js/Private/internal/MediaPlayerInternal.js +0 -6
- package/js/Private/internal/MusicContentCenterInternal.js +0 -4
- package/js/Private/internal/RtcEngineExInternal.js +10 -14
- package/js/Private/ti/AgoraMediaBase-ti.js +5 -1
- package/js/Private/ti/IAgoraRtcEngine-ti.js +1 -0
- package/package.json +5 -3
- package/scripts/buildJS.js +3 -3
- package/scripts/clean.js +6 -35
- package/scripts/downloadPrebuild.js +50 -3
- package/scripts/synclib.js +32 -12
- package/scripts/util.js +29 -0
- package/ts/Private/AgoraBase.ts +146 -33
- package/ts/Private/AgoraMediaBase.ts +77 -47
- package/ts/Private/IAgoraLog.ts +1 -1
- package/ts/Private/IAgoraMediaEngine.ts +35 -5
- package/ts/Private/IAgoraMediaPlayer.ts +10 -1
- package/ts/Private/IAgoraRtcEngine.ts +147 -102
- package/ts/Private/IAgoraRtcEngineEx.ts +39 -4
- package/ts/Private/IAudioDeviceManager.ts +2 -2
- package/ts/Private/extension/IAgoraMediaEngineExtension.ts +3 -1
- package/ts/Private/impl/AgoraMediaBaseImpl.ts +15 -0
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +37 -0
- package/ts/Private/impl/IAgoraMediaPlayerImpl.ts +2 -2
- package/ts/Private/impl/IAgoraMusicContentCenterImpl.ts +1 -1
- package/ts/Private/impl/IAgoraRtcEngineExImpl.ts +53 -0
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +153 -11
- package/ts/Private/impl/IAudioDeviceManagerImpl.ts +2 -2
- package/ts/Private/internal/IrisApiEngine.ts +11 -1
- package/ts/Private/internal/MediaEngineInternal.ts +31 -0
- package/ts/Private/internal/MediaPlayerInternal.ts +0 -14
- package/ts/Private/internal/MusicContentCenterInternal.ts +0 -7
- package/ts/Private/internal/RtcEngineExInternal.ts +9 -28
- package/ts/Private/ti/AgoraMediaBase-ti.ts +5 -0
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +1 -0
- package/types/Private/AgoraBase.d.ts +146 -36
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +77 -48
- package/types/Private/AgoraMediaBase.d.ts.map +1 -1
- package/types/Private/IAgoraLog.d.ts +1 -1
- package/types/Private/IAgoraMediaEngine.d.ts +33 -6
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayer.d.ts +10 -1
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngine.d.ts +132 -103
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngineEx.d.ts +33 -4
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
- package/types/Private/IAudioDeviceManager.d.ts +2 -2
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts +2 -2
- package/types/Private/extension/IAgoraMediaEngineExtension.d.ts.map +1 -1
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts +2 -1
- package/types/Private/impl/AgoraMediaBaseImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +5 -1
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts +4 -0
- package/types/Private/impl/IAgoraRtcEngineExImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +18 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
- package/types/Private/internal/IrisApiEngine.d.ts +3 -2
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
- package/types/Private/internal/MediaEngineInternal.d.ts +4 -1
- package/types/Private/internal/MediaEngineInternal.d.ts.map +1 -1
- package/types/Private/internal/MediaPlayerInternal.d.ts +0 -2
- package/types/Private/internal/MediaPlayerInternal.d.ts.map +1 -1
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
- package/types/Private/internal/RtcEngineExInternal.d.ts +1 -5
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
- package/types/Private/ti/AgoraMediaBase-ti.d.ts +1 -0
- package/types/Private/ti/AgoraMediaBase-ti.d.ts.map +1 -1
- package/types/Private/ti/IAgoraRtcEngine-ti.d.ts.map +1 -1
|
@@ -2,6 +2,7 @@ import { createCheckers } from 'ts-interface-checker';
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
IAudioFrameObserver,
|
|
5
|
+
IFaceInfoObserver,
|
|
5
6
|
IVideoEncodedFrameObserver,
|
|
6
7
|
IVideoFrameObserver,
|
|
7
8
|
} from '../AgoraMediaBase';
|
|
@@ -20,6 +21,7 @@ export class MediaEngineInternal extends IMediaEngineImpl {
|
|
|
20
21
|
static _audio_frame_observers: IAudioFrameObserver[] = [];
|
|
21
22
|
static _video_frame_observers: IVideoFrameObserver[] = [];
|
|
22
23
|
static _video_encoded_frame_observers: IVideoEncodedFrameObserver[] = [];
|
|
24
|
+
static _face_info_observers: IFaceInfoObserver[] = [];
|
|
23
25
|
|
|
24
26
|
override registerAudioFrameObserver(observer: IAudioFrameObserver): number {
|
|
25
27
|
if (
|
|
@@ -82,10 +84,30 @@ export class MediaEngineInternal extends IMediaEngineImpl {
|
|
|
82
84
|
return super.unregisterVideoEncodedFrameObserver(observer);
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
override registerFaceInfoObserver(observer: IFaceInfoObserver): number {
|
|
88
|
+
if (
|
|
89
|
+
!MediaEngineInternal._face_info_observers.find(
|
|
90
|
+
(value) => value === observer
|
|
91
|
+
)
|
|
92
|
+
) {
|
|
93
|
+
MediaEngineInternal._face_info_observers.push(observer);
|
|
94
|
+
}
|
|
95
|
+
return super.registerFaceInfoObserver(observer);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
override unregisterFaceInfoObserver(observer: IFaceInfoObserver): number {
|
|
99
|
+
MediaEngineInternal._face_info_observers =
|
|
100
|
+
MediaEngineInternal._face_info_observers.filter(
|
|
101
|
+
(value) => value !== observer
|
|
102
|
+
);
|
|
103
|
+
return super.unregisterFaceInfoObserver(observer);
|
|
104
|
+
}
|
|
105
|
+
|
|
85
106
|
override release() {
|
|
86
107
|
MediaEngineInternal._audio_frame_observers = [];
|
|
87
108
|
MediaEngineInternal._video_frame_observers = [];
|
|
88
109
|
MediaEngineInternal._video_encoded_frame_observers = [];
|
|
110
|
+
MediaEngineInternal._face_info_observers = [];
|
|
89
111
|
this.removeAllListeners();
|
|
90
112
|
super.release();
|
|
91
113
|
}
|
|
@@ -120,6 +142,15 @@ export class MediaEngineInternal extends IMediaEngineImpl {
|
|
|
120
142
|
this.registerVideoEncodedFrameObserver({});
|
|
121
143
|
}
|
|
122
144
|
}
|
|
145
|
+
if (
|
|
146
|
+
checkers.IFaceInfoObserver?.strictTest({
|
|
147
|
+
[eventType]: undefined,
|
|
148
|
+
})
|
|
149
|
+
) {
|
|
150
|
+
if (MediaEngineInternal._face_info_observers.length === 0) {
|
|
151
|
+
this.registerFaceInfoObserver({});
|
|
152
|
+
}
|
|
153
|
+
}
|
|
123
154
|
return true;
|
|
124
155
|
}
|
|
125
156
|
|
|
@@ -287,20 +287,6 @@ export class MediaPlayerInternal extends IMediaPlayerImpl {
|
|
|
287
287
|
return super.unregisterMediaPlayerAudioSpectrumObserver(observer);
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
protected override getApiTypeFromSetPlayerOptionInInt(
|
|
291
|
-
key: string,
|
|
292
|
-
value: number
|
|
293
|
-
): string {
|
|
294
|
-
return 'MediaPlayer_setPlayerOption_4d05d29';
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
protected override getApiTypeFromSetPlayerOptionInString(
|
|
298
|
-
key: string,
|
|
299
|
-
value: string
|
|
300
|
-
): string {
|
|
301
|
-
return 'MediaPlayer_setPlayerOption_ccad422';
|
|
302
|
-
}
|
|
303
|
-
|
|
304
290
|
override setView(view: HTMLElement): number {
|
|
305
291
|
if (!AgoraEnv.AgoraRendererManager) return -ErrorCodeType.ErrNotInitialized;
|
|
306
292
|
const renderer = AgoraEnv.AgoraRendererManager.addOrRemoveRenderer({
|
|
@@ -117,13 +117,6 @@ class _MusicPlayerInternal extends IMusicPlayerImpl {
|
|
|
117
117
|
override getMediaPlayerId(): number {
|
|
118
118
|
return this._mediaPlayerId;
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
protected override getApiTypeFromOpenWithSongCode(
|
|
122
|
-
songCode: number,
|
|
123
|
-
startPos = 0
|
|
124
|
-
): string {
|
|
125
|
-
return 'MusicPlayer_open_303b92e';
|
|
126
|
-
}
|
|
127
120
|
}
|
|
128
121
|
|
|
129
122
|
export class MusicPlayerInternal
|
|
@@ -34,7 +34,6 @@ import {
|
|
|
34
34
|
MetadataType,
|
|
35
35
|
RtcEngineContext,
|
|
36
36
|
SDKBuildInfo,
|
|
37
|
-
ScreenCaptureConfiguration,
|
|
38
37
|
ScreenCaptureSourceInfo,
|
|
39
38
|
Size,
|
|
40
39
|
} from '../IAgoraRtcEngine';
|
|
@@ -111,6 +110,9 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
|
|
|
111
110
|
this._media_engine.release();
|
|
112
111
|
this._local_spatial_audio_engine.release();
|
|
113
112
|
RtcEngineExInternal._event_handlers = [];
|
|
113
|
+
RtcEngineExInternal._event_handlers.map((it) => {
|
|
114
|
+
super.unregisterEventHandler(it);
|
|
115
|
+
});
|
|
114
116
|
RtcEngineExInternal._direct_cdn_streaming_event_handler = [];
|
|
115
117
|
RtcEngineExInternal._metadata_observer = [];
|
|
116
118
|
RtcEngineExInternal._audio_encoded_frame_observers = [];
|
|
@@ -231,6 +233,8 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
|
|
|
231
233
|
}
|
|
232
234
|
|
|
233
235
|
override registerEventHandler(eventHandler: IRtcEngineEventHandler): boolean {
|
|
236
|
+
// only call iris when no event handler registered
|
|
237
|
+
let callIris = RtcEngineExInternal._event_handlers.length === 0;
|
|
234
238
|
if (
|
|
235
239
|
!RtcEngineExInternal._event_handlers.find(
|
|
236
240
|
(value) => value === eventHandler
|
|
@@ -238,7 +242,7 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
|
|
|
238
242
|
) {
|
|
239
243
|
RtcEngineExInternal._event_handlers.push(eventHandler);
|
|
240
244
|
}
|
|
241
|
-
return super.registerEventHandler(eventHandler);
|
|
245
|
+
return callIris ? super.registerEventHandler(eventHandler) : true;
|
|
242
246
|
}
|
|
243
247
|
|
|
244
248
|
override unregisterEventHandler(
|
|
@@ -248,7 +252,9 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
|
|
|
248
252
|
RtcEngineExInternal._event_handlers.filter(
|
|
249
253
|
(value) => value !== eventHandler
|
|
250
254
|
);
|
|
251
|
-
|
|
255
|
+
// only call iris when no event handler registered
|
|
256
|
+
let callIris = RtcEngineExInternal._event_handlers.length === 0;
|
|
257
|
+
return callIris ? super.unregisterEventHandler(eventHandler) : true;
|
|
252
258
|
}
|
|
253
259
|
|
|
254
260
|
override createMediaPlayer(): IMediaPlayer {
|
|
@@ -348,10 +354,6 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
|
|
|
348
354
|
: 'RtcEngine_setClientRole_b46cc48';
|
|
349
355
|
}
|
|
350
356
|
|
|
351
|
-
protected override getApiTypeFromStartPreviewWithoutSourceType(): string {
|
|
352
|
-
return 'RtcEngine_startPreview';
|
|
353
|
-
}
|
|
354
|
-
|
|
355
357
|
protected override getApiTypeFromEnableDualStreamMode(
|
|
356
358
|
enabled: boolean,
|
|
357
359
|
streamConfig?: SimulcastStreamConfig
|
|
@@ -384,27 +386,6 @@ export class RtcEngineExInternal extends IRtcEngineExImpl {
|
|
|
384
386
|
: 'RtcEngine_joinChannelWithUserAccount_4685af9';
|
|
385
387
|
}
|
|
386
388
|
|
|
387
|
-
protected override getApiTypeFromStartScreenCaptureBySourceType(
|
|
388
|
-
sourceType: VideoSourceType,
|
|
389
|
-
config: ScreenCaptureConfiguration
|
|
390
|
-
): string {
|
|
391
|
-
return 'RtcEngine_startScreenCapture_9ebb320';
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
protected override getApiTypeFromStopScreenCaptureBySourceType(
|
|
395
|
-
sourceType: VideoSourceType
|
|
396
|
-
): string {
|
|
397
|
-
return 'RtcEngine_stopScreenCapture_4fd718e';
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
protected override getApiTypeFromPreloadChannelWithUserAccount(
|
|
401
|
-
token: string,
|
|
402
|
-
channelId: string,
|
|
403
|
-
userAccount: string
|
|
404
|
-
): string {
|
|
405
|
-
return 'RtcEngine_preloadChannel_a0779eb';
|
|
406
|
-
}
|
|
407
|
-
|
|
408
389
|
override getAudioDeviceManager(): IAudioDeviceManager {
|
|
409
390
|
return this._audio_device_manager;
|
|
410
391
|
}
|
|
@@ -36,6 +36,10 @@ export const IVideoFrameObserver = t.iface([], {
|
|
|
36
36
|
"onTranscodedVideoFrame": t.opt(t.func("void", t.param("videoFrame", "VideoFrame"))),
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
export const IFaceInfoObserver = t.iface([], {
|
|
40
|
+
"onFaceInfo": t.opt(t.func("void", t.param("outFaceInfo", "string"))),
|
|
41
|
+
});
|
|
42
|
+
|
|
39
43
|
export const IMediaRecorderObserver = t.iface([], {
|
|
40
44
|
"onRecorderStateChanged": t.opt(t.func("void", t.param("channelId", "string"), t.param("uid", "number"), t.param("state", "RecorderState"), t.param("reason", "RecorderReasonCode"))),
|
|
41
45
|
"onRecorderInfoUpdated": t.opt(t.func("void", t.param("channelId", "string"), t.param("uid", "number"), t.param("info", "RecorderInfo"))),
|
|
@@ -48,6 +52,7 @@ const exportedTypeSuite: t.ITypeSuite = {
|
|
|
48
52
|
IAudioSpectrumObserver,
|
|
49
53
|
IVideoEncodedFrameObserver,
|
|
50
54
|
IVideoFrameObserver,
|
|
55
|
+
IFaceInfoObserver,
|
|
51
56
|
IMediaRecorderObserver,
|
|
52
57
|
};
|
|
53
58
|
export default exportedTypeSuite;
|
|
@@ -94,6 +94,7 @@ export const IRtcEngineEventHandler = t.iface([], {
|
|
|
94
94
|
"onAudioPublishStateChanged": t.opt(t.func("void", t.param("channel", "string"), t.param("oldState", "StreamPublishState"), t.param("newState", "StreamPublishState"), t.param("elapseSinceLastState", "number"))),
|
|
95
95
|
"onVideoPublishStateChanged": t.opt(t.func("void", t.param("source", "VideoSourceType"), t.param("channel", "string"), t.param("oldState", "StreamPublishState"), t.param("newState", "StreamPublishState"), t.param("elapseSinceLastState", "number"))),
|
|
96
96
|
"onTranscodedStreamLayoutInfo": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("uid", "number"), t.param("width", "number"), t.param("height", "number"), t.param("layoutCount", "number"), t.param("layoutlist", t.array("VideoLayout")))),
|
|
97
|
+
"onAudioMetadataReceived": t.opt(t.func("void", t.param("connection", "RtcConnection"), t.param("uid", "number"), t.param("metadata", "string"), t.param("length", "number"))),
|
|
97
98
|
"onExtensionEvent": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"), t.param("key", "string"), t.param("value", "string"))),
|
|
98
99
|
"onExtensionStarted": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"))),
|
|
99
100
|
"onExtensionStopped": t.opt(t.func("void", t.param("provider", "string"), t.param("extension", "string"))),
|
|
@@ -312,13 +312,17 @@ export declare enum ErrorCodeType {
|
|
|
312
312
|
*/
|
|
313
313
|
ErrSetClientRoleNotAuthorized = 119,
|
|
314
314
|
/**
|
|
315
|
-
* 120:
|
|
315
|
+
* 120: Media streams decryption fails. The user might use an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel.
|
|
316
316
|
*/
|
|
317
317
|
ErrDecryptionFailed = 120,
|
|
318
318
|
/**
|
|
319
319
|
* 121: The user ID is invalid.
|
|
320
320
|
*/
|
|
321
321
|
ErrInvalidUserId = 121,
|
|
322
|
+
/**
|
|
323
|
+
* 122: Data streams decryption fails. The user might use an incorrect password to join the channel. Check the entered password, or tell the user to try rejoining the channel.
|
|
324
|
+
*/
|
|
325
|
+
ErrDatastreamDecryptionFailed = 122,
|
|
322
326
|
/**
|
|
323
327
|
* 123: The user is banned from the server.
|
|
324
328
|
*/
|
|
@@ -863,6 +867,27 @@ export declare enum VideoCodecType {
|
|
|
863
867
|
*/
|
|
864
868
|
VideoCodecGenericJpeg = 20
|
|
865
869
|
}
|
|
870
|
+
/**
|
|
871
|
+
* @ignore
|
|
872
|
+
*/
|
|
873
|
+
export declare enum CameraFocalLengthType {
|
|
874
|
+
/**
|
|
875
|
+
* @ignore
|
|
876
|
+
*/
|
|
877
|
+
CameraFocalLengthDefault = 0,
|
|
878
|
+
/**
|
|
879
|
+
* @ignore
|
|
880
|
+
*/
|
|
881
|
+
CameraFocalLengthWideAngle = 1,
|
|
882
|
+
/**
|
|
883
|
+
* @ignore
|
|
884
|
+
*/
|
|
885
|
+
CameraFocalLengthUltraWide = 2,
|
|
886
|
+
/**
|
|
887
|
+
* @ignore
|
|
888
|
+
*/
|
|
889
|
+
CameraFocalLengthTelephoto = 3
|
|
890
|
+
}
|
|
866
891
|
/**
|
|
867
892
|
* @ignore
|
|
868
893
|
*/
|
|
@@ -1159,6 +1184,10 @@ export declare class EncodedVideoFrameInfo {
|
|
|
1159
1184
|
* The type of video streams. See VideoStreamType.
|
|
1160
1185
|
*/
|
|
1161
1186
|
streamType?: VideoStreamType;
|
|
1187
|
+
/**
|
|
1188
|
+
* @ignore
|
|
1189
|
+
*/
|
|
1190
|
+
presentationMs?: number;
|
|
1162
1191
|
}
|
|
1163
1192
|
/**
|
|
1164
1193
|
* Compression preference for video encoding.
|
|
@@ -1277,6 +1306,19 @@ export declare class CodecCapInfo {
|
|
|
1277
1306
|
*/
|
|
1278
1307
|
codecLevels?: CodecCapLevels;
|
|
1279
1308
|
}
|
|
1309
|
+
/**
|
|
1310
|
+
* @ignore
|
|
1311
|
+
*/
|
|
1312
|
+
export declare class FocalLengthInfo {
|
|
1313
|
+
/**
|
|
1314
|
+
* @ignore
|
|
1315
|
+
*/
|
|
1316
|
+
cameraDirection?: number;
|
|
1317
|
+
/**
|
|
1318
|
+
* @ignore
|
|
1319
|
+
*/
|
|
1320
|
+
focalLengthType?: CameraFocalLengthType;
|
|
1321
|
+
}
|
|
1280
1322
|
/**
|
|
1281
1323
|
* Video encoder configurations.
|
|
1282
1324
|
*/
|
|
@@ -1355,11 +1397,11 @@ export declare enum SimulcastStreamMode {
|
|
|
1355
1397
|
*/
|
|
1356
1398
|
export declare class SimulcastStreamConfig {
|
|
1357
1399
|
/**
|
|
1358
|
-
* The video dimension. See VideoDimensions. The default value is
|
|
1400
|
+
* The video dimension. See VideoDimensions. The default value is 50% of the high-quality video stream.
|
|
1359
1401
|
*/
|
|
1360
1402
|
dimensions?: VideoDimensions;
|
|
1361
1403
|
/**
|
|
1362
|
-
* Video receive bitrate (Kbps), represented by an instantaneous value. The
|
|
1404
|
+
* Video receive bitrate (Kbps), represented by an instantaneous value. This parameter does not need to be set. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you set.
|
|
1363
1405
|
*/
|
|
1364
1406
|
kBitrate?: number;
|
|
1365
1407
|
/**
|
|
@@ -1414,7 +1456,7 @@ export declare class WatermarkRatio {
|
|
|
1414
1456
|
*/
|
|
1415
1457
|
export declare class WatermarkOptions {
|
|
1416
1458
|
/**
|
|
1417
|
-
*
|
|
1459
|
+
* Whether the watermark is visible in the local preview view: true : (Default) The watermark is visible in the local preview view. false : The watermark is not visible in the local preview view.
|
|
1418
1460
|
*/
|
|
1419
1461
|
visibleInPreview?: boolean;
|
|
1420
1462
|
/**
|
|
@@ -1754,15 +1796,15 @@ export declare enum AudioScenarioType {
|
|
|
1754
1796
|
*/
|
|
1755
1797
|
export declare class VideoFormat {
|
|
1756
1798
|
/**
|
|
1757
|
-
* The width (px) of the video frame.
|
|
1799
|
+
* The width (px) of the video frame. The default value is 960.
|
|
1758
1800
|
*/
|
|
1759
1801
|
width?: number;
|
|
1760
1802
|
/**
|
|
1761
|
-
* The height (px) of the video frame.
|
|
1803
|
+
* The height (px) of the video frame. The default value is 540.
|
|
1762
1804
|
*/
|
|
1763
1805
|
height?: number;
|
|
1764
1806
|
/**
|
|
1765
|
-
* The video frame rate (fps).
|
|
1807
|
+
* The video frame rate (fps). The default value is 15.
|
|
1766
1808
|
*/
|
|
1767
1809
|
fps?: number;
|
|
1768
1810
|
}
|
|
@@ -1872,6 +1914,35 @@ export declare enum CaptureBrightnessLevelType {
|
|
|
1872
1914
|
*/
|
|
1873
1915
|
CaptureBrightnessLevelDark = 2
|
|
1874
1916
|
}
|
|
1917
|
+
/**
|
|
1918
|
+
* @ignore
|
|
1919
|
+
*/
|
|
1920
|
+
export declare enum CameraStabilizationMode {
|
|
1921
|
+
/**
|
|
1922
|
+
* @ignore
|
|
1923
|
+
*/
|
|
1924
|
+
CameraStabilizationModeOff = -1,
|
|
1925
|
+
/**
|
|
1926
|
+
* @ignore
|
|
1927
|
+
*/
|
|
1928
|
+
CameraStabilizationModeAuto = 0,
|
|
1929
|
+
/**
|
|
1930
|
+
* @ignore
|
|
1931
|
+
*/
|
|
1932
|
+
CameraStabilizationModeLevel1 = 1,
|
|
1933
|
+
/**
|
|
1934
|
+
* @ignore
|
|
1935
|
+
*/
|
|
1936
|
+
CameraStabilizationModeLevel2 = 2,
|
|
1937
|
+
/**
|
|
1938
|
+
* @ignore
|
|
1939
|
+
*/
|
|
1940
|
+
CameraStabilizationModeLevel3 = 3,
|
|
1941
|
+
/**
|
|
1942
|
+
* @ignore
|
|
1943
|
+
*/
|
|
1944
|
+
CameraStabilizationModeMaxLevel = 3
|
|
1945
|
+
}
|
|
1875
1946
|
/**
|
|
1876
1947
|
* The state of the local audio.
|
|
1877
1948
|
*/
|
|
@@ -1922,11 +1993,11 @@ export declare enum LocalAudioStreamReason {
|
|
|
1922
1993
|
*/
|
|
1923
1994
|
LocalAudioStreamReasonEncodeFailure = 5,
|
|
1924
1995
|
/**
|
|
1925
|
-
* 6: No local audio capture device. Remind your users to check whether the microphone is connected to the device properly in the control
|
|
1996
|
+
* 6: No local audio capture device. Remind your users to check whether the microphone is connected to the device properly in the control panel of the device or if the microphone is working properly.
|
|
1926
1997
|
*/
|
|
1927
1998
|
LocalAudioStreamReasonNoRecordingDevice = 6,
|
|
1928
1999
|
/**
|
|
1929
|
-
* 7: No local audio capture device. Remind your users to check whether the speaker is connected to the device properly in the control
|
|
2000
|
+
* 7: No local audio capture device. Remind your users to check whether the speaker is connected to the device properly in the control panel of the device or if the speaker is working properly.
|
|
1930
2001
|
*/
|
|
1931
2002
|
LocalAudioStreamReasonNoPlayoutDevice = 7,
|
|
1932
2003
|
/**
|
|
@@ -1934,11 +2005,11 @@ export declare enum LocalAudioStreamReason {
|
|
|
1934
2005
|
*/
|
|
1935
2006
|
LocalAudioStreamReasonInterrupted = 8,
|
|
1936
2007
|
/**
|
|
1937
|
-
* 9: (Windows only) The ID of the local audio-capture device is invalid.
|
|
2008
|
+
* 9: (Windows only) The ID of the local audio-capture device is invalid. Prompt the user to check the audio capture device ID.
|
|
1938
2009
|
*/
|
|
1939
2010
|
LocalAudioStreamReasonRecordInvalidId = 9,
|
|
1940
2011
|
/**
|
|
1941
|
-
* 10: (Windows only) The ID of the local audio-playback device is invalid.
|
|
2012
|
+
* 10: (Windows only) The ID of the local audio-playback device is invalid. Prompt the user to check the audio playback device ID.
|
|
1942
2013
|
*/
|
|
1943
2014
|
LocalAudioStreamReasonPlayoutInvalidId = 10
|
|
1944
2015
|
}
|
|
@@ -1976,15 +2047,15 @@ export declare enum LocalVideoStreamReason {
|
|
|
1976
2047
|
*/
|
|
1977
2048
|
LocalVideoStreamReasonFailure = 1,
|
|
1978
2049
|
/**
|
|
1979
|
-
* 2: No permission to use the local video capturing device.
|
|
2050
|
+
* 2: No permission to use the local video capturing device. Prompt the user to grant permissions and rejoin the channel. Deprecated: This enumerator is deprecated. Please use CAMERA in the onPermissionError callback instead.
|
|
1980
2051
|
*/
|
|
1981
2052
|
LocalVideoStreamReasonDeviceNoPermission = 2,
|
|
1982
2053
|
/**
|
|
1983
|
-
* 3: The local video capturing device is in use.
|
|
2054
|
+
* 3: The local video capturing device is in use. Prompt the user to check if the camera is being used by another app, or try to rejoin the channel.
|
|
1984
2055
|
*/
|
|
1985
2056
|
LocalVideoStreamReasonDeviceBusy = 3,
|
|
1986
2057
|
/**
|
|
1987
|
-
* 4: The local video capture fails.
|
|
2058
|
+
* 4: The local video capture fails. Prompt the user to check whether the video capture device is working properly, whether the camera is used by another app, or try to rejoin the channel.
|
|
1988
2059
|
*/
|
|
1989
2060
|
LocalVideoStreamReasonCaptureFailure = 4,
|
|
1990
2061
|
/**
|
|
@@ -2011,17 +2082,25 @@ export declare enum LocalVideoStreamReason {
|
|
|
2011
2082
|
* 10: (macOS and Windows only) The SDK cannot find the video device in the video device list. Check whether the ID of the video device is valid.
|
|
2012
2083
|
*/
|
|
2013
2084
|
LocalVideoStreamReasonDeviceInvalidId = 10,
|
|
2085
|
+
/**
|
|
2086
|
+
* @ignore
|
|
2087
|
+
*/
|
|
2088
|
+
LocalVideoStreamReasonDeviceInterrupt = 14,
|
|
2089
|
+
/**
|
|
2090
|
+
* @ignore
|
|
2091
|
+
*/
|
|
2092
|
+
LocalVideoStreamReasonDeviceFatalError = 15,
|
|
2014
2093
|
/**
|
|
2015
2094
|
* 101: The current video capture device is unavailable due to excessive system pressure.
|
|
2016
2095
|
*/
|
|
2017
2096
|
LocalVideoStreamReasonDeviceSystemPressure = 101,
|
|
2018
2097
|
/**
|
|
2019
|
-
* 11: (macOS and Windows only) The shared
|
|
2098
|
+
* 11: (macOS and Windows only) The shared window is minimized when you call the startScreenCaptureByWindowId method to share a window. The SDK cannot share a minimized window. Please prompt the user to unminimize the shared window.
|
|
2020
2099
|
*/
|
|
2021
2100
|
LocalVideoStreamReasonScreenCaptureWindowMinimized = 11,
|
|
2022
2101
|
/**
|
|
2023
2102
|
* 12: (macOS and Windows only) The error code indicates that a window shared by the window ID has been closed or a full-screen window shared by the window ID has exited full-screen mode. After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a black screen, Agora recommends that you immediately stop screen sharing. Common scenarios reporting this error code:
|
|
2024
|
-
*
|
|
2103
|
+
* The local user closes the shared window.
|
|
2025
2104
|
* The local user shows some slides in full-screen mode first, and then shares the windows of the slides. After the user exits full-screen mode, the SDK reports this error code.
|
|
2026
2105
|
* The local user watches a web video or reads a web document in full-screen mode first, and then shares the window of the web video or document. After the user exits full-screen mode, the SDK reports this error code.
|
|
2027
2106
|
*/
|
|
@@ -2055,7 +2134,7 @@ export declare enum LocalVideoStreamReason {
|
|
|
2055
2134
|
*/
|
|
2056
2135
|
LocalVideoStreamReasonScreenCaptureWindowRecoverFromHidden = 26,
|
|
2057
2136
|
/**
|
|
2058
|
-
*
|
|
2137
|
+
* 27: The window for screen capture has been restored from the minimized state.
|
|
2059
2138
|
*/
|
|
2060
2139
|
LocalVideoStreamReasonScreenCaptureWindowRecoverFromMinimized = 27,
|
|
2061
2140
|
/**
|
|
@@ -2127,7 +2206,15 @@ export declare enum RemoteAudioStateReason {
|
|
|
2127
2206
|
/**
|
|
2128
2207
|
* 7: The remote user leaves the channel.
|
|
2129
2208
|
*/
|
|
2130
|
-
RemoteAudioReasonRemoteOffline = 7
|
|
2209
|
+
RemoteAudioReasonRemoteOffline = 7,
|
|
2210
|
+
/**
|
|
2211
|
+
* @ignore
|
|
2212
|
+
*/
|
|
2213
|
+
RemoteAudioReasonNoPacketReceive = 8,
|
|
2214
|
+
/**
|
|
2215
|
+
* @ignore
|
|
2216
|
+
*/
|
|
2217
|
+
RemoteAudioReasonLocalPlayFailed = 9
|
|
2131
2218
|
}
|
|
2132
2219
|
/**
|
|
2133
2220
|
* The state of the remote video stream.
|
|
@@ -2552,7 +2639,7 @@ export declare enum RtmpStreamPublishReason {
|
|
|
2552
2639
|
*/
|
|
2553
2640
|
RtmpStreamPublishReasonInvalidAppid = 15,
|
|
2554
2641
|
/**
|
|
2555
|
-
* 16: Your project does not have permission to use streaming services.
|
|
2642
|
+
* 16: Your project does not have permission to use streaming services.
|
|
2556
2643
|
*/
|
|
2557
2644
|
RtmpStreamPublishReasonInvalidPrivilege = 16,
|
|
2558
2645
|
/**
|
|
@@ -3240,7 +3327,7 @@ export declare class VideoCanvas {
|
|
|
3240
3327
|
*/
|
|
3241
3328
|
subviewUid?: number;
|
|
3242
3329
|
/**
|
|
3243
|
-
* The video display window.
|
|
3330
|
+
* The video display window. In one VideoCanvas, you can only choose to set either view or surfaceTexture. If both are set, only the settings in view take effect.
|
|
3244
3331
|
*/
|
|
3245
3332
|
view?: any;
|
|
3246
3333
|
/**
|
|
@@ -3274,8 +3361,7 @@ export declare class VideoCanvas {
|
|
|
3274
3361
|
*/
|
|
3275
3362
|
cropArea?: Rectangle;
|
|
3276
3363
|
/**
|
|
3277
|
-
* (Optional) Whether the receiver enables alpha mask rendering: true : The receiver enables alpha mask rendering. false : (
|
|
3278
|
-
* This property applies to macOS only.
|
|
3364
|
+
* (Optional) Whether the receiver enables alpha mask rendering: true : The receiver enables alpha mask rendering. false : (Default) The receiver disables alpha mask rendering. Alpha mask rendering can create images with transparent effects and extract portraits from videos. When used in combination with other methods, you can implement effects such as portrait-in-picture and watermarking.
|
|
3279
3365
|
* The receiver can render alpha channel information only when the sender enables alpha transmission.
|
|
3280
3366
|
* To enable alpha transmission,.
|
|
3281
3367
|
*/
|
|
@@ -3290,7 +3376,7 @@ export declare class VideoCanvas {
|
|
|
3290
3376
|
*/
|
|
3291
3377
|
export declare enum LighteningContrastLevel {
|
|
3292
3378
|
/**
|
|
3293
|
-
*
|
|
3379
|
+
* 0: Low contrast level.
|
|
3294
3380
|
*/
|
|
3295
3381
|
LighteningContrastLow = 0,
|
|
3296
3382
|
/**
|
|
@@ -3509,7 +3595,7 @@ export declare class SegmentationProperty {
|
|
|
3509
3595
|
*/
|
|
3510
3596
|
modelType?: SegModelType;
|
|
3511
3597
|
/**
|
|
3512
|
-
* The range
|
|
3598
|
+
* The accuracy range for recognizing background colors in the image. The value range is [0,1], and the default value is 0.5. The larger the value, the wider the range of identifiable shades of pure color. When the value of this parameter is too large, the edge of the portrait and the pure color in the portrait range are also detected. Agora recommends that you dynamically adjust the value of this parameter according to the actual effect. This parameter only takes effect when modelType is set to SegModelGreen.
|
|
3513
3599
|
*/
|
|
3514
3600
|
greenCapacity?: number;
|
|
3515
3601
|
}
|
|
@@ -3650,6 +3736,10 @@ export declare enum AudioEffectPreset {
|
|
|
3650
3736
|
* Virtual surround sound, that is, the SDK generates a simulated surround sound field on the basis of stereo channels, thereby creating a surround sound effect. If the virtual surround sound is enabled, users need to use stereo audio playback devices to hear the anticipated audio effect.
|
|
3651
3737
|
*/
|
|
3652
3738
|
RoomAcousticsVirtualSurroundSound = 33622272,
|
|
3739
|
+
/**
|
|
3740
|
+
* The audio effect of chorus. Agora recommends using this effect in chorus scenarios to enhance the sense of depth and dimension in the vocals.
|
|
3741
|
+
*/
|
|
3742
|
+
RoomAcousticsChorus = 33623296,
|
|
3653
3743
|
/**
|
|
3654
3744
|
* A middle-aged man's voice. Agora recommends using this preset to process a male-sounding voice; otherwise, you may not hear the anticipated voice effect.
|
|
3655
3745
|
*/
|
|
@@ -3782,9 +3872,13 @@ export declare enum HeadphoneEqualizerPreset {
|
|
|
3782
3872
|
*/
|
|
3783
3873
|
export declare class ScreenCaptureParameters {
|
|
3784
3874
|
/**
|
|
3785
|
-
* The video encoding resolution of the
|
|
3875
|
+
* The video encoding resolution of the screen sharing stream. See VideoDimensions. The default value is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. If the screen dimensions are different from the value of this parameter, Agora applies the following strategies for encoding. Suppose dimensions is set to 1920 × 1080:
|
|
3786
3876
|
* If the value of the screen dimensions is lower than that of dimensions, for example, 1000 × 1000 pixels, the SDK uses the screen dimensions, that is, 1000 × 1000 pixels, for encoding.
|
|
3787
|
-
* If the value of the screen dimensions is higher than that of dimensions, for example, 2000 × 1500, the SDK uses the maximum value under with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 × 1080.
|
|
3877
|
+
* If the value of the screen dimensions is higher than that of dimensions, for example, 2000 × 1500, the SDK uses the maximum value under dimensions with the aspect ratio of the screen dimension (4:3) for encoding, that is, 1440 × 1080. When setting the encoding resolution in the scenario of sharing documents (ScreenScenarioDocument), choose one of the following two methods:
|
|
3878
|
+
* If you require the best image quality, it is recommended to set the encoding resolution to be the same as the capture resolution.
|
|
3879
|
+
* If you wish to achieve a relative balance between image quality, bandwidth, and system performance, then:
|
|
3880
|
+
* When the capture resolution is greater than 1920 × 1080, it is recommended that the encoding resolution is not less than 1920 × 1080.
|
|
3881
|
+
* When the capture resolution is less than 1920 × 1080, it is recommended that the encoding resolution is not less than 1280 × 720.
|
|
3788
3882
|
*/
|
|
3789
3883
|
dimensions?: VideoDimensions;
|
|
3790
3884
|
/**
|
|
@@ -4057,7 +4151,7 @@ export declare enum ChannelMediaRelayError {
|
|
|
4057
4151
|
*/
|
|
4058
4152
|
RelayErrorServerErrorResponse = 1,
|
|
4059
4153
|
/**
|
|
4060
|
-
* 2: No server response.
|
|
4154
|
+
* 2: No server response. This error may be caused by poor network connections. If this error occurs when initiating a channel media relay, you can try again later; if this error occurs during channel media relay, you can call leaveChannel to leave the channel. This error can also occur if the channel media relay service is not enabled in the project. You can contact to enable the service.
|
|
4061
4155
|
*/
|
|
4062
4156
|
RelayErrorServerNoResponse = 2,
|
|
4063
4157
|
/**
|
|
@@ -4270,6 +4364,10 @@ export declare class EncryptionConfig {
|
|
|
4270
4364
|
* Salt, 32 bytes in length. Agora recommends that you use OpenSSL to generate salt on the server side. See Media Stream Encryption for details. This parameter takes effect only in Aes128Gcm2 or Aes256Gcm2 encrypted mode. In this case, ensure that this parameter is not 0.
|
|
4271
4365
|
*/
|
|
4272
4366
|
encryptionKdfSalt?: number[];
|
|
4367
|
+
/**
|
|
4368
|
+
* Whether to enable data stream encryption: true : Enable data stream encryption. false : (Default) Disable data stream encryption.
|
|
4369
|
+
*/
|
|
4370
|
+
datastreamEncryptionEnabled?: boolean;
|
|
4273
4371
|
}
|
|
4274
4372
|
/**
|
|
4275
4373
|
* Encryption error type.
|
|
@@ -4280,13 +4378,21 @@ export declare enum EncryptionErrorType {
|
|
|
4280
4378
|
*/
|
|
4281
4379
|
EncryptionErrorInternalFailure = 0,
|
|
4282
4380
|
/**
|
|
4283
|
-
* 1:
|
|
4381
|
+
* 1: Media stream decryption error. Ensure that the receiver and the sender use the same encryption mode and key.
|
|
4284
4382
|
*/
|
|
4285
4383
|
EncryptionErrorDecryptionFailure = 1,
|
|
4286
4384
|
/**
|
|
4287
|
-
* 2:
|
|
4385
|
+
* 2: Media stream encryption error.
|
|
4386
|
+
*/
|
|
4387
|
+
EncryptionErrorEncryptionFailure = 2,
|
|
4388
|
+
/**
|
|
4389
|
+
* 3: Data stream decryption error. Ensure that the receiver and the sender use the same encryption mode and key.
|
|
4288
4390
|
*/
|
|
4289
|
-
|
|
4391
|
+
EncryptionErrorDatastreamDecryptionFailure = 3,
|
|
4392
|
+
/**
|
|
4393
|
+
* 4: Data stream encryption error.
|
|
4394
|
+
*/
|
|
4395
|
+
EncryptionErrorDatastreamEncryptionFailure = 4
|
|
4290
4396
|
}
|
|
4291
4397
|
/**
|
|
4292
4398
|
* @ignore
|
|
@@ -4421,21 +4527,25 @@ export declare class UserInfo {
|
|
|
4421
4527
|
userAccount?: string;
|
|
4422
4528
|
}
|
|
4423
4529
|
/**
|
|
4424
|
-
* The audio filter of in-ear monitoring.
|
|
4530
|
+
* The audio filter types of in-ear monitoring.
|
|
4425
4531
|
*/
|
|
4426
4532
|
export declare enum EarMonitoringFilterType {
|
|
4427
4533
|
/**
|
|
4428
|
-
* 1<<0:
|
|
4534
|
+
* 1<<0: No audio filter added to in-ear monitoring.
|
|
4429
4535
|
*/
|
|
4430
4536
|
EarMonitoringFilterNone = 1,
|
|
4431
4537
|
/**
|
|
4432
|
-
* 1<<1: Add
|
|
4538
|
+
* 1<<1: Add vocal effects audio filter to in-ear monitoring. If you implement functions such as voice beautifier and audio effect, users can hear the voice after adding these effects.
|
|
4433
4539
|
*/
|
|
4434
4540
|
EarMonitoringFilterBuiltInAudioFilters = 2,
|
|
4435
4541
|
/**
|
|
4436
|
-
* 1<<2:
|
|
4542
|
+
* 1<<2: Add noise suppression audio filter to in-ear monitoring.
|
|
4543
|
+
*/
|
|
4544
|
+
EarMonitoringFilterNoiseSuppression = 4,
|
|
4545
|
+
/**
|
|
4546
|
+
* 1<<15: Reuse the audio filter that has been processed on the sending end for in-ear monitoring. This enumerator reduces CPU usage while increasing in-ear monitoring latency, which is suitable for latency-tolerant scenarios requiring low CPU consumption.
|
|
4437
4547
|
*/
|
|
4438
|
-
|
|
4548
|
+
EarMonitoringFilterReusePostProcessingFilter = 32768
|
|
4439
4549
|
}
|
|
4440
4550
|
/**
|
|
4441
4551
|
* @ignore
|
|
@@ -4739,7 +4849,7 @@ export declare class SpatialAudioParams {
|
|
|
4739
4849
|
speaker_attenuation?: number;
|
|
4740
4850
|
/**
|
|
4741
4851
|
* Whether to enable the Doppler effect: When there is a relative displacement between the sound source and the receiver of the sound source, the tone heard by the receiver changes. true : Enable the Doppler effect. false : (Default) Disable the Doppler effect.
|
|
4742
|
-
* This parameter is suitable for scenarios where the sound source is moving at high speed (for example, racing games). It is not recommended for common audio and video interactive scenarios (for example, voice chat,
|
|
4852
|
+
* This parameter is suitable for scenarios where the sound source is moving at high speed (for example, racing games). It is not recommended for common audio and video interactive scenarios (for example, voice chat, co-streaming, or online KTV).
|
|
4743
4853
|
* When this parameter is enabled, Agora recommends that you set a regular period (such as 30 ms), and then call the updatePlayerPositionInfo, updateSelfPosition, and updateRemotePosition methods to continuously update the relative distance between the sound source and the receiver. The following factors can cause the Doppler effect to be unpredictable or the sound to be jittery: the period of updating the distance is too long, the updating period is irregular, or the distance information is lost due to network packet loss or delay.
|
|
4744
4854
|
*/
|
|
4745
4855
|
enable_doppler?: boolean;
|