agora-electron-sdk 4.2.2-dev.4 → 4.2.2-dev.7
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 +22 -0
- package/js/Private/AgoraBase.js +139 -53
- package/js/Private/AgoraMediaBase.js +13 -7
- package/js/Private/IAgoraRtcEngine.js +11 -11
- package/js/Private/IAgoraRtcEngineEx.js +1 -1
- package/js/Private/IAgoraSpatialAudio.js +2 -2
- package/js/Private/impl/IAgoraMediaEngineImpl.js +12 -6
- package/js/Private/impl/IAgoraRtcEngineImpl.js +7 -7
- package/js/Private/internal/IrisApiEngine.js +13 -0
- package/js/Private/internal/MusicContentCenterInternal.js +3 -0
- package/js/Private/internal/RtcEngineExInternal.js +24 -7
- package/js/Private/ti/IAgoraRtcEngine-ti.js +2 -2
- package/js/Renderer/WebGLRenderer/index.js +19 -19
- package/js/Renderer/YUVCanvasRenderer/index.js +1 -1
- package/package.json +3 -3
- package/scripts/zipBuild.js +3 -1
- package/ts/Private/AgoraBase.ts +296 -133
- package/ts/Private/AgoraMediaBase.ts +68 -34
- package/ts/Private/AgoraMediaPlayerTypes.ts +8 -5
- package/ts/Private/IAgoraLog.ts +7 -3
- package/ts/Private/IAgoraMediaEngine.ts +76 -35
- package/ts/Private/IAgoraMediaPlayer.ts +126 -64
- package/ts/Private/IAgoraMediaPlayerSource.ts +3 -1
- package/ts/Private/IAgoraRtcEngine.ts +1325 -530
- package/ts/Private/IAgoraRtcEngineEx.ts +227 -94
- package/ts/Private/IAgoraSpatialAudio.ts +71 -36
- package/ts/Private/IAudioDeviceManager.ts +61 -31
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +12 -6
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +9 -11
- package/ts/Private/internal/IrisApiEngine.ts +14 -0
- package/ts/Private/internal/MusicContentCenterInternal.ts +4 -0
- package/ts/Private/internal/RtcEngineExInternal.ts +36 -14
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +2 -2
- package/ts/Renderer/WebGLRenderer/index.ts +26 -21
- package/ts/Renderer/YUVCanvasRenderer/index.ts +1 -1
- package/types/Private/AgoraBase.d.ts +298 -135
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +69 -35
- package/types/Private/AgoraMediaBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaPlayerTypes.d.ts +8 -5
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -1
- package/types/Private/IAgoraLog.d.ts +7 -3
- package/types/Private/IAgoraLog.d.ts.map +1 -1
- package/types/Private/IAgoraMediaEngine.d.ts +76 -35
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayer.d.ts +126 -64
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts +3 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngine.d.ts +1326 -530
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngineEx.d.ts +227 -94
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
- package/types/Private/IAgoraSpatialAudio.d.ts +71 -36
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
- package/types/Private/IAudioDeviceManager.d.ts +61 -31
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +2 -2
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +5 -5
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
- package/types/Private/internal/MusicContentCenterInternal.d.ts +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -1
|
@@ -61,7 +61,6 @@ import {
|
|
|
61
61
|
RtmpStreamPublishErrorType,
|
|
62
62
|
RtmpStreamPublishState,
|
|
63
63
|
RtmpStreamingEvent,
|
|
64
|
-
ScreenCaptureFramerateCapability,
|
|
65
64
|
ScreenCaptureParameters,
|
|
66
65
|
ScreenCaptureParameters2,
|
|
67
66
|
ScreenScenarioType,
|
|
@@ -151,11 +150,11 @@ export enum MediaDeviceType {
|
|
|
151
150
|
*/
|
|
152
151
|
AudioApplicationPlayoutDevice = 4,
|
|
153
152
|
/**
|
|
154
|
-
* (For macOS only)5: Virtual audio playback device (virtual sound card).
|
|
153
|
+
* (For macOS only) 5: Virtual audio playback device (virtual sound card).
|
|
155
154
|
*/
|
|
156
155
|
AudioVirtualPlayoutDevice = 5,
|
|
157
156
|
/**
|
|
158
|
-
* (For macOS only)6: Virtual audio capturing device (virtual sound card).
|
|
157
|
+
* (For macOS only) 6: Virtual audio capturing device (virtual sound card).
|
|
159
158
|
*/
|
|
160
159
|
AudioVirtualRecordingDevice = 6,
|
|
161
160
|
}
|
|
@@ -173,11 +172,11 @@ export enum AudioMixingStateType {
|
|
|
173
172
|
*/
|
|
174
173
|
AudioMixingStatePaused = 711,
|
|
175
174
|
/**
|
|
176
|
-
* 713: The music file stops playing.The possible reasons include:AudioMixingReasonAllLoopsCompleted(723)AudioMixingReasonStoppedByUser(724)
|
|
175
|
+
* 713: The music file stops playing. The possible reasons include: AudioMixingReasonAllLoopsCompleted (723) AudioMixingReasonStoppedByUser (724)
|
|
177
176
|
*/
|
|
178
177
|
AudioMixingStateStopped = 713,
|
|
179
178
|
/**
|
|
180
|
-
* 714: An error occurs during the playback of the audio mixing file.The possible reasons include:AudioMixingReasonCanNotOpen(701)AudioMixingReasonTooFrequentCall(702)AudioMixingReasonInterruptedEof(703)
|
|
179
|
+
* 714: An error occurs during the playback of the audio mixing file. The possible reasons include: AudioMixingReasonCanNotOpen (701) AudioMixingReasonTooFrequentCall (702) AudioMixingReasonInterruptedEof (703)
|
|
181
180
|
*/
|
|
182
181
|
AudioMixingStateFailed = 714,
|
|
183
182
|
}
|
|
@@ -379,11 +378,11 @@ export class LocalVideoStats {
|
|
|
379
378
|
*/
|
|
380
379
|
uid?: number;
|
|
381
380
|
/**
|
|
382
|
-
* The actual bitrate (Kbps) while sending the local video stream.This value does not include the bitrate for resending the video after packet loss.
|
|
381
|
+
* The actual bitrate (Kbps) while sending the local video stream. This value does not include the bitrate for resending the video after packet loss.
|
|
383
382
|
*/
|
|
384
383
|
sentBitrate?: number;
|
|
385
384
|
/**
|
|
386
|
-
* The actual frame rate (fps) while sending the local video stream.This value does not include the frame rate for resending the video after packet loss.
|
|
385
|
+
* The actual frame rate (fps) while sending the local video stream. This value does not include the frame rate for resending the video after packet loss.
|
|
387
386
|
*/
|
|
388
387
|
sentFrameRate?: number;
|
|
389
388
|
/**
|
|
@@ -439,7 +438,7 @@ export class LocalVideoStats {
|
|
|
439
438
|
*/
|
|
440
439
|
qualityAdaptIndication?: QualityAdaptIndication;
|
|
441
440
|
/**
|
|
442
|
-
* The bitrate (Kbps) while encoding the local video stream.This value does not include the bitrate for resending the video after packet loss.
|
|
441
|
+
* The bitrate (Kbps) while encoding the local video stream. This value does not include the bitrate for resending the video after packet loss.
|
|
443
442
|
*/
|
|
444
443
|
encodedBitrate?: number;
|
|
445
444
|
/**
|
|
@@ -463,7 +462,9 @@ export class LocalVideoStats {
|
|
|
463
462
|
*/
|
|
464
463
|
dualStreamEnabled?: boolean;
|
|
465
464
|
/**
|
|
466
|
-
* The local video encoding acceleration type.
|
|
465
|
+
* The local video encoding acceleration type.
|
|
466
|
+
* 0: Software encoding is applied without acceleration.
|
|
467
|
+
* 1: Hardware encoding is applied for acceleration.
|
|
467
468
|
*/
|
|
468
469
|
hwEncoderAccelerating?: number;
|
|
469
470
|
}
|
|
@@ -485,7 +486,7 @@ export class RemoteAudioStats {
|
|
|
485
486
|
*/
|
|
486
487
|
networkTransportDelay?: number;
|
|
487
488
|
/**
|
|
488
|
-
* The network delay (ms) from the audio receiver to the jitter buffer.When the receiving end is an audience member and audienceLatencyLevel of ClientRoleOptions is 1, this parameter does not take effect.
|
|
489
|
+
* The network delay (ms) from the audio receiver to the jitter buffer. When the receiving end is an audience member and audienceLatencyLevel of ClientRoleOptions is 1, this parameter does not take effect.
|
|
489
490
|
*/
|
|
490
491
|
jitterBufferDelay?: number;
|
|
491
492
|
/**
|
|
@@ -513,7 +514,7 @@ export class RemoteAudioStats {
|
|
|
513
514
|
*/
|
|
514
515
|
frozenRate?: number;
|
|
515
516
|
/**
|
|
516
|
-
* The quality of the remote audio stream in the reported interval. The quality is determined by the Agora real-time audio MOS (Mean Opinion Score) measurement method. The return value range is [0, 500]. Dividing the return value by 100 gets the MOS score, which ranges from 0 to 5. The higher the score, the better the audio quality.The subjective perception of audio quality corresponding to the Agora real-time audio MOS scores is as follows:MOS
|
|
517
|
+
* The quality of the remote audio stream in the reported interval. The quality is determined by the Agora real-time audio MOS (Mean Opinion Score) measurement method. The return value range is [0, 500]. Dividing the return value by 100 gets the MOS score, which ranges from 0 to 5. The higher the score, the better the audio quality. The subjective perception of audio quality corresponding to the Agora real-time audio MOS scores is as follows: MOS score Perception of audio quality Greater than 4 Excellent. The audio sounds clear and smooth. From 3.5 to 4 Good. The audio has some perceptible impairment but still sounds clear. From 3 to 3.5 Fair. The audio freezes occasionally and requires attentive listening. From 2.5 to 3 Poor. The audio sounds choppy and requires considerable effort to understand. From 2 to 2.5 Bad. The audio has occasional noise. Consecutive audio dropouts occur, resulting in some information loss. The users can communicate only with difficulty. Less than 2 Very bad. The audio has persistent noise. Consecutive audio dropouts are frequent, resulting in severe information loss. Communication is nearly impossible.
|
|
517
518
|
*/
|
|
518
519
|
mosValue?: number;
|
|
519
520
|
/**
|
|
@@ -525,7 +526,7 @@ export class RemoteAudioStats {
|
|
|
525
526
|
*/
|
|
526
527
|
plcCount?: number;
|
|
527
528
|
/**
|
|
528
|
-
* The total active time (ms) between the start of the audio call and the callback of the remote user.The active time refers to the total duration of the remote user without the mute state.
|
|
529
|
+
* The total active time (ms) between the start of the audio call and the callback of the remote user. The active time refers to the total duration of the remote user without the mute state.
|
|
529
530
|
*/
|
|
530
531
|
totalActiveTime?: number;
|
|
531
532
|
/**
|
|
@@ -555,7 +556,7 @@ export class RemoteVideoStats {
|
|
|
555
556
|
*/
|
|
556
557
|
uid?: number;
|
|
557
558
|
/**
|
|
558
|
-
* Deprecated:In scenarios where audio and video are synchronized, you can get the video delay data from networkTransportDelay and jitterBufferDelay in RemoteAudioStats.The video delay (ms).
|
|
559
|
+
* Deprecated: In scenarios where audio and video are synchronized, you can get the video delay data from networkTransportDelay and jitterBufferDelay in RemoteAudioStats. The video delay (ms).
|
|
559
560
|
*/
|
|
560
561
|
delay?: number;
|
|
561
562
|
/**
|
|
@@ -603,11 +604,11 @@ export class RemoteVideoStats {
|
|
|
603
604
|
*/
|
|
604
605
|
frozenRate?: number;
|
|
605
606
|
/**
|
|
606
|
-
* The amount of time (ms) that the audio is ahead of the video.If this value is negative, the audio is lagging behind the video.
|
|
607
|
+
* The amount of time (ms) that the audio is ahead of the video. If this value is negative, the audio is lagging behind the video.
|
|
607
608
|
*/
|
|
608
609
|
avSyncTimeMs?: number;
|
|
609
610
|
/**
|
|
610
|
-
* The total active time (ms) of the video.As long as the remote user or host neither stops sending the video stream nor disables the video module after joining the channel, the video is available.
|
|
611
|
+
* The total active time (ms) of the video. As long as the remote user or host neither stops sending the video stream nor disables the video module after joining the channel, the video is available.
|
|
611
612
|
*/
|
|
612
613
|
totalActiveTime?: number;
|
|
613
614
|
/**
|
|
@@ -849,7 +850,7 @@ export class CameraCapturerConfiguration {
|
|
|
849
850
|
*/
|
|
850
851
|
cameraDirection?: CameraDirection;
|
|
851
852
|
/**
|
|
852
|
-
* This method applies to Windows only.The ID of the camera. The maximum length is MaxDeviceIdLengthType.
|
|
853
|
+
* This method applies to Windows only. The ID of the camera. The maximum length is MaxDeviceIdLengthType.
|
|
853
854
|
*/
|
|
854
855
|
deviceId?: string;
|
|
855
856
|
/**
|
|
@@ -857,7 +858,7 @@ export class CameraCapturerConfiguration {
|
|
|
857
858
|
*/
|
|
858
859
|
format?: VideoFormat;
|
|
859
860
|
/**
|
|
860
|
-
* Whether to follow the video aspect ratio set in setVideoEncoderConfiguration:true: (Default) Follow the set video aspect ratio. The SDK crops the captured video according to the set video aspect ratio and synchronously changes the local preview screen and the video frame in onCaptureVideoFrame and onPreEncodeVideoFrame.false: Do not follow the system default audio playback device. The SDK does not change the aspect ratio of the captured video frame.
|
|
861
|
+
* Whether to follow the video aspect ratio set in setVideoEncoderConfiguration : true : (Default) Follow the set video aspect ratio. The SDK crops the captured video according to the set video aspect ratio and synchronously changes the local preview screen and the video frame in onCaptureVideoFrame and onPreEncodeVideoFrame. false : Do not follow the system default audio playback device. The SDK does not change the aspect ratio of the captured video frame.
|
|
861
862
|
*/
|
|
862
863
|
followEncodeDimensionRatio?: boolean;
|
|
863
864
|
}
|
|
@@ -867,19 +868,19 @@ export class CameraCapturerConfiguration {
|
|
|
867
868
|
*/
|
|
868
869
|
export class ScreenCaptureConfiguration {
|
|
869
870
|
/**
|
|
870
|
-
* Whether to capture the window on the screen:true: Capture the window.false: (Default) Capture the screen, not the window.
|
|
871
|
+
* Whether to capture the window on the screen: true : Capture the window. false : (Default) Capture the screen, not the window.
|
|
871
872
|
*/
|
|
872
873
|
isCaptureWindow?: boolean;
|
|
873
874
|
/**
|
|
874
|
-
* (macOS only) The display ID of the screen.This parameter takes effect only when you want to capture the screen on macOS.
|
|
875
|
+
* (macOS only) The display ID of the screen. This parameter takes effect only when you want to capture the screen on macOS.
|
|
875
876
|
*/
|
|
876
877
|
displayId?: number;
|
|
877
878
|
/**
|
|
878
|
-
* (Windows only) The relative position of the shared screen to the virtual screen.This parameter takes effect only when you want to capture the screen on Windows.
|
|
879
|
+
* (Windows only) The relative position of the shared screen to the virtual screen. This parameter takes effect only when you want to capture the screen on Windows.
|
|
879
880
|
*/
|
|
880
881
|
screenRect?: Rectangle;
|
|
881
882
|
/**
|
|
882
|
-
* Window ID.This parameter takes effect only when you want to capture the window.
|
|
883
|
+
* Window ID. This parameter takes effect only when you want to capture the window.
|
|
883
884
|
*/
|
|
884
885
|
windowId?: any;
|
|
885
886
|
/**
|
|
@@ -887,7 +888,7 @@ export class ScreenCaptureConfiguration {
|
|
|
887
888
|
*/
|
|
888
889
|
params?: ScreenCaptureParameters;
|
|
889
890
|
/**
|
|
890
|
-
* Rectangle. If you do not set this parameter, the SDK shares the whole screen. If the region you set exceeds the boundary of the screen, only the region within in the screen is shared. If you set width or height in Rectangle as 0, the whole screen is shared.
|
|
891
|
+
* The relative position of the shared region to the whole screen. See Rectangle. If you do not set this parameter, the SDK shares the whole screen. If the region you set exceeds the boundary of the screen, only the region within in the screen is shared. If you set width or height in Rectangle as 0, the whole screen is shared.
|
|
891
892
|
*/
|
|
892
893
|
regionRect?: Rectangle;
|
|
893
894
|
}
|
|
@@ -969,11 +970,11 @@ export class ScreenCaptureSourceInfo {
|
|
|
969
970
|
*/
|
|
970
971
|
sourceName?: string;
|
|
971
972
|
/**
|
|
972
|
-
* The image content of the thumbnail. See ThumbImageBuffer
|
|
973
|
+
* The image content of the thumbnail. See ThumbImageBuffer.
|
|
973
974
|
*/
|
|
974
975
|
thumbImage?: ThumbImageBuffer;
|
|
975
976
|
/**
|
|
976
|
-
* The image content of the icon. See ThumbImageBuffer
|
|
977
|
+
* The image content of the icon. See ThumbImageBuffer.
|
|
977
978
|
*/
|
|
978
979
|
iconImage?: ThumbImageBuffer;
|
|
979
980
|
/**
|
|
@@ -985,7 +986,7 @@ export class ScreenCaptureSourceInfo {
|
|
|
985
986
|
*/
|
|
986
987
|
sourceTitle?: string;
|
|
987
988
|
/**
|
|
988
|
-
* Determines whether the screen is the primary display:true: The screen is the primary display.false: The screen is not the primary display.
|
|
989
|
+
* Determines whether the screen is the primary display: true : The screen is the primary display. false : The screen is not the primary display.
|
|
989
990
|
*/
|
|
990
991
|
primaryMonitor?: boolean;
|
|
991
992
|
/**
|
|
@@ -997,7 +998,7 @@ export class ScreenCaptureSourceInfo {
|
|
|
997
998
|
*/
|
|
998
999
|
position?: Rectangle;
|
|
999
1000
|
/**
|
|
1000
|
-
* (For Windows only) Whether the window is minimized:true: The window is minimized.false: The window is not minimized.
|
|
1001
|
+
* (For Windows only) Whether the window is minimized: true : The window is minimized. false : The window is not minimized.
|
|
1001
1002
|
*/
|
|
1002
1003
|
minimizeWindow?: boolean;
|
|
1003
1004
|
/**
|
|
@@ -1037,91 +1038,91 @@ export class ImageTrackOptions {
|
|
|
1037
1038
|
/**
|
|
1038
1039
|
* The channel media options.
|
|
1039
1040
|
*
|
|
1040
|
-
* Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection
|
|
1041
|
+
* Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection. For example, publishMicrophoneTrack, publishCustomAudioTrack, and publishMediaPlayerAudioTrack can be set as true at the same time, but only one of publishCameraTrack, publishScreenTrack, publishCustomVideoTrack, or publishEncodedVideoTrack can be set as true. Agora recommends that you set member parameter values yourself according to your business scenario, otherwise the SDK will automatically assign values to member parameters.
|
|
1041
1042
|
*/
|
|
1042
1043
|
export class ChannelMediaOptions {
|
|
1043
1044
|
/**
|
|
1044
|
-
* Whether to publish the video captured by the camera:true: Publish the video captured by the camera.false: Do not publish the video captured by the camera.
|
|
1045
|
+
* Whether to publish the video captured by the camera: true : Publish the video captured by the camera. false : Do not publish the video captured by the camera.
|
|
1045
1046
|
*/
|
|
1046
1047
|
publishCameraTrack?: boolean;
|
|
1047
1048
|
/**
|
|
1048
|
-
* Whether to publish the video captured by the second camera:true: Publish the video captured by the second camera.false: Do not publish the video captured by the second camera.
|
|
1049
|
+
* Whether to publish the video captured by the second camera: true : Publish the video captured by the second camera. false : Do not publish the video captured by the second camera.
|
|
1049
1050
|
*/
|
|
1050
1051
|
publishSecondaryCameraTrack?: boolean;
|
|
1051
1052
|
/**
|
|
1052
|
-
*
|
|
1053
|
+
* Whether to publish the video captured by the third camera: true : Publish the video captured by the third camera. false : Do not publish the video captured by the third camera.
|
|
1053
1054
|
*/
|
|
1054
1055
|
publishThirdCameraTrack?: boolean;
|
|
1055
1056
|
/**
|
|
1056
|
-
*
|
|
1057
|
+
* Whether to publish the video captured by the fourth camera: true : Publish the video captured by the fourth camera. false : Do not publish the video captured by the fourth camera.
|
|
1057
1058
|
*/
|
|
1058
1059
|
publishFourthCameraTrack?: boolean;
|
|
1059
1060
|
/**
|
|
1060
|
-
* Whether to publish the audio captured by the microphone:true: Publish the audio captured by the microphone.false: Do not publish the audio captured by the microphone.
|
|
1061
|
+
* Whether to publish the audio captured by the microphone: true : Publish the audio captured by the microphone. false : Do not publish the audio captured by the microphone.
|
|
1061
1062
|
*/
|
|
1062
1063
|
publishMicrophoneTrack?: boolean;
|
|
1063
1064
|
/**
|
|
1064
|
-
*
|
|
1065
|
+
* @ignore
|
|
1065
1066
|
*/
|
|
1066
1067
|
publishScreenCaptureVideo?: boolean;
|
|
1067
1068
|
/**
|
|
1068
|
-
*
|
|
1069
|
+
* @ignore
|
|
1069
1070
|
*/
|
|
1070
1071
|
publishScreenCaptureAudio?: boolean;
|
|
1071
1072
|
/**
|
|
1072
|
-
* Whether to publish the video captured from the screen:true: Publish the video captured from the screen.false:
|
|
1073
|
+
* Whether to publish the video captured from the screen: true : Publish the video captured from the screen. false : Do not publish the video captured from the screen.
|
|
1073
1074
|
*/
|
|
1074
1075
|
publishScreenTrack?: boolean;
|
|
1075
1076
|
/**
|
|
1076
|
-
* Whether to publish the video captured from the second screen:true: Publish the video captured from the second screen.false: Do not publish the video captured from the second screen.
|
|
1077
|
+
* Whether to publish the video captured from the second screen: true : Publish the video captured from the second screen. false : Do not publish the video captured from the second screen.
|
|
1077
1078
|
*/
|
|
1078
1079
|
publishSecondaryScreenTrack?: boolean;
|
|
1079
1080
|
/**
|
|
1080
|
-
*
|
|
1081
|
+
* Whether to publish the video captured from the third screen: true : Publish the captured video from the third screen. false : Do not publish the video captured from the third screen.
|
|
1081
1082
|
*/
|
|
1082
1083
|
publishThirdScreenTrack?: boolean;
|
|
1083
1084
|
/**
|
|
1084
|
-
*
|
|
1085
|
+
* Whether to publish the video captured from the fourth screen: true : Publish the captured video from the fourth screen. false : Do not publish the video captured from the fourth screen.
|
|
1085
1086
|
*/
|
|
1086
1087
|
publishFourthScreenTrack?: boolean;
|
|
1087
1088
|
/**
|
|
1088
|
-
* Whether to publish the audio captured from a custom source:true: Publish the audio captured from the custom source.false: Do not publish the captured audio from a custom source.
|
|
1089
|
+
* Whether to publish the audio captured from a custom source: true : Publish the audio captured from the custom source. false : Do not publish the captured audio from a custom source.
|
|
1089
1090
|
*/
|
|
1090
1091
|
publishCustomAudioTrack?: boolean;
|
|
1091
1092
|
/**
|
|
1092
|
-
* The ID of the custom audio source to publish. The default value is 0.If you have set sourceNumber in setExternalAudioSource to a value greater than 1, the SDK creates the corresponding number of custom audio tracks and assigns an ID to each audio track, starting from 0.
|
|
1093
|
+
* The ID of the custom audio source to publish. The default value is 0. If you have set sourceNumber in setExternalAudioSource to a value greater than 1, the SDK creates the corresponding number of custom audio tracks and assigns an ID to each audio track, starting from 0.
|
|
1093
1094
|
*/
|
|
1094
1095
|
publishCustomAudioTrackId?: number;
|
|
1095
1096
|
/**
|
|
1096
|
-
* Whether to publish the video captured from a custom source:true: Publish the video captured from the custom source.false: Do not publish the captured video from a custom source.
|
|
1097
|
+
* Whether to publish the video captured from a custom source: true : Publish the video captured from the custom source. false : Do not publish the captured video from a custom source.
|
|
1097
1098
|
*/
|
|
1098
1099
|
publishCustomVideoTrack?: boolean;
|
|
1099
1100
|
/**
|
|
1100
|
-
* Whether to publish the encoded video:true: Publish the encoded video.false: Do not publish the encoded video.
|
|
1101
|
+
* Whether to publish the encoded video: true : Publish the encoded video. false : Do not publish the encoded video.
|
|
1101
1102
|
*/
|
|
1102
1103
|
publishEncodedVideoTrack?: boolean;
|
|
1103
1104
|
/**
|
|
1104
|
-
* Whether to publish the audio from the media player:true: Publish the audio from the media player.false: Do not publish the audio from the media player.
|
|
1105
|
+
* Whether to publish the audio from the media player: true : Publish the audio from the media player. false : Do not publish the audio from the media player.
|
|
1105
1106
|
*/
|
|
1106
1107
|
publishMediaPlayerAudioTrack?: boolean;
|
|
1107
1108
|
/**
|
|
1108
|
-
* Whether to publish the video from the media player:true: Publish the video from the media player.false: Do not publish the video from the media player.
|
|
1109
|
+
* Whether to publish the video from the media player: true : Publish the video from the media player. false : Do not publish the video from the media player.
|
|
1109
1110
|
*/
|
|
1110
1111
|
publishMediaPlayerVideoTrack?: boolean;
|
|
1111
1112
|
/**
|
|
1112
|
-
* Whether to publish the local transcoded video:true: Publish the local transcoded video.false: Do not publish the local transcoded video.
|
|
1113
|
+
* Whether to publish the local transcoded video: true : Publish the local transcoded video. false : Do not publish the local transcoded video.
|
|
1113
1114
|
*/
|
|
1114
1115
|
publishTranscodedVideoTrack?: boolean;
|
|
1115
1116
|
/**
|
|
1116
|
-
* Whether to automatically subscribe to all remote audio streams when the user joins a channel:true: Subscribe to all remote audio streams.false: Do not automatically subscribe to any remote audio streams.
|
|
1117
|
+
* Whether to automatically subscribe to all remote audio streams when the user joins a channel: true : Subscribe to all remote audio streams. false : Do not automatically subscribe to any remote audio streams.
|
|
1117
1118
|
*/
|
|
1118
1119
|
autoSubscribeAudio?: boolean;
|
|
1119
1120
|
/**
|
|
1120
|
-
* Whether to automatically subscribe to all remote video streams when the user joins the channel:true: Subscribe to all remote video streams.false: Do not automatically subscribe to any remote video streams.
|
|
1121
|
+
* Whether to automatically subscribe to all remote video streams when the user joins the channel: true : Subscribe to all remote video streams. false : Do not automatically subscribe to any remote video streams.
|
|
1121
1122
|
*/
|
|
1122
1123
|
autoSubscribeVideo?: boolean;
|
|
1123
1124
|
/**
|
|
1124
|
-
* Whether to enable audio capturing or playback:true:
|
|
1125
|
+
* Whether to enable audio capturing or playback: true : Enable audio capturing or playback. false : Do not enable audio capturing or playback. If you need to publish the audio streams captured by your microphone, ensure this parameter is set as true.
|
|
1125
1126
|
*/
|
|
1126
1127
|
enableAudioRecordingOrPlayout?: boolean;
|
|
1127
1128
|
/**
|
|
@@ -1153,7 +1154,9 @@ export class ChannelMediaOptions {
|
|
|
1153
1154
|
*/
|
|
1154
1155
|
mediaPlayerAudioDelayMs?: number;
|
|
1155
1156
|
/**
|
|
1156
|
-
* (Optional) The token generated on your server for authentication.
|
|
1157
|
+
* (Optional) The token generated on your server for authentication.
|
|
1158
|
+
* This parameter takes effect only when calling updateChannelMediaOptions or updateChannelMediaOptionsEx.
|
|
1159
|
+
* Ensure that the App ID, channel name, and user name used for creating the token are the same as those used by the initialize method for initializing the RTC engine, and those used by the joinChannel and joinChannelEx methods for joining the channel.
|
|
1157
1160
|
*/
|
|
1158
1161
|
token?: string;
|
|
1159
1162
|
/**
|
|
@@ -1161,11 +1164,13 @@ export class ChannelMediaOptions {
|
|
|
1161
1164
|
*/
|
|
1162
1165
|
enableBuiltInMediaEncryption?: boolean;
|
|
1163
1166
|
/**
|
|
1164
|
-
* Whether to publish the sound of a metronome to remote users:true: Publish processed audio frames. Both the local user and remote users can hear the metronome.false: Do not publish the sound of the metronome. Only the local user can hear the metronome.
|
|
1167
|
+
* Whether to publish the sound of a metronome to remote users: true : Publish processed audio frames. Both the local user and remote users can hear the metronome. false : Do not publish the sound of the metronome. Only the local user can hear the metronome.
|
|
1165
1168
|
*/
|
|
1166
1169
|
publishRhythmPlayerTrack?: boolean;
|
|
1167
1170
|
/**
|
|
1168
|
-
* Whether to enable interactive mode:true: Enable interactive mode. Once this mode is enabled and the user role is set as audience, the user can receive remote video streams with low latency.false:Do not enable interactive mode. If this mode is disabled, the user receives the remote video streams in default settings.
|
|
1171
|
+
* Whether to enable interactive mode: true : Enable interactive mode. Once this mode is enabled and the user role is set as audience, the user can receive remote video streams with low latency. false :Do not enable interactive mode. If this mode is disabled, the user receives the remote video streams in default settings.
|
|
1172
|
+
* This parameter only applies to scenarios involving cohosting across channels. The cohosts need to call the joinChannelEx method to join the other host's channel as an audience member, and set isInteractiveAudience to true.
|
|
1173
|
+
* This parameter takes effect only when the user role is ClientRoleAudience.
|
|
1169
1174
|
*/
|
|
1170
1175
|
isInteractiveAudience?: boolean;
|
|
1171
1176
|
/**
|
|
@@ -1173,7 +1178,7 @@ export class ChannelMediaOptions {
|
|
|
1173
1178
|
*/
|
|
1174
1179
|
customVideoTrackId?: number;
|
|
1175
1180
|
/**
|
|
1176
|
-
* Whether the audio stream being published is filtered according to the volume algorithm:true: The audio stream is filtered. If the audio stream filter is not enabled, this setting does not takes effect.false: The audio stream is not filtered.If you need to enable this function, contact
|
|
1181
|
+
* Whether the audio stream being published is filtered according to the volume algorithm: true : The audio stream is filtered. If the audio stream filter is not enabled, this setting does not takes effect. false : The audio stream is not filtered. If you need to enable this function, contact.
|
|
1177
1182
|
*/
|
|
1178
1183
|
isAudioFilterable?: boolean;
|
|
1179
1184
|
}
|
|
@@ -1217,21 +1222,21 @@ export enum ProxyType {
|
|
|
1217
1222
|
*/
|
|
1218
1223
|
export class LeaveChannelOptions {
|
|
1219
1224
|
/**
|
|
1220
|
-
* Whether to stop playing and mixing the music file when a user leaves the channel. true: (Default) Stop playing and mixing the music file.false: Do not stop playing and mixing the music file.
|
|
1225
|
+
* Whether to stop playing and mixing the music file when a user leaves the channel. true : (Default) Stop playing and mixing the music file. false : Do not stop playing and mixing the music file.
|
|
1221
1226
|
*/
|
|
1222
1227
|
stopAudioMixing?: boolean;
|
|
1223
1228
|
/**
|
|
1224
|
-
* Whether to stop playing all audio effects when a user leaves the channel. true: (Default) Stop playing all audio effects.false: Do not stop playing any audio effect.
|
|
1229
|
+
* Whether to stop playing all audio effects when a user leaves the channel. true : (Default) Stop playing all audio effects. false : Do not stop playing any audio effect.
|
|
1225
1230
|
*/
|
|
1226
1231
|
stopAllEffect?: boolean;
|
|
1227
1232
|
/**
|
|
1228
|
-
* Whether to stop microphone recording when a user leaves the channel. true: (Default) Stop microphone recording.false: Do not stop microphone recording.
|
|
1233
|
+
* Whether to stop microphone recording when a user leaves the channel. true : (Default) Stop microphone recording. false : Do not stop microphone recording.
|
|
1229
1234
|
*/
|
|
1230
1235
|
stopMicrophoneRecording?: boolean;
|
|
1231
1236
|
}
|
|
1232
1237
|
|
|
1233
1238
|
/**
|
|
1234
|
-
*
|
|
1239
|
+
* The SDK uses the IRtcEngineEventHandler interface to send event notifications to your app. Your app can get those notifications through methods that inherit this interface.
|
|
1235
1240
|
*/
|
|
1236
1241
|
export interface IRtcEngineEventHandler {
|
|
1237
1242
|
/**
|
|
@@ -1306,7 +1311,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1306
1311
|
/**
|
|
1307
1312
|
* Reports the last mile network probe result.
|
|
1308
1313
|
*
|
|
1309
|
-
* The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest
|
|
1314
|
+
* The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest.
|
|
1310
1315
|
*
|
|
1311
1316
|
* @param result The uplink and downlink last-mile network probe test result. See LastmileProbeResult.
|
|
1312
1317
|
*/
|
|
@@ -1315,12 +1320,15 @@ export interface IRtcEngineEventHandler {
|
|
|
1315
1320
|
/**
|
|
1316
1321
|
* Reports the volume information of users.
|
|
1317
1322
|
*
|
|
1318
|
-
* By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication
|
|
1323
|
+
* By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication. Once this callback is enabled and users send streams in the channel, the SDK triggers the onAudioVolumeIndication callback according to the time interval set in enableAudioVolumeIndication. The SDK triggers two independent onAudioVolumeIndication callbacks simultaneously, which separately report the volume information of the local user who sends a stream and the remote users (up to three) whose instantaneous volume is the highest. Once this callback is enabled, if the local user calls the muteLocalAudioStream method to mute, the SDK continues to report the volume indication of the local user. If a remote user whose volume is one of the three highest in the channel stops publishing the audio stream for 20 seconds, the callback excludes this user's information; if all remote users stop publishing audio streams for 20 seconds, the SDK stops triggering the callback for remote users.
|
|
1319
1324
|
*
|
|
1320
1325
|
* @param connection The connection information. See RtcConnection.
|
|
1321
1326
|
* @param speakers The volume information of the users. See AudioVolumeInfo. An empty speakers array in the callback indicates that no remote user is in the channel or is sending a stream.
|
|
1322
|
-
* @param speakerNumber The total number of users.
|
|
1323
|
-
*
|
|
1327
|
+
* @param speakerNumber The total number of users.
|
|
1328
|
+
* In the callback for the local user, if the local user is sending streams, the value of speakerNumber is 1.
|
|
1329
|
+
* In the callback for remote users, the value range of speakerNumber is [0,3]. If the number of remote users who send streams is greater than or equal to three, the value of speakerNumber is 3.
|
|
1330
|
+
* @param totalVolume The volume of the speaker. The value range is [0,255].
|
|
1331
|
+
* In the callback for the local user, totalVolume is the volume of the local user who sends a stream. In the callback for remote users, totalVolume is the sum of the volume of all remote users (up to three) whose instantaneous volume is the highest.
|
|
1324
1332
|
*/
|
|
1325
1333
|
onAudioVolumeIndication?(
|
|
1326
1334
|
connection: RtcConnection,
|
|
@@ -1332,7 +1340,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1332
1340
|
/**
|
|
1333
1341
|
* Occurs when a user leaves a channel.
|
|
1334
1342
|
*
|
|
1335
|
-
* This callback notifies the app that the user leaves the channel by calling leaveChannel
|
|
1343
|
+
* This callback notifies the app that the user leaves the channel by calling leaveChannel. From this callback, the app can get information such as the call duration and quality statistics.
|
|
1336
1344
|
*
|
|
1337
1345
|
* @param connection The connection information. See RtcConnection.
|
|
1338
1346
|
* @param stats The statistics of the call. See RtcStats.
|
|
@@ -1372,7 +1380,8 @@ export interface IRtcEngineEventHandler {
|
|
|
1372
1380
|
* @param position The playback progress (ms).
|
|
1373
1381
|
*
|
|
1374
1382
|
* @returns
|
|
1375
|
-
* 0: Success.
|
|
1383
|
+
* 0: Success.
|
|
1384
|
+
* < 0: Failure.
|
|
1376
1385
|
*/
|
|
1377
1386
|
onAudioMixingPositionChanged?(position: number): void;
|
|
1378
1387
|
|
|
@@ -1448,7 +1457,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1448
1457
|
*
|
|
1449
1458
|
* This callback reports the last-mile network conditions of the local user before the user joins the channel. Last mile refers to the connection between the local device and Agora's edge server. Before the user joins the channel, this callback is triggered by the SDK once startLastmileProbeTest is called and reports the last-mile network conditions of the local user.
|
|
1450
1459
|
*
|
|
1451
|
-
* @param quality The last-mile network quality. QualityUnknown(0): The quality is unknown.QualityExcellent(1): The quality is excellent.QualityGood(2): The network quality seems excellent, but the bitrate can be slightly lower than excellent.QualityPoor(3): Users can feel the communication is slightly impaired.QualityBad(4): Users cannot communicate smoothly.QualityVbad(5): The quality is so bad that users can barely communicate.QualityDown(6): The network is down, and users cannot communicate at all.See QualityType.
|
|
1460
|
+
* @param quality The last-mile network quality. QualityUnknown (0): The quality is unknown. QualityExcellent (1): The quality is excellent. QualityGood (2): The network quality seems excellent, but the bitrate can be slightly lower than excellent. QualityPoor (3): Users can feel the communication is slightly impaired. QualityBad (4): Users cannot communicate smoothly. QualityVbad (5): The quality is so bad that users can barely communicate. QualityDown (6): The network is down, and users cannot communicate at all. See QualityType.
|
|
1452
1461
|
*/
|
|
1453
1462
|
onLastmileQuality?(quality: QualityType): void;
|
|
1454
1463
|
|
|
@@ -1472,20 +1481,29 @@ export interface IRtcEngineEventHandler {
|
|
|
1472
1481
|
/**
|
|
1473
1482
|
* Occurs when the first video frame is published.
|
|
1474
1483
|
*
|
|
1475
|
-
* The SDK triggers this callback under one of the following circumstances:
|
|
1484
|
+
* The SDK triggers this callback under one of the following circumstances:
|
|
1485
|
+
* The local client enables the video module and calls joinChannel successfully.
|
|
1486
|
+
* The local client calls muteLocalVideoStream (true) and muteLocalVideoStream (false) in sequence.
|
|
1487
|
+
* The local client calls disableVideo and enableVideo in sequence.
|
|
1476
1488
|
*
|
|
1477
1489
|
* @param connection The connection information. See RtcConnection.
|
|
1478
1490
|
* @param elapsed Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.
|
|
1479
1491
|
*/
|
|
1480
1492
|
onFirstLocalVideoFramePublished?(
|
|
1481
|
-
|
|
1493
|
+
source: VideoSourceType,
|
|
1482
1494
|
elapsed: number
|
|
1483
1495
|
): void;
|
|
1484
1496
|
|
|
1485
1497
|
/**
|
|
1486
1498
|
* Occurs when the first remote video frame is received and decoded.
|
|
1487
1499
|
*
|
|
1488
|
-
* The SDK triggers this callback under one of the following circumstances:
|
|
1500
|
+
* The SDK triggers this callback under one of the following circumstances:
|
|
1501
|
+
* The remote user joins the channel and sends the video stream.
|
|
1502
|
+
* The remote user stops sending the video stream and re-sends it after 15 seconds. Reasons for such an interruption include:
|
|
1503
|
+
* The remote user leaves the channel.
|
|
1504
|
+
* The remote user drops offline.
|
|
1505
|
+
* The remote user calls muteLocalVideoStream to stop sending the video stream.
|
|
1506
|
+
* The remote user calls disableVideo to disable video.
|
|
1489
1507
|
*
|
|
1490
1508
|
* @param connection The connection information. See RtcConnection.
|
|
1491
1509
|
* @param remoteUid The user ID of the remote user sending the video stream.
|
|
@@ -1523,7 +1541,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1523
1541
|
/**
|
|
1524
1542
|
* Occurs when the local video stream state changes.
|
|
1525
1543
|
*
|
|
1526
|
-
* When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. The SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateFailed and error code of LocalVideoStreamErrorCaptureFailure in the following situations:
|
|
1544
|
+
* When the state of the local video stream changes (including the state of the video capture and encoding), the SDK triggers this callback to report the current state. This callback indicates the state of the local video stream, including camera capturing and video encoding, and allows you to troubleshoot issues when exceptions occur. The SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateFailed and error code of LocalVideoStreamErrorCaptureFailure in the following situations:
|
|
1545
|
+
* The app switches to the background, and the system gets the camera resource.
|
|
1546
|
+
* The camera starts normally, but does not output video frames for four consecutive seconds. When the camera outputs the captured video frames, if the video frames are the same for 15 consecutive frames, the SDK triggers the onLocalVideoStateChanged callback with the state code of LocalVideoStreamStateCapturing and error code of LocalVideoStreamErrorCaptureFailure. Note that the video frame duplication detection is only available for video frames with a resolution greater than 200 × 200, a frame rate greater than or equal to 10 fps, and a bitrate less than 20 Kbps. For some device models, the SDK does not trigger this callback when the state of the local video changes while the local video capturing device is in use, so you have to make your own timeout judgment.
|
|
1527
1547
|
*
|
|
1528
1548
|
* @param source The type of the video source. See VideoSourceType.
|
|
1529
1549
|
* @param state The state of the local video, see LocalVideoStreamState.
|
|
@@ -1572,9 +1592,13 @@ export interface IRtcEngineEventHandler {
|
|
|
1572
1592
|
): void;
|
|
1573
1593
|
|
|
1574
1594
|
/**
|
|
1575
|
-
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile)
|
|
1595
|
+
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) joins the channel.
|
|
1576
1596
|
*
|
|
1577
|
-
* In a communication channel, this callback indicates that a remote user joins the channel. The SDK also triggers this callback to report the existing users in the channel when a user joins the channel.
|
|
1597
|
+
* In a communication channel, this callback indicates that a remote user joins the channel. The SDK also triggers this callback to report the existing users in the channel when a user joins the channel.
|
|
1598
|
+
* In a live-broadcast channel, this callback indicates that a host joins the channel. The SDK also triggers this callback to report the existing hosts in the channel when a host joins the channel. Agora recommends limiting the number of hosts to 17. The SDK triggers this callback under one of the following circumstances:
|
|
1599
|
+
* A remote user/host joins the channel.
|
|
1600
|
+
* A remote user switches the user role to the host after joining the channel.
|
|
1601
|
+
* A remote user/host rejoins the channel after a network interruption.
|
|
1578
1602
|
*
|
|
1579
1603
|
* @param connection The connection information. See RtcConnection.
|
|
1580
1604
|
* @param remoteUid The ID of the user or host who joins the channel.
|
|
@@ -1589,7 +1613,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1589
1613
|
/**
|
|
1590
1614
|
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.
|
|
1591
1615
|
*
|
|
1592
|
-
* There are two reasons for users to become offline:
|
|
1616
|
+
* There are two reasons for users to become offline:
|
|
1617
|
+
* Leave the channel: When a user/host leaves the channel, the user/host sends a goodbye message. When this message is received, the SDK determines that the user/host leaves the channel.
|
|
1618
|
+
* Drop offline: When no data packet of the user or host is received for a certain period of time (20 seconds for the communication profile, and more for the live broadcast profile), the SDK assumes that the user/host drops offline. A poor network connection may lead to false detections. It's recommended to use the Agora RTM SDK for reliable offline detection.
|
|
1593
1619
|
*
|
|
1594
1620
|
* @param connection The connection information. See RtcConnection.
|
|
1595
1621
|
* @param remoteUid The ID of the user who leaves the channel or goes offline.
|
|
@@ -1608,7 +1634,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1608
1634
|
*
|
|
1609
1635
|
* @param connection The connection information. See RtcConnection.
|
|
1610
1636
|
* @param remoteUid The user ID.
|
|
1611
|
-
* @param muted Whether the remote user's audio stream is muted:true: User's audio stream is muted.false: User's audio stream is unmuted.
|
|
1637
|
+
* @param muted Whether the remote user's audio stream is muted: true : User's audio stream is muted. false : User's audio stream is unmuted.
|
|
1612
1638
|
*/
|
|
1613
1639
|
onUserMuteAudio?(
|
|
1614
1640
|
connection: RtcConnection,
|
|
@@ -1623,7 +1649,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1623
1649
|
*
|
|
1624
1650
|
* @param connection The connection information. See RtcConnection.
|
|
1625
1651
|
* @param remoteUid The user ID of the remote user.
|
|
1626
|
-
* @param muted Whether the remote user stops publishing the video stream:true: The remote user stops publishing the video stream.false: The remote user resumes publishing the video stream.
|
|
1652
|
+
* @param muted Whether the remote user stops publishing the video stream: true : The remote user stops publishing the video stream. false : The remote user resumes publishing the video stream.
|
|
1627
1653
|
*/
|
|
1628
1654
|
onUserMuteVideo?(
|
|
1629
1655
|
connection: RtcConnection,
|
|
@@ -1638,7 +1664,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1638
1664
|
*
|
|
1639
1665
|
* @param connection The connection information. See RtcConnection.
|
|
1640
1666
|
* @param remoteUid The user ID of the remote user.
|
|
1641
|
-
* @param enabled true: The video module is enabled.false: The video module is disabled.
|
|
1667
|
+
* @param enabled true : The video module is enabled. false : The video module is disabled.
|
|
1642
1668
|
*/
|
|
1643
1669
|
onUserEnableVideo?(
|
|
1644
1670
|
connection: RtcConnection,
|
|
@@ -1662,7 +1688,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1662
1688
|
*
|
|
1663
1689
|
* @param connection The connection information. See RtcConnection.
|
|
1664
1690
|
* @param remoteUid The user ID of the remote user.
|
|
1665
|
-
* @param enabled Whether the specified remote user enables/disables the local video capturing function:true: The video module is enabled. Other users in the channel can see the video of this remote user.false: The video module is disabled. Other users in the channel can no longer receive the video stream from this remote user, while this remote user can still receive the video streams from other users.
|
|
1691
|
+
* @param enabled Whether the specified remote user enables/disables the local video capturing function: true : The video module is enabled. Other users in the channel can see the video of this remote user. false : The video module is disabled. Other users in the channel can no longer receive the video stream from this remote user, while this remote user can still receive the video streams from other users.
|
|
1666
1692
|
*/
|
|
1667
1693
|
onUserEnableLocalVideo?(
|
|
1668
1694
|
connection: RtcConnection,
|
|
@@ -1698,7 +1724,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1698
1724
|
* @param connection The connection information. See RtcConnection.
|
|
1699
1725
|
* @param stats The statistics of the local video stream. See LocalVideoStats.
|
|
1700
1726
|
*/
|
|
1701
|
-
onLocalVideoStats?(
|
|
1727
|
+
onLocalVideoStats?(source: VideoSourceType, stats: LocalVideoStats): void;
|
|
1702
1728
|
|
|
1703
1729
|
/**
|
|
1704
1730
|
* Reports the statistics of the video stream sent by each remote users.
|
|
@@ -1788,7 +1814,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1788
1814
|
/**
|
|
1789
1815
|
* Occurs when the connection between the SDK and the server is interrupted.
|
|
1790
1816
|
*
|
|
1791
|
-
* Deprecated: Use onConnectionStateChanged instead. The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. You can use this callback to implement pop-up reminders. The differences between this callback and onConnectionLost are as follow:
|
|
1817
|
+
* Deprecated: Use onConnectionStateChanged instead. The SDK triggers this callback when it loses connection with the server for more than four seconds after the connection is established. After triggering this callback, the SDK tries to reconnect to the server. You can use this callback to implement pop-up reminders. The differences between this callback and onConnectionLost are as follow:
|
|
1818
|
+
* The SDK triggers the onConnectionInterrupted callback when it loses connection with the server for more than four seconds after it successfully joins the channel.
|
|
1819
|
+
* The SDK triggers the onConnectionLost callback when it loses connection with the server for more than 10 seconds, whether or not it joins the channel. If the SDK fails to rejoin the channel 20 minutes after being disconnected from Agora's edge server, the SDK stops rejoining the channel.
|
|
1792
1820
|
*
|
|
1793
1821
|
* @param connection The connection information. See RtcConnection.
|
|
1794
1822
|
*/
|
|
@@ -1848,7 +1876,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1848
1876
|
/**
|
|
1849
1877
|
* Occurs when the token expires.
|
|
1850
1878
|
*
|
|
1851
|
-
* When the token expires during a call, the SDK triggers this callback to remind the app to renew the token. When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways:
|
|
1879
|
+
* When the token expires during a call, the SDK triggers this callback to remind the app to renew the token. When receiving this callback, you need to generate a new token on your token server and you can renew your token through one of the following ways:
|
|
1880
|
+
* Call renewToken to pass in the new token.
|
|
1881
|
+
* Call leaveChannel to leave the current channel and then pass in the new token when you call joinChannel to join a channel.
|
|
1852
1882
|
*
|
|
1853
1883
|
* @param connection The connection information. See RtcConnection.
|
|
1854
1884
|
*/
|
|
@@ -1857,7 +1887,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1857
1887
|
/**
|
|
1858
1888
|
* Occurs when the token expires in 30 seconds.
|
|
1859
1889
|
*
|
|
1860
|
-
* When the token is about to expire in 30 seconds, the SDK triggers this callback to remind the app to renew the token. Upon receiving this callback, you need to generate a new token on your server, and call renewToken to pass the new token to the SDK.
|
|
1890
|
+
* When the token is about to expire in 30 seconds, the SDK triggers this callback to remind the app to renew the token. Upon receiving this callback, you need to generate a new token on your server, and call renewToken to pass the new token to the SDK. In scenarios involving multiple channels, you need to call updateChannelMediaOptionsEx to pass the new token to the SDK.
|
|
1861
1891
|
*
|
|
1862
1892
|
* @param connection The connection information. See RtcConnection.
|
|
1863
1893
|
* @param token The token that expires in 30 seconds.
|
|
@@ -1875,7 +1905,10 @@ export interface IRtcEngineEventHandler {
|
|
|
1875
1905
|
/**
|
|
1876
1906
|
* Occurs when the first audio frame is published.
|
|
1877
1907
|
*
|
|
1878
|
-
* The SDK triggers this callback under one of the following circumstances:
|
|
1908
|
+
* The SDK triggers this callback under one of the following circumstances:
|
|
1909
|
+
* The local client enables the audio module and calls joinChannel successfully.
|
|
1910
|
+
* The local client calls muteLocalAudioStream (true) and muteLocalAudioStream (false) in sequence.
|
|
1911
|
+
* The local client calls disableAudio and enableAudio in sequence.
|
|
1879
1912
|
*
|
|
1880
1913
|
* @param connection The connection information. See RtcConnection.
|
|
1881
1914
|
* @param elapsed Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.
|
|
@@ -1903,7 +1936,13 @@ export interface IRtcEngineEventHandler {
|
|
|
1903
1936
|
/**
|
|
1904
1937
|
* Occurs when the SDK decodes the first remote audio frame for playback.
|
|
1905
1938
|
*
|
|
1906
|
-
* Deprecated: Use onRemoteAudioStateChanged instead. The SDK triggers this callback under one of the following circumstances:
|
|
1939
|
+
* Deprecated: Use onRemoteAudioStateChanged instead. The SDK triggers this callback under one of the following circumstances:
|
|
1940
|
+
* The remote user joins the channel and sends the audio stream for the first time.
|
|
1941
|
+
* The remote user's audio is offline and then goes online to re-send audio. It means the local user cannot receive audio in 15 seconds. Reasons for such an interruption include:
|
|
1942
|
+
* The remote user leaves channel.
|
|
1943
|
+
* The remote user drops offline.
|
|
1944
|
+
* The remote user calls muteLocalAudioStream to stop sending the audio stream.
|
|
1945
|
+
* The remote user calls disableAudio to disable audio.
|
|
1907
1946
|
*
|
|
1908
1947
|
* @param connection The connection information. See RtcConnection.
|
|
1909
1948
|
* @param uid The user ID of the remote user.
|
|
@@ -1952,7 +1991,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1952
1991
|
/**
|
|
1953
1992
|
* Occurs when the most active remote speaker is detected.
|
|
1954
1993
|
*
|
|
1955
|
-
* After a successful call of enableAudioVolumeIndication
|
|
1994
|
+
* After a successful call of enableAudioVolumeIndication, the SDK continuously detects which remote user has the loudest volume. During the current period, the remote user whose volume is detected as the loudest for the most times, is the most active user. When the number of users is no less than two and an active remote speaker exists, the SDK triggers this callback and reports the uid of the most active remote speaker.
|
|
1995
|
+
* If the most active remote speaker is always the same user, the SDK triggers the onActiveSpeaker callback only once.
|
|
1996
|
+
* If the most active remote speaker changes to another user, the SDK triggers this callback again and reports the uid of the new active remote speaker.
|
|
1956
1997
|
*
|
|
1957
1998
|
* @param connection The connection information. See RtcConnection.
|
|
1958
1999
|
* @param uid The user ID of the most active speaker.
|
|
@@ -1974,7 +2015,12 @@ export interface IRtcEngineEventHandler {
|
|
|
1974
2015
|
* @param filePath The local path of the snapshot.
|
|
1975
2016
|
* @param width The width (px) of the snapshot.
|
|
1976
2017
|
* @param height The height (px) of the snapshot.
|
|
1977
|
-
* @param errCode The message that confirms success or gives the reason why the snapshot is not successfully taken:
|
|
2018
|
+
* @param errCode The message that confirms success or gives the reason why the snapshot is not successfully taken:
|
|
2019
|
+
* 0: Success.
|
|
2020
|
+
* < 0: Failure:
|
|
2021
|
+
* -1: The SDK fails to write data to a file or encode a JPEG image.
|
|
2022
|
+
* -2: The SDK does not find the video stream of the specified user within one second after the takeSnapshot method call succeeds. The possible reasons are: local capture stops, remote end stops publishing, or video data processing is blocked.
|
|
2023
|
+
* -3: Calling the takeSnapshot method too frequently.
|
|
1978
2024
|
*/
|
|
1979
2025
|
onSnapshotTaken?(
|
|
1980
2026
|
connection: RtcConnection,
|
|
@@ -2005,7 +2051,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2005
2051
|
/**
|
|
2006
2052
|
* Occurs when the user role switching fails in the interactive live streaming.
|
|
2007
2053
|
*
|
|
2008
|
-
* In the live broadcasting channel profile, when the local user calls to switch the user role after joining the channel but the switch fails, the SDK triggers this callback to report the reason for the failure and the current user role.
|
|
2054
|
+
* In the live broadcasting channel profile, when the local user calls setClientRole to switch the user role after joining the channel but the switch fails, the SDK triggers this callback to report the reason for the failure and the current user role.
|
|
2009
2055
|
*
|
|
2010
2056
|
* @param connection The connection information. See RtcConnection.
|
|
2011
2057
|
* @param reason The reason for a user role switch failure. See ClientRoleChangeFailedReason.
|
|
@@ -2024,7 +2070,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2024
2070
|
*
|
|
2025
2071
|
* @param deviceType The device type. See MediaDeviceType.
|
|
2026
2072
|
* @param volume The volume value. The range is [0, 255].
|
|
2027
|
-
* @param muted Whether the audio device is muted:true: The audio device is muted.false: The audio device is not muted.
|
|
2073
|
+
* @param muted Whether the audio device is muted: true : The audio device is muted. false : The audio device is not muted.
|
|
2028
2074
|
*/
|
|
2029
2075
|
onAudioDeviceVolumeChanged?(
|
|
2030
2076
|
deviceType: MediaDeviceType,
|
|
@@ -2067,7 +2113,14 @@ export interface IRtcEngineEventHandler {
|
|
|
2067
2113
|
*
|
|
2068
2114
|
* This callback applies to macOS only.
|
|
2069
2115
|
*
|
|
2070
|
-
* @param routing The current audio routing
|
|
2116
|
+
* @param routing The current audio routing.
|
|
2117
|
+
* -1: The default audio route.
|
|
2118
|
+
* 0: The audio route is a headset with a microphone.
|
|
2119
|
+
* 1: The audio route is an earpiece.
|
|
2120
|
+
* 2: The audio route is a headset without a microphone.
|
|
2121
|
+
* 3: The audio route is the speaker that comes with the device.
|
|
2122
|
+
* 4: The audio route is an external speaker. (For iOS and macOS only)
|
|
2123
|
+
* (5): The audio route is a Bluetooth headset.
|
|
2071
2124
|
*/
|
|
2072
2125
|
onAudioRoutingChanged?(routing: number): void;
|
|
2073
2126
|
|
|
@@ -2191,7 +2244,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2191
2244
|
/**
|
|
2192
2245
|
* Reports the built-in encryption errors.
|
|
2193
2246
|
*
|
|
2194
|
-
* When encryption is enabled by calling enableEncryption
|
|
2247
|
+
* When encryption is enabled by calling enableEncryption, the SDK triggers this callback if an error occurs in encryption or decryption on the sender or the receiver side.
|
|
2195
2248
|
*
|
|
2196
2249
|
* @param connection The connection information. See RtcConnection.
|
|
2197
2250
|
* @param errorType Details about the error type. See EncryptionErrorType.
|
|
@@ -2326,7 +2379,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2326
2379
|
/**
|
|
2327
2380
|
* Occurs when the extension is enabled.
|
|
2328
2381
|
*
|
|
2329
|
-
* After a successful call of enableExtension (
|
|
2382
|
+
* After a successful call of enableExtension (true), the extension triggers this callback.
|
|
2330
2383
|
*
|
|
2331
2384
|
* @param provider The name of the extension provider.
|
|
2332
2385
|
* @param extension The name of the extension.
|
|
@@ -2336,7 +2389,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2336
2389
|
/**
|
|
2337
2390
|
* Occurs when the extension is disabled.
|
|
2338
2391
|
*
|
|
2339
|
-
* After a successful call of enableExtension (
|
|
2392
|
+
* After a successful call of enableExtension (false), this callback is triggered.
|
|
2340
2393
|
*
|
|
2341
2394
|
* @param provider The name of the extension provider.
|
|
2342
2395
|
* @param extension The name of the extension.
|
|
@@ -2346,7 +2399,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2346
2399
|
/**
|
|
2347
2400
|
* Occurs when the extension runs incorrectly.
|
|
2348
2401
|
*
|
|
2349
|
-
* When calling enableExtension (
|
|
2402
|
+
* When calling enableExtension (true) fails or the extension runs in error, the extension triggers this callback and reports the error code and reason.
|
|
2350
2403
|
*
|
|
2351
2404
|
* @param provider The name of the extension provider.
|
|
2352
2405
|
* @param extension The name of the extension.
|
|
@@ -2372,7 +2425,7 @@ export interface IRtcEngineEventHandler {
|
|
|
2372
2425
|
/**
|
|
2373
2426
|
* Occurs when there's an error during the local video mixing.
|
|
2374
2427
|
*
|
|
2375
|
-
* When you fail to call startLocalVideoTranscoder or updateLocalTranscoderConfiguration
|
|
2428
|
+
* When you fail to call startLocalVideoTranscoder or updateLocalTranscoderConfiguration, the SDK triggers this callback to report the reason.
|
|
2376
2429
|
*
|
|
2377
2430
|
* @param stream The video streams that cannot be mixed during video mixing. See TranscodingVideoStream.
|
|
2378
2431
|
* @param error The reason for local video mixing error. See VideoTranscoderError.
|
|
@@ -2408,7 +2461,8 @@ export abstract class IVideoDeviceManager {
|
|
|
2408
2461
|
* Enumerates the video devices.
|
|
2409
2462
|
*
|
|
2410
2463
|
* @returns
|
|
2411
|
-
* Success: A VideoDeviceInfo array including all video devices in the system.
|
|
2464
|
+
* Success: A VideoDeviceInfo array including all video devices in the system.
|
|
2465
|
+
* Failure: An empty array.
|
|
2412
2466
|
*/
|
|
2413
2467
|
abstract enumerateVideoDevices(): VideoDeviceInfo[];
|
|
2414
2468
|
|
|
@@ -2417,10 +2471,11 @@ export abstract class IVideoDeviceManager {
|
|
|
2417
2471
|
*
|
|
2418
2472
|
* Plugging or unplugging a device does not change its device ID.
|
|
2419
2473
|
*
|
|
2420
|
-
* @param deviceIdUTF8 The device ID. You can get the device ID by calling enumerateVideoDevices.The maximum length is MaxDeviceIdLengthType.
|
|
2474
|
+
* @param deviceIdUTF8 The device ID. You can get the device ID by calling enumerateVideoDevices. The maximum length is MaxDeviceIdLengthType.
|
|
2421
2475
|
*
|
|
2422
2476
|
* @returns
|
|
2423
|
-
* 0: Success.
|
|
2477
|
+
* 0: Success.
|
|
2478
|
+
* < 0: Failure.
|
|
2424
2479
|
*/
|
|
2425
2480
|
abstract setDevice(deviceIdUTF8: string): number;
|
|
2426
2481
|
|
|
@@ -2440,7 +2495,8 @@ export abstract class IVideoDeviceManager {
|
|
|
2440
2495
|
* @param deviceIdUTF8 The ID of the video capture device.
|
|
2441
2496
|
*
|
|
2442
2497
|
* @returns
|
|
2443
|
-
* > 0: Success. Returns the number of video formats supported by this device. For example: If the specified camera supports 10 different video formats, the return value is 10.
|
|
2498
|
+
* > 0: Success. Returns the number of video formats supported by this device. For example: If the specified camera supports 10 different video formats, the return value is 10.
|
|
2499
|
+
* ≤ 0: Failure.
|
|
2444
2500
|
*/
|
|
2445
2501
|
abstract numberOfCapabilities(deviceIdUTF8: string): number;
|
|
2446
2502
|
|
|
@@ -2453,7 +2509,7 @@ export abstract class IVideoDeviceManager {
|
|
|
2453
2509
|
* @param deviceCapabilityNumber The index number of the video format. If the return value of numberOfCapabilities is i, the value range of this parameter is [0,i).
|
|
2454
2510
|
*
|
|
2455
2511
|
* @returns
|
|
2456
|
-
* The specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat
|
|
2512
|
+
* The specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat.
|
|
2457
2513
|
*/
|
|
2458
2514
|
abstract getCapability(
|
|
2459
2515
|
deviceIdUTF8: string,
|
|
@@ -2497,11 +2553,21 @@ export class RtcEngineContext {
|
|
|
2497
2553
|
*/
|
|
2498
2554
|
audioScenario?: AudioScenarioType;
|
|
2499
2555
|
/**
|
|
2500
|
-
* The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions.
|
|
2556
|
+
* The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions. The area codes support bitwise operation.
|
|
2501
2557
|
*/
|
|
2502
2558
|
areaCode?: number;
|
|
2503
2559
|
/**
|
|
2504
|
-
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
2560
|
+
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
2561
|
+
* The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
|
|
2562
|
+
* The default size for each SDK log file is 1,024 KB; the default size for each API call log file is 2,048 KB. These log files are encoded in UTF-8.
|
|
2563
|
+
* The SDK writes the latest logs in agorasdk.log or agoraapi.log.
|
|
2564
|
+
* When agorasdk.log is full, the SDK processes the log files in the following order:
|
|
2565
|
+
* Delete the agorasdk.4.log file (if any).
|
|
2566
|
+
* Rename agorasdk.3.log to agorasdk.4.log.
|
|
2567
|
+
* Rename agorasdk.2.log to agorasdk.3.log.
|
|
2568
|
+
* Rename agorasdk.1.log to agorasdk.2.log.
|
|
2569
|
+
* Create a new agorasdk.log file.
|
|
2570
|
+
* The overwrite rules for the agoraapi.log file are the same as for agorasdk.log. Sets the log file size. See LogConfig. By default, the SDK generates five SDK log files and five API call log files with the following rules:
|
|
2505
2571
|
*/
|
|
2506
2572
|
logConfig?: LogConfig;
|
|
2507
2573
|
/**
|
|
@@ -2513,11 +2579,11 @@ export class RtcEngineContext {
|
|
|
2513
2579
|
*/
|
|
2514
2580
|
useExternalEglContext?: boolean;
|
|
2515
2581
|
/**
|
|
2516
|
-
* Whether to enable domain name restriction:true: Enables the domain name restriction. This value is suitable for scenarios where IoT devices use IoT cards for network access. The SDK will only connect to servers in the domain name or IP whitelist that has been reported to the operator.false: (Default) Disables the domain name restriction. This value is suitable for most common scenarios.
|
|
2582
|
+
* Whether to enable domain name restriction: true : Enables the domain name restriction. This value is suitable for scenarios where IoT devices use IoT cards for network access. The SDK will only connect to servers in the domain name or IP whitelist that has been reported to the operator. false : (Default) Disables the domain name restriction. This value is suitable for most common scenarios.
|
|
2517
2583
|
*/
|
|
2518
2584
|
domainLimit?: boolean;
|
|
2519
2585
|
/**
|
|
2520
|
-
* Whether to automatically register the Agora extensions when initializing IRtcEngine:true: (Default) Automatically register the Agora extensions when initializing IRtcEngine.false: Do not register the Agora extensions when initializing IRtcEngine. You need to call enableExtension to register the Agora extensions.
|
|
2586
|
+
* Whether to automatically register the Agora extensions when initializing IRtcEngine : true : (Default) Automatically register the Agora extensions when initializing IRtcEngine. false : Do not register the Agora extensions when initializing IRtcEngine. You need to call enableExtension to register the Agora extensions.
|
|
2521
2587
|
*/
|
|
2522
2588
|
autoRegisterAgoraExtensions?: boolean;
|
|
2523
2589
|
}
|
|
@@ -2559,7 +2625,9 @@ export enum MaxMetadataSizeType {
|
|
|
2559
2625
|
*/
|
|
2560
2626
|
export class Metadata {
|
|
2561
2627
|
/**
|
|
2562
|
-
* The user ID.
|
|
2628
|
+
* The user ID.
|
|
2629
|
+
* For the recipient:the ID of the remote user who sent the Metadata.
|
|
2630
|
+
* Ignore it for sender.
|
|
2563
2631
|
*/
|
|
2564
2632
|
uid?: number;
|
|
2565
2633
|
/**
|
|
@@ -2704,19 +2772,19 @@ export interface IDirectCdnStreamingEventHandler {
|
|
|
2704
2772
|
*/
|
|
2705
2773
|
export class DirectCdnStreamingMediaOptions {
|
|
2706
2774
|
/**
|
|
2707
|
-
* Sets whether to publish the video captured by the camera:true: Publish the video captured by the camera.false: (Default) Do not publish the video captured by the camera.
|
|
2775
|
+
* Sets whether to publish the video captured by the camera: true : Publish the video captured by the camera. false : (Default) Do not publish the video captured by the camera.
|
|
2708
2776
|
*/
|
|
2709
2777
|
publishCameraTrack?: boolean;
|
|
2710
2778
|
/**
|
|
2711
|
-
* Sets whether to publish the audio captured by the microphone:true: Publish the audio captured by the microphone.false: (Default) Do not publish the audio captured by the microphone.
|
|
2779
|
+
* Sets whether to publish the audio captured by the microphone: true : Publish the audio captured by the microphone. false : (Default) Do not publish the audio captured by the microphone.
|
|
2712
2780
|
*/
|
|
2713
2781
|
publishMicrophoneTrack?: boolean;
|
|
2714
2782
|
/**
|
|
2715
|
-
* Sets whether to publish the captured audio from a custom source:true: Publish the captured audio from a custom source.false: (Default) Do not publish the captured audio from the custom source.
|
|
2783
|
+
* Sets whether to publish the captured audio from a custom source: true : Publish the captured audio from a custom source. false : (Default) Do not publish the captured audio from the custom source.
|
|
2716
2784
|
*/
|
|
2717
2785
|
publishCustomAudioTrack?: boolean;
|
|
2718
2786
|
/**
|
|
2719
|
-
* Sets whether to publish the captured video from a custom source:true: Publish the captured video from a custom source.false: (Default) Do not publish the captured video from the custom source.
|
|
2787
|
+
* Sets whether to publish the captured video from a custom source: true : Publish the captured video from a custom source. false : (Default) Do not publish the captured video from the custom source.
|
|
2720
2788
|
*/
|
|
2721
2789
|
publishCustomVideoTrack?: boolean;
|
|
2722
2790
|
/**
|
|
@@ -2764,21 +2832,31 @@ export abstract class IRtcEngine {
|
|
|
2764
2832
|
/**
|
|
2765
2833
|
* Releases the IRtcEngine instance.
|
|
2766
2834
|
*
|
|
2767
|
-
* This method releases all resources used by the Agora SDK. Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. After a successful method call, you can no longer use any method or callback in the SDK anymore. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new IRtcEngine instance.
|
|
2835
|
+
* This method releases all resources used by the Agora SDK. Use this method for apps in which users occasionally make voice or video calls. When users do not make calls, you can free up resources for other operations. After a successful method call, you can no longer use any method or callback in the SDK anymore. If you want to use the real-time communication functions again, you must call createAgoraRtcEngine and initialize to create a new IRtcEngine instance.
|
|
2836
|
+
* This method can be called synchronously. You need to wait for the resource of IRtcEngine to be released before performing other operations (for example, create a new IRtcEngine object). Therefore, Agora recommends calling this method in the child thread to avoid blocking the main thread.
|
|
2837
|
+
* Besides, Agora does not recommend you calling release in any callback of the SDK. Otherwise, the SDK cannot release the resources until the callbacks return results, which may result in a deadlock.
|
|
2768
2838
|
*
|
|
2769
|
-
* @param sync Whether the method is called synchronously:true: Synchronous call.
|
|
2839
|
+
* @param sync Whether the method is called synchronously: true : Synchronous call. false : Asynchronous call. Currently this method only supports synchronous calls. Do not set this parameter to this value.
|
|
2770
2840
|
*/
|
|
2771
2841
|
abstract release(sync?: boolean): void;
|
|
2772
2842
|
|
|
2773
2843
|
/**
|
|
2774
2844
|
* Creates and initializes IRtcEngine.
|
|
2775
2845
|
*
|
|
2776
|
-
* All called methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
|
|
2846
|
+
* All called methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
|
|
2847
|
+
* Before calling other APIs, you must call createAgoraRtcEngine and initialize to create and initialize the IRtcEngine object.
|
|
2848
|
+
* The SDK supports creating only one IRtcEngine instance for an app.
|
|
2777
2849
|
*
|
|
2778
2850
|
* @param context Configurations for the IRtcEngine instance. See RtcEngineContext.
|
|
2779
2851
|
*
|
|
2780
2852
|
* @returns
|
|
2781
|
-
* 0: Success.
|
|
2853
|
+
* 0: Success.
|
|
2854
|
+
* < 0: Failure.
|
|
2855
|
+
* -1: A general error occurs (no specified reason).
|
|
2856
|
+
* -2: The parameter is invalid.
|
|
2857
|
+
* -7: The SDK is not initialized.
|
|
2858
|
+
* -22: The resource request failed. The SDK fails to allocate resources because your app consumes too much system resource or the system resources are insufficient.
|
|
2859
|
+
* -101: The App ID is invalid.
|
|
2782
2860
|
*/
|
|
2783
2861
|
abstract initialize(context: RtcEngineContext): number;
|
|
2784
2862
|
|
|
@@ -2804,12 +2882,38 @@ export abstract class IRtcEngine {
|
|
|
2804
2882
|
* Queries the current device's supported video codec capabilities.
|
|
2805
2883
|
*
|
|
2806
2884
|
* @returns
|
|
2807
|
-
* If the call is successful, an object containing the following attributes is returned: codecInfo : The CodecCapInfo array, indicating the video codec capabillity of the device. size : The size of the CodecCapInfo array.
|
|
2885
|
+
* If the call is successful, an object containing the following attributes is returned: codecInfo : The CodecCapInfo array, indicating the video codec capabillity of the device. size : The size of the CodecCapInfo array.
|
|
2886
|
+
* If the call timeouts, please modify the call logic and do not invoke the method in the main thread.
|
|
2808
2887
|
*/
|
|
2809
2888
|
abstract queryCodecCapability(): { codecInfo: CodecCapInfo[]; size: number };
|
|
2810
2889
|
|
|
2811
2890
|
/**
|
|
2812
|
-
*
|
|
2891
|
+
* Preloads a channel with token, channelId, and uid.
|
|
2892
|
+
*
|
|
2893
|
+
* When audience members need to switch between different channels frequently, calling the method can help shortening the time of joining a channel, thus reducing the time it takes for audience members to hear and see the host. As it may take a while for the SDK to preload a channel, Agora recommends that you call this method as soon as possible after obtaining the channel name and user ID to join a channel.
|
|
2894
|
+
* When calling this method, ensure you set the user role as audience and do not set the audio scenario as AudioScenarioChorus, otherwise, this method does not take effect.
|
|
2895
|
+
* You also need to make sure that the channel name, user ID and token passed in for preloading are the same as the values passed in when joinning the channel, otherwise, this method does not take effect.
|
|
2896
|
+
* One IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect.
|
|
2897
|
+
* Failing to preload a channel does not mean that you can't join a channel, nor will it increase the time of joining a channel. If you join a preloaded channel, leave it and want to rejoin the same channel, you do not need to call this method unless the token for preloading the channel expires.
|
|
2898
|
+
*
|
|
2899
|
+
* @param token The token generated on your server for authentication. When the token for preloading channels expires, you can update the token based on the number of channels you preload.
|
|
2900
|
+
* When preloading one channel, calling this method to pass in the new token.
|
|
2901
|
+
* When preloading more than one channels:
|
|
2902
|
+
* If you use a wildcard token for all preloaded channels, call updatePreloadChannelToken to update the token.
|
|
2903
|
+
* If you use different tokens to preload different channels, call this method to pass in your user ID, channel name and the new token.
|
|
2904
|
+
* @param channelId The channel name that you want to preload. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
|
2905
|
+
* All lowercase English letters: a to z.
|
|
2906
|
+
* All uppercase English letters: A to Z.
|
|
2907
|
+
* All numeric characters: 0 to 9.
|
|
2908
|
+
* Space
|
|
2909
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2910
|
+
* @param uid The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2 32 -1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and returns it in the onJoinChannelSuccess callback. Your application must record and maintain the returned user ID, because the SDK does not do so.
|
|
2911
|
+
*
|
|
2912
|
+
* @returns
|
|
2913
|
+
* 0: Success.
|
|
2914
|
+
* < 0: Failure.
|
|
2915
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2916
|
+
* -102: The channel name is invalid. You need to pass in a valid channel name and join the channel again.
|
|
2813
2917
|
*/
|
|
2814
2918
|
abstract preloadChannel(
|
|
2815
2919
|
token: string,
|
|
@@ -2818,7 +2922,38 @@ export abstract class IRtcEngine {
|
|
|
2818
2922
|
): number;
|
|
2819
2923
|
|
|
2820
2924
|
/**
|
|
2821
|
-
*
|
|
2925
|
+
* Preloads a channel with token, channelId, and userAccount.
|
|
2926
|
+
*
|
|
2927
|
+
* When audience members need to switch between different channels frequently, calling the method can help shortening the time of joining a channel, thus reducing the time it takes for audience members to hear and see the host. As it may take a while for the SDK to preload a channel, Agora recommends that you call this method as soon as possible after obtaining the channel name and user ID to join a channel. If you join a preloaded channel, leave it and want to rejoin the same channel, you do not need to call this method unless the token for preloading the channel expires.
|
|
2928
|
+
* Failing to preload a channel does not mean that you can't join a channel, nor will it increase the time of joining a channel.
|
|
2929
|
+
* One IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect.
|
|
2930
|
+
* When calling this method, ensure you set the user role as audience and do not set the audio scenario as AudioScenarioChorus, otherwise, this method does not take effect.
|
|
2931
|
+
* You also need to make sure that the User Account, channel ID and token passed in for preloading are the same as the values passed in when joining the channel, otherwise, this method does not take effect.
|
|
2932
|
+
*
|
|
2933
|
+
* @param token The token generated on your server for authentication. When the token for preloading channels expires, you can update the token based on the number of channels you preload.
|
|
2934
|
+
* When preloading one channel, calling this method to pass in the new token.
|
|
2935
|
+
* When preloading more than one channels:
|
|
2936
|
+
* If you use a wildcard token for all preloaded channels, call updatePreloadChannelToken to update the token.
|
|
2937
|
+
* If you use different tokens to preload different channels, call this method to pass in your user ID, channel name and the new token.
|
|
2938
|
+
* @param channelId The channel name that you want to preload. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters (89 characters in total):
|
|
2939
|
+
* All lowercase English letters: a to z.
|
|
2940
|
+
* All uppercase English letters: A to Z.
|
|
2941
|
+
* All numeric characters: 0 to 9.
|
|
2942
|
+
* Space
|
|
2943
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2944
|
+
* @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are (89 in total):
|
|
2945
|
+
* The 26 lowercase English letters: a to z.
|
|
2946
|
+
* The 26 uppercase English letters: A to Z.
|
|
2947
|
+
* All numeric characters: 0 to 9.
|
|
2948
|
+
* Space
|
|
2949
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2950
|
+
*
|
|
2951
|
+
* @returns
|
|
2952
|
+
* 0: Success.
|
|
2953
|
+
* < 0: Failure.
|
|
2954
|
+
* -2: The parameter is invalid. For example, the User Account is empty. You need to pass in a valid parameter and join the channel again.
|
|
2955
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2956
|
+
* -102: The channel name is invalid. You need to pass in a valid channel name and join the channel again.
|
|
2822
2957
|
*/
|
|
2823
2958
|
abstract preloadChannelWithUserAccount(
|
|
2824
2959
|
token: string,
|
|
@@ -2827,22 +2962,49 @@ export abstract class IRtcEngine {
|
|
|
2827
2962
|
): number;
|
|
2828
2963
|
|
|
2829
2964
|
/**
|
|
2830
|
-
*
|
|
2965
|
+
* Updates the wildcard token for preloading channels.
|
|
2966
|
+
*
|
|
2967
|
+
* You need to maintain the life cycle of the wildcard token by yourself. When the token expires, you need to generate a new wildcard token and then call this method to pass in the new token.
|
|
2968
|
+
*
|
|
2969
|
+
* @param token The new token.
|
|
2970
|
+
*
|
|
2971
|
+
* @returns
|
|
2972
|
+
* 0: Success.
|
|
2973
|
+
* < 0: Failure.
|
|
2974
|
+
* -2: The parameter is invalid. For example, the token is invalid. You need to pass in a valid parameter and join the channel again.
|
|
2975
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2831
2976
|
*/
|
|
2832
2977
|
abstract updatePreloadChannelToken(token: string): number;
|
|
2833
2978
|
|
|
2834
2979
|
/**
|
|
2835
2980
|
* Joins a channel with media options.
|
|
2836
2981
|
*
|
|
2837
|
-
* This method enables users to join a channel. Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other. A successful call of this method triggers the following callbacks:
|
|
2982
|
+
* This method enables users to join a channel. Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other. A successful call of this method triggers the following callbacks:
|
|
2983
|
+
* The local client: The onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
2984
|
+
* The remote client: onUserJoined, if the user joining the channel is in the Communication profile or is a host in the Live-broadcasting profile. When the connection between the client and Agora's server is interrupted due to poor network conditions, the SDK tries reconnecting to the server. When the local client successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback on the local client.
|
|
2985
|
+
* This method allows users to join only one channel at a time.
|
|
2986
|
+
* Ensure that the app ID you use to generate the token is the same app ID that you pass in the initialize method; otherwise, you may fail to join the channel by token.
|
|
2838
2987
|
*
|
|
2839
2988
|
* @param token The token generated on your server for authentication.
|
|
2840
|
-
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
2841
|
-
*
|
|
2989
|
+
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
2990
|
+
* All lowercase English letters: a to z.
|
|
2991
|
+
* All uppercase English letters: A to Z.
|
|
2992
|
+
* All numeric characters: 0 to 9.
|
|
2993
|
+
* Space
|
|
2994
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2995
|
+
* @param uid The user ID. This parameter is used to identify the user in the channel for real-time audio and video interaction. You need to set and manage user IDs yourself, and ensure that each user ID in the same channel is unique. This parameter is a 32-bit unsigned integer. The value range is 1 to 2 32 -1. If the user ID is not assigned (or set to 0), the SDK assigns a random user ID and returns it in the onJoinChannelSuccess callback. Your application must record and maintain the returned user ID, because the SDK does not do so.
|
|
2842
2996
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
2843
2997
|
*
|
|
2844
2998
|
* @returns
|
|
2845
|
-
* 0: Success.
|
|
2999
|
+
* 0: Success.
|
|
3000
|
+
* < 0: Failure.
|
|
3001
|
+
* -2: The parameter is invalid. For example, the token is invalid, the uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.
|
|
3002
|
+
* -3: Failes to initialize the IRtcEngine object. You need to reinitialize the IRtcEngine object.
|
|
3003
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
3004
|
+
* -8: The internal state of the IRtcEngine object is wrong. The typical cause is that you call this method to join the channel without calling startEchoTest to stop the test after calling stopEchoTest to start a call loop test. You need to call stopEchoTest before calling this method.
|
|
3005
|
+
* -17: The request to join the channel is rejected. The typical cause is that the user is in the channel. Agora recommends that you use the onConnectionStateChanged callback to determine whether the user exists in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
|
|
3006
|
+
* -102: The channel name is invalid. You need to pass in a valid channelname in channelId to rejoin the channel.
|
|
3007
|
+
* -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel.
|
|
2846
3008
|
*/
|
|
2847
3009
|
abstract joinChannel(
|
|
2848
3010
|
token: string,
|
|
@@ -2857,56 +3019,80 @@ export abstract class IRtcEngine {
|
|
|
2857
3019
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
2858
3020
|
*
|
|
2859
3021
|
* @returns
|
|
2860
|
-
* 0: Success.
|
|
3022
|
+
* 0: Success.
|
|
3023
|
+
* < 0: Failure.
|
|
3024
|
+
* -2: The value of a member in the ChannelMediaOptions structure is invalid. For example, the token or the user ID is invalid. You need to fill in a valid parameter.
|
|
3025
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
3026
|
+
* -8: The internal state of the IRtcEngine object is wrong. The possible reason is that the user is not in the channel. Agora recommends that you use the onConnectionStateChanged callback to determine whether the user exists in the channel. If you receive the ConnectionStateDisconnected (1) or ConnectionStateFailed (5) state, the user is not in the channel. You need to call joinChannel to join a channel before calling this method.
|
|
2861
3027
|
*/
|
|
2862
3028
|
abstract updateChannelMediaOptions(options: ChannelMediaOptions): number;
|
|
2863
3029
|
|
|
2864
3030
|
/**
|
|
2865
3031
|
* Sets channel options and leaves the channel.
|
|
2866
3032
|
*
|
|
2867
|
-
* If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
|
|
3033
|
+
* If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
|
|
3034
|
+
* If you have called joinChannelEx to join multiple channels, calling this method will leave the channels when calling joinChannel and joinChannelEx at the same time. This method will release all resources related to the session, leave the channel, that is, hang up or exit the call. This method can be called whether or not a call is currently in progress. After joining the channel, you must call this method or to end the call, otherwise, the next call cannot be started. This method call is asynchronous. When this method returns, it does not necessarily mean that the user has left the channel. After actually leaving the channel, the local user triggers the onLeaveChannel callback; after the user in the communication scenario and the host in the live streaming scenario leave the channel, the remote user triggers the onUserOffline callback.
|
|
2868
3035
|
*
|
|
2869
3036
|
* @param options The options for leaving the channel. See LeaveChannelOptions.
|
|
2870
3037
|
*
|
|
2871
3038
|
* @returns
|
|
2872
|
-
* 0: Success.
|
|
3039
|
+
* 0: Success.
|
|
3040
|
+
* < 0: Failure.
|
|
2873
3041
|
*/
|
|
2874
3042
|
abstract leaveChannel(options?: LeaveChannelOptions): number;
|
|
2875
3043
|
|
|
2876
3044
|
/**
|
|
2877
3045
|
* Renews the token.
|
|
2878
3046
|
*
|
|
2879
|
-
* The SDK triggers the onTokenPrivilegeWillExpire callback.
|
|
3047
|
+
* The SDK triggers the onTokenPrivilegeWillExpire callback.
|
|
3048
|
+
* The onConnectionStateChanged callback reports ConnectionChangedTokenExpired (9).
|
|
2880
3049
|
*
|
|
2881
3050
|
* @param token The new token.
|
|
2882
3051
|
*
|
|
2883
3052
|
* @returns
|
|
2884
|
-
* 0: Success.
|
|
3053
|
+
* 0: Success.
|
|
3054
|
+
* < 0: Failure.
|
|
3055
|
+
* -2: The parameter is invalid. For example, the token is invalid. You need to fill in a valid parameter.
|
|
3056
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2885
3057
|
*/
|
|
2886
3058
|
abstract renewToken(token: string): number;
|
|
2887
3059
|
|
|
2888
3060
|
/**
|
|
2889
3061
|
* Sets the channel profile.
|
|
2890
3062
|
*
|
|
2891
|
-
* After initializing the SDK, the default channel profile is the live streaming profile. You can call this method to set the usage scenario of the channel. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for the interactive live video streaming.
|
|
3063
|
+
* After initializing the SDK, the default channel profile is the live streaming profile. You can call this method to set the usage scenario of the channel. For example, it prioritizes smoothness and low latency for a video call, and prioritizes video quality for the interactive live video streaming.
|
|
3064
|
+
* To ensure the quality of real-time communication, Agora recommends that all users in a channel use the same channel profile.
|
|
3065
|
+
* This method must be called and set before joinChannel, and cannot be set again after joining the channel.
|
|
3066
|
+
* The default video encoding bitrate are different in different channel profiles. See setVideoEncoderConfiguration.
|
|
2892
3067
|
*
|
|
2893
3068
|
* @param profile The channel profile. See ChannelProfileType.
|
|
2894
3069
|
*
|
|
2895
3070
|
* @returns
|
|
2896
|
-
* 0(ERR_OK): Success.
|
|
3071
|
+
* 0(ERR_OK): Success.
|
|
3072
|
+
* < 0: Failure.
|
|
3073
|
+
* -2: The parameter is invalid.
|
|
3074
|
+
* -7: The SDK is not initialized.
|
|
2897
3075
|
*/
|
|
2898
3076
|
abstract setChannelProfile(profile: ChannelProfileType): number;
|
|
2899
3077
|
|
|
2900
3078
|
/**
|
|
2901
3079
|
* Sets the user role and level in an interactive live streaming channel.
|
|
2902
3080
|
*
|
|
2903
|
-
* In the interactive live streaming profile, the SDK sets the user role as audience by default. You can call this method to set the user role as host. You can call this method either before or after joining a channel. If you call this method to set the user's role as the host before joining the channel and set the local video property through the setupLocalVideo method, the local video preview is automatically enabled when the user joins the channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following:
|
|
3081
|
+
* In the interactive live streaming profile, the SDK sets the user role as audience by default. You can call this method to set the user role as host. You can call this method either before or after joining a channel. If you call this method to set the user's role as the host before joining the channel and set the local video property through the setupLocalVideo method, the local video preview is automatically enabled when the user joins the channel. If you call this method to switch the user role after joining a channel, the SDK automatically does the following:
|
|
3082
|
+
* Calls muteLocalAudioStream and muteLocalVideoStream to change the publishing state.
|
|
3083
|
+
* Triggers onClientRoleChanged on the local client.
|
|
3084
|
+
* Triggers onUserJoined or onUserOffline on the remote client. This method applies to the interactive live streaming profile (the profile parameter of setChannelProfile is ChannelProfileLiveBroadcasting) only.
|
|
2904
3085
|
*
|
|
2905
3086
|
* @param role The user role in the interactive live streaming. See ClientRoleType.
|
|
2906
3087
|
* @param options The detailed options of a user, including the user level. See ClientRoleOptions.
|
|
2907
3088
|
*
|
|
2908
3089
|
* @returns
|
|
2909
|
-
* 0: Success.
|
|
3090
|
+
* 0: Success.
|
|
3091
|
+
* < 0: Failure.
|
|
3092
|
+
* -1: A general error occurs (no specified reason).
|
|
3093
|
+
* -2: The parameter is invalid.
|
|
3094
|
+
* -5: The request is rejected.
|
|
3095
|
+
* -7: The SDK is not initialized.
|
|
2910
3096
|
*/
|
|
2911
3097
|
abstract setClientRole(
|
|
2912
3098
|
role: ClientRoleType,
|
|
@@ -2916,12 +3102,16 @@ export abstract class IRtcEngine {
|
|
|
2916
3102
|
/**
|
|
2917
3103
|
* Starts an audio device loopback test.
|
|
2918
3104
|
*
|
|
2919
|
-
* To test whether the user's local sending and receiving streams are normal, you can call this method to perform an audio and video call loop test, which tests whether the audio and video devices and the user's upstream and downstream networks are working properly. After starting the test, the user needs to make a sound or face the camera. The audio or video is output after about two seconds. If the audio playback is normal, the audio device and the user's upstream and downstream networks are working properly; if the video playback is normal, the video device and the user's upstream and downstream networks are working properly.
|
|
3105
|
+
* To test whether the user's local sending and receiving streams are normal, you can call this method to perform an audio and video call loop test, which tests whether the audio and video devices and the user's upstream and downstream networks are working properly. After starting the test, the user needs to make a sound or face the camera. The audio or video is output after about two seconds. If the audio playback is normal, the audio device and the user's upstream and downstream networks are working properly; if the video playback is normal, the video device and the user's upstream and downstream networks are working properly.
|
|
3106
|
+
* You can call this method either before or after joining a channel. When calling in a channel, make sure that no audio or video stream is being published.
|
|
3107
|
+
* After calling this method, call stopEchoTest to end the test; otherwise, the user cannot perform the next audio and video call loop test and cannot join the channel.
|
|
3108
|
+
* In live streaming scenarios, this method only applies to hosts.
|
|
2920
3109
|
*
|
|
2921
3110
|
* @param config The configuration of the audio and video call loop test. See EchoTestConfiguration.
|
|
2922
3111
|
*
|
|
2923
3112
|
* @returns
|
|
2924
|
-
* 0: Success.
|
|
3113
|
+
* 0: Success.
|
|
3114
|
+
* < 0: Failure.
|
|
2925
3115
|
*/
|
|
2926
3116
|
abstract startEchoTest(config: EchoTestConfiguration): number;
|
|
2927
3117
|
|
|
@@ -2930,20 +3120,34 @@ export abstract class IRtcEngine {
|
|
|
2930
3120
|
*
|
|
2931
3121
|
* @returns
|
|
2932
3122
|
* 0: Success.
|
|
2933
|
-
* < 0: Failure.
|
|
3123
|
+
* < 0: Failure.
|
|
3124
|
+
* -5(ERR_REFUSED): Failed to stop the echo test. The echo test may not be running.
|
|
2934
3125
|
*/
|
|
2935
3126
|
abstract stopEchoTest(): number;
|
|
2936
3127
|
|
|
2937
3128
|
/**
|
|
2938
3129
|
* Enables or disables multi-camera capture.
|
|
2939
3130
|
*
|
|
2940
|
-
* In scenarios where there are existing cameras to capture video, Agora recommends that you use the following steps to capture and publish video with multiple cameras:
|
|
2941
|
-
*
|
|
2942
|
-
*
|
|
3131
|
+
* In scenarios where there are existing cameras to capture video, Agora recommends that you use the following steps to capture and publish video with multiple cameras:
|
|
3132
|
+
* Call this method to enable multi-channel camera capture.
|
|
3133
|
+
* Call startPreview to start the local video preview.
|
|
3134
|
+
* Call startCameraCapture, and set sourceType to start video capture with the second camera.
|
|
3135
|
+
* Call joinChannelEx, and set publishSecondaryCameraTrack to true to publish the video stream captured by the second camera in the channel. If you want to disable multi-channel camera capture, use the following steps:
|
|
3136
|
+
* Call stopCameraCapture.
|
|
3137
|
+
* Call this method with enabled set to false. You can call this method before and after startPreview to enable multi-camera capture:
|
|
3138
|
+
* If it is enabled before startPreview, the local video preview shows the image captured by the two cameras at the same time.
|
|
3139
|
+
* If it is enabled after startPreview, the SDK stops the current camera capture first, and then enables the primary camera and the second camera. The local video preview appears black for a short time, and then automatically returns to normal. When using this function, ensure that the system version is 13.0 or later. The minimum iOS device types that support multi-camera capture are as follows:
|
|
3140
|
+
* iPhone XR
|
|
3141
|
+
* iPhone XS
|
|
3142
|
+
* iPhone XS Max
|
|
3143
|
+
* iPad Pro 3rd generation and later
|
|
3144
|
+
*
|
|
3145
|
+
* @param enabled Whether to enable multi-camera video capture mode: true : Enable multi-camera capture mode; the SDK uses multiple cameras to capture video. false : Disable multi-camera capture mode; the SDK uses a single camera to capture video.
|
|
2943
3146
|
* @param config Capture configuration for the second camera. See CameraCapturerConfiguration.
|
|
2944
3147
|
*
|
|
2945
3148
|
* @returns
|
|
2946
|
-
* 0: Success.
|
|
3149
|
+
* 0: Success.
|
|
3150
|
+
* < 0: Failure.
|
|
2947
3151
|
*/
|
|
2948
3152
|
abstract enableMultiCamera(
|
|
2949
3153
|
enabled: boolean,
|
|
@@ -2953,32 +3157,45 @@ export abstract class IRtcEngine {
|
|
|
2953
3157
|
/**
|
|
2954
3158
|
* Enables the video module.
|
|
2955
3159
|
*
|
|
2956
|
-
* Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode; if called during a call, the audio call switches to a video call. Call disableVideo to disable the video mode. A successful call of this method triggers the onRemoteVideoStateChanged callback on the remote client.
|
|
3160
|
+
* Call this method either before joining a channel or during a call. If this method is called before joining a channel, the call starts in the video mode; if called during a call, the audio call switches to a video call. Call disableVideo to disable the video mode. A successful call of this method triggers the onRemoteVideoStateChanged callback on the remote client.
|
|
3161
|
+
* This method enables the internal engine and is valid after leaving the channel.
|
|
3162
|
+
* Calling this method will reset the entire engine, resulting in a slow response time. Instead of callling this method, you can independently control a specific video module based on your actual needs using the following methods: enableLocalVideo : Whether to enable the camera to create the local video stream. muteLocalVideoStream : Whether to publish the local video stream. muteRemoteVideoStream : Whether to subscribe to and play the remote video stream. muteAllRemoteVideoStreams : Whether to subscribe to and play all remote video streams.
|
|
3163
|
+
* A successful call of this method resets enableLocalVideo, muteRemoteVideoStream, and muteAllRemoteVideoStreams. Proceed it with caution.
|
|
2957
3164
|
*
|
|
2958
3165
|
* @returns
|
|
2959
|
-
* 0: Success.
|
|
3166
|
+
* 0: Success.
|
|
3167
|
+
* < 0: Failure.
|
|
2960
3168
|
*/
|
|
2961
3169
|
abstract enableVideo(): number;
|
|
2962
3170
|
|
|
2963
3171
|
/**
|
|
2964
3172
|
* Disables the video module.
|
|
2965
3173
|
*
|
|
2966
|
-
* This method can be called before joining a channel or during a call to disable the video module. If it is called before joining a channel, an audio call starts when you join the channel; if called during a call, a video call switches to an audio call. Call enableVideo to enable the video module. A successful call of this method triggers the onUserEnableVideo (
|
|
3174
|
+
* This method can be called before joining a channel or during a call to disable the video module. If it is called before joining a channel, an audio call starts when you join the channel; if called during a call, a video call switches to an audio call. Call enableVideo to enable the video module. A successful call of this method triggers the onUserEnableVideo (false) callback on the remote client.
|
|
3175
|
+
* This method affects the internal engine and can be called after leaving the channel.
|
|
3176
|
+
* This method resets the internal engine and thus might takes some time to take effect. Agora recommends using the following APIs to control the video modules separately: enableLocalVideo : Whether to enable the camera to create the local video stream. muteLocalVideoStream : Whether to publish the local video stream. muteRemoteVideoStream : Whether to subscribe to and play the remote video stream. muteAllRemoteVideoStreams : Whether to subscribe to and play all remote video streams.
|
|
2967
3177
|
*
|
|
2968
3178
|
* @returns
|
|
2969
|
-
* 0: Success.
|
|
3179
|
+
* 0: Success.
|
|
3180
|
+
* < 0: Failure.
|
|
2970
3181
|
*/
|
|
2971
3182
|
abstract disableVideo(): number;
|
|
2972
3183
|
|
|
2973
3184
|
/**
|
|
2974
3185
|
* Enables the local video preview and specifies the video source for the preview.
|
|
2975
3186
|
*
|
|
2976
|
-
* You can call this method to enable local video preview.
|
|
3187
|
+
* You can call this method to enable local video preview. Call this method after the following:
|
|
3188
|
+
* Call setView to initialize the local preview.
|
|
3189
|
+
* Call enableVideo to enable the video module.
|
|
3190
|
+
* The local preview enables the mirror mode by default.
|
|
3191
|
+
* After the local video preview is enabled, if you call leaveChannel to exit the channel, the local preview remains until you call stopPreview to disable it.
|
|
3192
|
+
* The video source type set in this method needs to be consistent with the video source type of VideoCanvas you set in setupLocalVideo.
|
|
2977
3193
|
*
|
|
2978
3194
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
2979
3195
|
*
|
|
2980
3196
|
* @returns
|
|
2981
|
-
* 0: Success.
|
|
3197
|
+
* 0: Success.
|
|
3198
|
+
* < 0: Failure.
|
|
2982
3199
|
*/
|
|
2983
3200
|
abstract startPreview(sourceType?: VideoSourceType): number;
|
|
2984
3201
|
|
|
@@ -2990,19 +3207,25 @@ export abstract class IRtcEngine {
|
|
|
2990
3207
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
2991
3208
|
*
|
|
2992
3209
|
* @returns
|
|
2993
|
-
*
|
|
3210
|
+
* 0: Success.
|
|
3211
|
+
* < 0: Failure.
|
|
2994
3212
|
*/
|
|
2995
3213
|
abstract stopPreview(sourceType?: VideoSourceType): number;
|
|
2996
3214
|
|
|
2997
3215
|
/**
|
|
2998
3216
|
* Starts the last mile network probe test.
|
|
2999
3217
|
*
|
|
3000
|
-
* This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). Once this method is enabled, the SDK returns the following callbacks: onLastmileQuality : The SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience. onLastmileProbeResult : The SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. This method applies to the following scenarios:
|
|
3218
|
+
* This method starts the last-mile network probe test before joining a channel to get the uplink and downlink last mile network statistics, including the bandwidth, packet loss, jitter, and round-trip time (RTT). Once this method is enabled, the SDK returns the following callbacks: onLastmileQuality : The SDK triggers this callback within two seconds depending on the network conditions. This callback rates the network conditions and is more closely linked to the user experience. onLastmileProbeResult : The SDK triggers this callback within 30 seconds depending on the network conditions. This callback returns the real-time statistics of the network conditions and is more objective. This method applies to the following scenarios:
|
|
3219
|
+
* Before a user joins a channel, call this method to check the uplink network quality.
|
|
3220
|
+
* In a live streaming channel, call this method to check the uplink network quality before an audience member switches to a host.
|
|
3221
|
+
* Do not call other methods before receiving the onLastmileQuality and onLastmileProbeResult callbacks. Otherwise, the callbacks may be interrupted.
|
|
3222
|
+
* A host should not call this method after joining a channel (when in a call).
|
|
3001
3223
|
*
|
|
3002
3224
|
* @param config The configurations of the last-mile network probe test. See LastmileProbeConfig.
|
|
3003
3225
|
*
|
|
3004
3226
|
* @returns
|
|
3005
|
-
* 0: Success.
|
|
3227
|
+
* 0: Success.
|
|
3228
|
+
* < 0: Failure.
|
|
3006
3229
|
*/
|
|
3007
3230
|
abstract startLastmileProbeTest(config: LastmileProbeConfig): number;
|
|
3008
3231
|
|
|
@@ -3010,7 +3233,8 @@ export abstract class IRtcEngine {
|
|
|
3010
3233
|
* Stops the last mile network probe test.
|
|
3011
3234
|
*
|
|
3012
3235
|
* @returns
|
|
3013
|
-
* 0: Success.
|
|
3236
|
+
* 0: Success.
|
|
3237
|
+
* < 0: Failure.
|
|
3014
3238
|
*/
|
|
3015
3239
|
abstract stopLastmileProbeTest(): number;
|
|
3016
3240
|
|
|
@@ -3022,7 +3246,8 @@ export abstract class IRtcEngine {
|
|
|
3022
3246
|
* @param config Video profile. See VideoEncoderConfiguration.
|
|
3023
3247
|
*
|
|
3024
3248
|
* @returns
|
|
3025
|
-
* 0: Success.
|
|
3249
|
+
* 0: Success.
|
|
3250
|
+
* < 0: Failure.
|
|
3026
3251
|
*/
|
|
3027
3252
|
abstract setVideoEncoderConfiguration(
|
|
3028
3253
|
config: VideoEncoderConfiguration
|
|
@@ -3031,14 +3256,19 @@ export abstract class IRtcEngine {
|
|
|
3031
3256
|
/**
|
|
3032
3257
|
* Sets the image enhancement options.
|
|
3033
3258
|
*
|
|
3034
|
-
* Enables or disables image enhancement, and sets the options.
|
|
3259
|
+
* Enables or disables image enhancement, and sets the options.
|
|
3260
|
+
* Call this method before calling enableVideo or startPreview.
|
|
3261
|
+
* This method relies on the video enhancement dynamic library libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3035
3262
|
*
|
|
3036
|
-
* @param enabled Whether to enable the image enhancement function:true: Enable the image enhancement function.false: (Default) Disable the image enhancement function.
|
|
3263
|
+
* @param enabled Whether to enable the image enhancement function: true : Enable the image enhancement function. false : (Default) Disable the image enhancement function.
|
|
3037
3264
|
* @param options The image enhancement options. See BeautyOptions.
|
|
3038
|
-
* @param type
|
|
3265
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
3266
|
+
* The default value is UnknownMediaSource.
|
|
3267
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
3039
3268
|
*
|
|
3040
3269
|
* @returns
|
|
3041
|
-
* 0: Success.
|
|
3270
|
+
* 0: Success.
|
|
3271
|
+
* < 0: Failure.
|
|
3042
3272
|
*/
|
|
3043
3273
|
abstract setBeautyEffectOptions(
|
|
3044
3274
|
enabled: boolean,
|
|
@@ -3049,14 +3279,21 @@ export abstract class IRtcEngine {
|
|
|
3049
3279
|
/**
|
|
3050
3280
|
* Sets low-light enhancement.
|
|
3051
3281
|
*
|
|
3052
|
-
* The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video. You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
|
|
3282
|
+
* The low-light enhancement feature can adaptively adjust the brightness value of the video captured in situations with low or uneven lighting, such as backlit, cloudy, or dark scenes. It restores or highlights the image details and improves the overall visual effect of the video. You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
|
|
3283
|
+
* Call this method after calling enableVideo.
|
|
3284
|
+
* Dark light enhancement has certain requirements for equipment performance. The low-light enhancement feature has certain performance requirements on devices. If your device overheats after you enable low-light enhancement, Agora recommends modifying the low-light enhancement options to a less performance-consuming level or disabling low-light enhancement entirely.
|
|
3285
|
+
* Both this method and setExtensionProperty can turn on low-light enhancement:
|
|
3286
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
3287
|
+
* When you use an external video source to implement custom video capture, or send an external video source to the SDK, Agora recommends using setExtensionProperty.
|
|
3288
|
+
* This method relies on the video enhancement dynamic library libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3053
3289
|
*
|
|
3054
|
-
* @param enabled Whether to enable low-light enhancement function:true: Enable low-light enhancement function.false: (Default) Disable low-light enhancement function.
|
|
3290
|
+
* @param enabled Whether to enable low-light enhancement function: true : Enable low-light enhancement function. false : (Default) Disable low-light enhancement function.
|
|
3055
3291
|
* @param options The low-light enhancement options. See LowlightEnhanceOptions.
|
|
3056
3292
|
* @param type The type of the video source. See MediaSourceType.
|
|
3057
3293
|
*
|
|
3058
3294
|
* @returns
|
|
3059
|
-
* 0: Success.
|
|
3295
|
+
* 0: Success.
|
|
3296
|
+
* < 0: Failure.
|
|
3060
3297
|
*/
|
|
3061
3298
|
abstract setLowlightEnhanceOptions(
|
|
3062
3299
|
enabled: boolean,
|
|
@@ -3067,14 +3304,21 @@ export abstract class IRtcEngine {
|
|
|
3067
3304
|
/**
|
|
3068
3305
|
* Sets video noise reduction.
|
|
3069
3306
|
*
|
|
3070
|
-
* Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding. You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
|
|
3307
|
+
* Underlit environments and low-end video capture devices can cause video images to contain significant noise, which affects video quality. In real-time interactive scenarios, video noise also consumes bitstream resources and reduces encoding efficiency during encoding. You can call this method to enable the video noise reduction feature and set the options of the video noise reduction effect.
|
|
3308
|
+
* Call this method after calling enableVideo.
|
|
3309
|
+
* Video noise reduction has certain requirements for equipment performance. If your device overheats after you enable video noise reduction, Agora recommends modifying the video noise reduction options to a less performance-consuming level or disabling video noise reduction entirely.
|
|
3310
|
+
* Both this method and setExtensionProperty can turn on video noise reduction function:
|
|
3311
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
3312
|
+
* When you use an external video source to implement custom video capture, or send an external video source to the SDK, Agora recommends using setExtensionProperty.
|
|
3313
|
+
* This method relies on the video enhancement dynamic library libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3071
3314
|
*
|
|
3072
|
-
* @param enabled Whether to enable video noise reduction:true: Enable video noise reduction.false: (Default) Disable video noise reduction.
|
|
3315
|
+
* @param enabled Whether to enable video noise reduction: true : Enable video noise reduction. false : (Default) Disable video noise reduction.
|
|
3073
3316
|
* @param options The video noise reduction options. See VideoDenoiserOptions.
|
|
3074
3317
|
* @param type The type of the video source. See MediaSourceType.
|
|
3075
3318
|
*
|
|
3076
3319
|
* @returns
|
|
3077
|
-
* 0: Success.
|
|
3320
|
+
* 0: Success.
|
|
3321
|
+
* < 0: Failure.
|
|
3078
3322
|
*/
|
|
3079
3323
|
abstract setVideoDenoiserOptions(
|
|
3080
3324
|
enabled: boolean,
|
|
@@ -3085,14 +3329,21 @@ export abstract class IRtcEngine {
|
|
|
3085
3329
|
/**
|
|
3086
3330
|
* Sets color enhancement.
|
|
3087
3331
|
*
|
|
3088
|
-
* The video images captured by the camera can have color distortion. The color enhancement feature intelligently adjusts video characteristics such as saturation and contrast to enhance the video color richness and color reproduction, making the video more vivid. You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
|
|
3332
|
+
* The video images captured by the camera can have color distortion. The color enhancement feature intelligently adjusts video characteristics such as saturation and contrast to enhance the video color richness and color reproduction, making the video more vivid. You can call this method to enable the color enhancement feature and set the options of the color enhancement effect.
|
|
3333
|
+
* Call this method after calling enableVideo.
|
|
3334
|
+
* The color enhancement feature has certain performance requirements on devices. With color enhancement turned on, Agora recommends that you change the color enhancement level to one that consumes less performance or turn off color enhancement if your device is experiencing severe heat problems.
|
|
3335
|
+
* Both this method and setExtensionProperty can enable color enhancement:
|
|
3336
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
3337
|
+
* When you use an external video source to implement custom video capture, or send an external video source to the SDK, Agora recommends using setExtensionProperty.
|
|
3338
|
+
* This method relies on the video enhancement dynamic library libagora_clear_vision_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3089
3339
|
*
|
|
3090
|
-
* @param enabled Whether to enable color enhancement:true Enable color enhancement.false: (Default) Disable color enhancement.
|
|
3340
|
+
* @param enabled Whether to enable color enhancement: true Enable color enhancement. false : (Default) Disable color enhancement.
|
|
3091
3341
|
* @param options The color enhancement options. See ColorEnhanceOptions.
|
|
3092
3342
|
* @param type The type of the video source. See MediaSourceType.
|
|
3093
3343
|
*
|
|
3094
3344
|
* @returns
|
|
3095
|
-
* 0: Success.
|
|
3345
|
+
* 0: Success.
|
|
3346
|
+
* < 0: Failure.
|
|
3096
3347
|
*/
|
|
3097
3348
|
abstract setColorEnhanceOptions(
|
|
3098
3349
|
enabled: boolean,
|
|
@@ -3103,15 +3354,27 @@ export abstract class IRtcEngine {
|
|
|
3103
3354
|
/**
|
|
3104
3355
|
* Enables/Disables the virtual background.
|
|
3105
3356
|
*
|
|
3106
|
-
* The virtual background feature enables the local user to replace their original background with a static image, dynamic video, blurred background, or portrait-background segmentation to achieve picture-in-picture effect. Once the virtual background feature is enabled, all users in the channel can see the custom background. Call this method before calling enableVideo or .
|
|
3357
|
+
* The virtual background feature enables the local user to replace their original background with a static image, dynamic video, blurred background, or portrait-background segmentation to achieve picture-in-picture effect. Once the virtual background feature is enabled, all users in the channel can see the custom background. Call this method before calling enableVideo or startPreview.
|
|
3358
|
+
* This feature requires high performance devices. Agora recommends that you implement it on devices equipped with the following chips:
|
|
3359
|
+
* Devices with an i5 CPU and better
|
|
3360
|
+
* Agora recommends that you use this feature in scenarios that meet the following conditions:
|
|
3361
|
+
* A high-definition camera device is used, and the environment is uniformly lit.
|
|
3362
|
+
* There are few objects in the captured video. Portraits are half-length and unobstructed. Ensure that the background is a solid color that is different from the color of the user's clothing.
|
|
3363
|
+
* This method relies on the virtual background dynamic library libagora_segmentation_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3107
3364
|
*
|
|
3108
|
-
* @param enabled Whether to enable virtual background:true: Enable virtual background.false: Disable virtual background.
|
|
3365
|
+
* @param enabled Whether to enable virtual background: true : Enable virtual background. false : Disable virtual background.
|
|
3109
3366
|
* @param backgroundSource The custom background. See VirtualBackgroundSource. To adapt the resolution of the custom background image to that of the video captured by the SDK, the SDK scales and crops the custom background image while ensuring that the content of the custom background image is not distorted.
|
|
3110
3367
|
* @param segproperty Processing properties for background images. See SegmentationProperty.
|
|
3111
|
-
* @param type The type of the video source. See MediaSourceType.In this method, this parameter supports only the following two settings:
|
|
3368
|
+
* @param type The type of the video source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
3369
|
+
* The default value is PrimaryCameraSource.
|
|
3370
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
3112
3371
|
*
|
|
3113
3372
|
* @returns
|
|
3114
|
-
* 0: Success.
|
|
3373
|
+
* 0: Success.
|
|
3374
|
+
* < 0: Failure.
|
|
3375
|
+
* -1: The custom background image does not exist. Check the value of source in VirtualBackgroundSource.
|
|
3376
|
+
* -2: The color format of the custom background image is invalid. Check the value of color in VirtualBackgroundSource.
|
|
3377
|
+
* -3: The device does not support virtual background.
|
|
3115
3378
|
*/
|
|
3116
3379
|
abstract enableVirtualBackground(
|
|
3117
3380
|
enabled: boolean,
|
|
@@ -3123,24 +3386,28 @@ export abstract class IRtcEngine {
|
|
|
3123
3386
|
/**
|
|
3124
3387
|
* Initializes the video view of a remote user.
|
|
3125
3388
|
*
|
|
3126
|
-
* This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view. You need to specify the ID of the remote user in this method. If the remote user ID is unknown to the application, set it after the app receives the onUserJoined callback. To unbind the remote user from the view, set the view parameter to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.
|
|
3389
|
+
* This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees. Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view. You need to specify the ID of the remote user in this method. If the remote user ID is unknown to the application, set it after the app receives the onUserJoined callback. To unbind the remote user from the view, set the view parameter to NULL. Once the remote user leaves the channel, the SDK unbinds the remote user.
|
|
3390
|
+
* If you use the Agora recording function, the recording client joins the channel as a placeholder client, triggering the onUserJoined callback. Do not bind the placeholder client to the app view because the placeholder client does not send any video streams. If your app does not recognize the placeholder client, bind the remote user to the view when the SDK triggers the onFirstRemoteVideoDecoded callback.
|
|
3127
3391
|
*
|
|
3128
3392
|
* @param canvas The remote video view and settings. See VideoCanvas.
|
|
3129
3393
|
*
|
|
3130
3394
|
* @returns
|
|
3131
|
-
* 0: Success.
|
|
3395
|
+
* 0: Success.
|
|
3396
|
+
* < 0: Failure.
|
|
3132
3397
|
*/
|
|
3133
3398
|
abstract setupRemoteVideo(canvas: VideoCanvas): number;
|
|
3134
3399
|
|
|
3135
3400
|
/**
|
|
3136
3401
|
* Initializes the local video view.
|
|
3137
3402
|
*
|
|
3138
|
-
* This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream. Call this method to bind the local video stream to a video view and to set the rendering and mirror modes of the video view. After initialization, call this method to set the local video and then join the channel. The local video still binds to the view after you leave the channel. To unbind the local video from the view, set the view parameter as NULL
|
|
3403
|
+
* This method initializes the video view of a local stream on the local device. It affects only the video view that the local user sees, not the published local video stream. Call this method to bind the local video stream to a video view (view) and to set the rendering and mirror modes of the video view. After initialization, call this method to set the local video and then join the channel. The local video still binds to the view after you leave the channel. To unbind the local video from the view, set the view parameter as NULL.
|
|
3404
|
+
* You can call this method either before or after joining a channel.
|
|
3139
3405
|
*
|
|
3140
3406
|
* @param canvas The local video view and settings. See VideoCanvas.
|
|
3141
3407
|
*
|
|
3142
3408
|
* @returns
|
|
3143
|
-
* 0: Success.
|
|
3409
|
+
* 0: Success.
|
|
3410
|
+
* < 0: Failure.
|
|
3144
3411
|
*/
|
|
3145
3412
|
abstract setupLocalVideo(canvas: VideoCanvas): number;
|
|
3146
3413
|
|
|
@@ -3149,43 +3416,65 @@ export abstract class IRtcEngine {
|
|
|
3149
3416
|
*
|
|
3150
3417
|
* After successfully calling this method, the SDK will automatically enable the best practice strategies and adjust key performance metrics based on the specified scenario, to optimize the video experience. Ensure that you call this method before joining a channel.
|
|
3151
3418
|
*
|
|
3152
|
-
* @param scenarioType The type of video application scenario. See VideoApplicationScenarioType.If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
|
|
3419
|
+
* @param scenarioType The type of video application scenario. See VideoApplicationScenarioType. If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
|
|
3420
|
+
* In meeting scenarios where low-quality video streams are required to have a high bitrate, the SDK automatically enables multiple technologies used to deal with network congestions, to enhance the performance of the low-quality streams and to ensure the smooth reception by subscribers.
|
|
3421
|
+
* The SDK monitors the number of subscribers to the high-quality video stream in real time and dynamically adjusts its configuration based on the number of subscribers.
|
|
3422
|
+
* If nobody subscribers to the high-quality stream, the SDK automatically reduces its bitrate and frame rate to save upstream bandwidth.
|
|
3423
|
+
* If someone subscribes to the high-quality stream, the SDK resets the high-quality stream to the VideoEncoderConfiguration configuration used in the most recent calling of setVideoEncoderConfiguration. If no configuration has been set by the user previously, the following values are used:
|
|
3424
|
+
* Resolution: 1280 × 720
|
|
3425
|
+
* Frame rate: 15 fps
|
|
3426
|
+
* Bitrate: 1600 Kbps
|
|
3427
|
+
* The SDK monitors the number of subscribers to the low-quality video stream in real time and dynamically enables or disables it based on the number of subscribers. If the user has called setDualStreamMode to set that never send low-quality video stream (DisableSimulcastStream), the dynamic adjustment of the low-quality stream in meeting scenarios will not take effect.
|
|
3428
|
+
* If nobody subscribes to the low-quality stream, the SDK automatically disables it to save upstream bandwidth.
|
|
3429
|
+
* If someone subscribes to the low-quality stream, the SDK enables the low-quality stream and resets it to the SimulcastStreamConfig configuration used in the most recent calling of setDualStreamMode. If no configuration has been set by the user previously, the following values are used:
|
|
3430
|
+
* Resolution: 480 × 272
|
|
3431
|
+
* Frame rate: 15 fps
|
|
3432
|
+
* Bitrate: 500 Kbps
|
|
3153
3433
|
*
|
|
3154
3434
|
* @returns
|
|
3155
|
-
* 0: Success.
|
|
3435
|
+
* 0: Success.
|
|
3436
|
+
* < 0: Failure.
|
|
3156
3437
|
*/
|
|
3157
3438
|
abstract setVideoScenario(scenarioType: VideoApplicationScenarioType): number;
|
|
3158
3439
|
|
|
3159
3440
|
/**
|
|
3160
3441
|
* Enables the audio module.
|
|
3161
3442
|
*
|
|
3162
|
-
* The audio mode is enabled by default.
|
|
3443
|
+
* The audio mode is enabled by default.
|
|
3444
|
+
* This method enables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
3445
|
+
* Calling this method will reset the entire engine, resulting in a slow response time. Instead of callling this method, you can independently control a specific audio module based on your actual needs using the following methods: enableLocalAudio : Whether to enable the microphone to create the local audio stream. muteLocalAudioStream : Whether to publish the local audio stream. muteRemoteAudioStream : Whether to subscribe and play the remote audio stream. muteAllRemoteAudioStreams : Whether to subscribe to and play all remote audio streams.
|
|
3446
|
+
* A successful call of this method resets enableLocalAudio, muteRemoteAudioStream, and muteAllRemoteAudioStreams. Proceed it with caution.
|
|
3163
3447
|
*
|
|
3164
3448
|
* @returns
|
|
3165
|
-
* 0: Success.
|
|
3449
|
+
* 0: Success.
|
|
3450
|
+
* < 0: Failure.
|
|
3166
3451
|
*/
|
|
3167
3452
|
abstract enableAudio(): number;
|
|
3168
3453
|
|
|
3169
3454
|
/**
|
|
3170
3455
|
* Disables the audio module.
|
|
3171
3456
|
*
|
|
3172
|
-
* This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
3457
|
+
* This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
3458
|
+
* This method resets the internal engine and takes some time to take effect. Agora recommends using the following API methods to control the audio modules separately: enableLocalAudio : Whether to enable the microphone to create the local audio stream. muteLocalAudioStream : Whether to publish the local audio stream. muteRemoteAudioStream : Whether to subscribe and play the remote audio stream. muteAllRemoteAudioStreams : Whether to subscribe to and play all remote audio streams.
|
|
3173
3459
|
*
|
|
3174
3460
|
* @returns
|
|
3175
|
-
* 0: Success.
|
|
3461
|
+
* 0: Success.
|
|
3462
|
+
* < 0: Failure.
|
|
3176
3463
|
*/
|
|
3177
3464
|
abstract disableAudio(): number;
|
|
3178
3465
|
|
|
3179
3466
|
/**
|
|
3180
3467
|
* Sets the audio profile and audio scenario.
|
|
3181
3468
|
*
|
|
3182
|
-
* You can call this method either before or after joining a channel.
|
|
3469
|
+
* You can call this method either before or after joining a channel.
|
|
3470
|
+
* In scenarios requiring high-quality audio, such as online music tutoring, Agora recommends you set profile as AudioProfileMusicHighQuality (4) and scenario as AudioScenarioGameStreaming (3).
|
|
3183
3471
|
*
|
|
3184
3472
|
* @param profile The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AudioProfileType.
|
|
3185
3473
|
* @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
|
|
3186
3474
|
*
|
|
3187
3475
|
* @returns
|
|
3188
|
-
* 0: Success.
|
|
3476
|
+
* 0: Success.
|
|
3477
|
+
* < 0: Failure.
|
|
3189
3478
|
*/
|
|
3190
3479
|
abstract setAudioProfile(
|
|
3191
3480
|
profile: AudioProfileType,
|
|
@@ -3200,19 +3489,23 @@ export abstract class IRtcEngine {
|
|
|
3200
3489
|
* @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
|
|
3201
3490
|
*
|
|
3202
3491
|
* @returns
|
|
3203
|
-
* 0: Success.
|
|
3492
|
+
* 0: Success.
|
|
3493
|
+
* < 0: Failure.
|
|
3204
3494
|
*/
|
|
3205
3495
|
abstract setAudioScenario(scenario: AudioScenarioType): number;
|
|
3206
3496
|
|
|
3207
3497
|
/**
|
|
3208
3498
|
* Enables or disables the local audio capture.
|
|
3209
3499
|
*
|
|
3210
|
-
* The audio function is enabled by default when users joining a channel. This method disables or re-enables the local audio function to stop or restart local audio capturing. This method does not affect receiving or playing the remote audio streams, and enableLocalAudio (
|
|
3500
|
+
* The audio function is enabled by default when users joining a channel. This method disables or re-enables the local audio function to stop or restart local audio capturing. This method does not affect receiving or playing the remote audio streams, and enableLocalAudio (false) is applicable to scenarios where the user wants to receive remote audio streams without sending any audio stream to other users in the channel. Once the local audio function is disabled or re-enabled, the SDK triggers the onLocalAudioStateChanged callback, which reports LocalAudioStreamStateStopped (0) or LocalAudioStreamStateRecording (1).
|
|
3501
|
+
* The difference between this method and muteLocalAudioStream are as follow: enableLocalAudio : Disables or re-enables the local audio capturing and processing. If you disable or re-enable local audio capturing using the enableLocalAudio method, the local user might hear a pause in the remote audio playback. muteLocalAudioStream : Sends or stops sending the local audio streams.
|
|
3502
|
+
* You can call this method either before or after joining a channel. Calling it before joining a channel only sets the device state, and it takes effect immediately after you join the channel.
|
|
3211
3503
|
*
|
|
3212
|
-
* @param enabled true: (Default) Re-enable the local audio function, that is, to start the local audio capturing device (for example, the microphone).false: Disable the local audio function, that is, to stop local audio capturing.
|
|
3504
|
+
* @param enabled true : (Default) Re-enable the local audio function, that is, to start the local audio capturing device (for example, the microphone). false : Disable the local audio function, that is, to stop local audio capturing.
|
|
3213
3505
|
*
|
|
3214
3506
|
* @returns
|
|
3215
|
-
* 0: Success.
|
|
3507
|
+
* 0: Success.
|
|
3508
|
+
* < 0: Failure.
|
|
3216
3509
|
*/
|
|
3217
3510
|
abstract enableLocalAudio(enabled: boolean): number;
|
|
3218
3511
|
|
|
@@ -3221,22 +3514,26 @@ export abstract class IRtcEngine {
|
|
|
3221
3514
|
*
|
|
3222
3515
|
* This method does not affect any ongoing audio recording, because it does not disable the audio capture device. A successful call of this method triggers the onUserMuteAudio and onRemoteAudioStateChanged callbacks on the remote client.
|
|
3223
3516
|
*
|
|
3224
|
-
* @param mute Whether to stop publishing the local audio stream:true: Stops publishing the local audio stream.false: (Default) Resumes publishing the local audio stream.
|
|
3517
|
+
* @param mute Whether to stop publishing the local audio stream: true : Stops publishing the local audio stream. false : (Default) Resumes publishing the local audio stream.
|
|
3225
3518
|
*
|
|
3226
3519
|
* @returns
|
|
3227
|
-
* 0: Success.
|
|
3520
|
+
* 0: Success.
|
|
3521
|
+
* < 0: Failure.
|
|
3228
3522
|
*/
|
|
3229
3523
|
abstract muteLocalAudioStream(mute: boolean): number;
|
|
3230
3524
|
|
|
3231
3525
|
/**
|
|
3232
3526
|
* Stops or resumes subscribing to the audio streams of all remote users.
|
|
3233
3527
|
*
|
|
3234
|
-
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
3528
|
+
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
3529
|
+
* Call this method after joining a channel.
|
|
3530
|
+
* If you do not want to subscribe the audio streams of remote users before joining a channel, you can set autoSubscribeAudio as false when calling joinChannel.
|
|
3235
3531
|
*
|
|
3236
|
-
* @param mute Whether to stop subscribing to the audio streams of all remote users:true: Stops subscribing to the audio streams of all remote users.false: (Default) Subscribes to the audio streams of all remote users by default.
|
|
3532
|
+
* @param mute Whether to stop subscribing to the audio streams of all remote users: true : Stops subscribing to the audio streams of all remote users. false : (Default) Subscribes to the audio streams of all remote users by default.
|
|
3237
3533
|
*
|
|
3238
3534
|
* @returns
|
|
3239
|
-
* 0: Success.
|
|
3535
|
+
* 0: Success.
|
|
3536
|
+
* < 0: Failure.
|
|
3240
3537
|
*/
|
|
3241
3538
|
abstract muteAllRemoteAudioStreams(mute: boolean): number;
|
|
3242
3539
|
|
|
@@ -3251,46 +3548,56 @@ export abstract class IRtcEngine {
|
|
|
3251
3548
|
* Call this method after joining a channel.
|
|
3252
3549
|
*
|
|
3253
3550
|
* @param uid The user ID of the specified user.
|
|
3254
|
-
* @param mute Whether to subscribe to the specified remote user's audio stream.true: Stop subscribing to the audio stream of the specified user.false: (Default) Subscribe to the audio stream of the specified user.
|
|
3551
|
+
* @param mute Whether to subscribe to the specified remote user's audio stream. true : Stop subscribing to the audio stream of the specified user. false : (Default) Subscribe to the audio stream of the specified user.
|
|
3255
3552
|
*
|
|
3256
3553
|
* @returns
|
|
3257
|
-
* 0: Success.
|
|
3554
|
+
* 0: Success.
|
|
3555
|
+
* < 0: Failure.
|
|
3258
3556
|
*/
|
|
3259
3557
|
abstract muteRemoteAudioStream(uid: number, mute: boolean): number;
|
|
3260
3558
|
|
|
3261
3559
|
/**
|
|
3262
3560
|
* Stops or resumes publishing the local video stream.
|
|
3263
3561
|
*
|
|
3264
|
-
* A successful call of this method triggers the onUserMuteVideo callback on the remote client.
|
|
3562
|
+
* A successful call of this method triggers the onUserMuteVideo callback on the remote client.
|
|
3563
|
+
* This method executes faster than the enableLocalVideo (false) method, which controls the sending of the local video stream.
|
|
3564
|
+
* This method does not affect any ongoing video recording, because it does not disable the camera.
|
|
3265
3565
|
*
|
|
3266
|
-
* @param mute Whether to stop publishing the local video stream.true: Stop publishing the local video stream.false: (Default) Publish the local video stream.
|
|
3566
|
+
* @param mute Whether to stop publishing the local video stream. true : Stop publishing the local video stream. false : (Default) Publish the local video stream.
|
|
3267
3567
|
*
|
|
3268
3568
|
* @returns
|
|
3269
|
-
* 0: Success.
|
|
3569
|
+
* 0: Success.
|
|
3570
|
+
* < 0: Failure.
|
|
3270
3571
|
*/
|
|
3271
3572
|
abstract muteLocalVideoStream(mute: boolean): number;
|
|
3272
3573
|
|
|
3273
3574
|
/**
|
|
3274
3575
|
* Enables/Disables the local video capture.
|
|
3275
3576
|
*
|
|
3276
|
-
* This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo
|
|
3577
|
+
* This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo, the local video capture is enabled by default. You can call enableLocalVideo (false) to disable the local video capture. If you want to re-enable the local video capture, call enableLocalVideo (true). After the local video capturer is successfully disabled or re-enabled, the SDK triggers the onRemoteVideoStateChanged callback on the remote client.
|
|
3578
|
+
* You can call this method either before or after joining a channel.
|
|
3579
|
+
* This method enables the internal engine and is valid after leaving the channel.
|
|
3277
3580
|
*
|
|
3278
|
-
* @param enabled Whether to enable the local video capture.true: (Default) Enable the local video capture.false: Disable the local video capture. Once the local video is disabled, the remote users cannot receive the video stream of the local user, while the local user can still receive the video streams of remote users. When set to false, this method does not require a local camera.
|
|
3581
|
+
* @param enabled Whether to enable the local video capture. true : (Default) Enable the local video capture. false : Disable the local video capture. Once the local video is disabled, the remote users cannot receive the video stream of the local user, while the local user can still receive the video streams of remote users. When set to false, this method does not require a local camera.
|
|
3279
3582
|
*
|
|
3280
3583
|
* @returns
|
|
3281
|
-
* 0: Success.
|
|
3584
|
+
* 0: Success.
|
|
3585
|
+
* < 0: Failure.
|
|
3282
3586
|
*/
|
|
3283
3587
|
abstract enableLocalVideo(enabled: boolean): number;
|
|
3284
3588
|
|
|
3285
3589
|
/**
|
|
3286
3590
|
* Stops or resumes subscribing to the video streams of all remote users.
|
|
3287
3591
|
*
|
|
3288
|
-
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
3592
|
+
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
3593
|
+
* Call this method after joining a channel.
|
|
3594
|
+
* If you do not want to subscribe the video streams of remote users before joining a channel, you can call joinChannel and set autoSubscribeVideo as false.
|
|
3289
3595
|
*
|
|
3290
|
-
* @param mute Whether to stop subscribing to the video streams of all remote users.true: Stop subscribing to the video streams of all remote users.false: (Default) Subscribe to the audio streams of all remote users by default.
|
|
3596
|
+
* @param mute Whether to stop subscribing to the video streams of all remote users. true : Stop subscribing to the video streams of all remote users. false : (Default) Subscribe to the audio streams of all remote users by default.
|
|
3291
3597
|
*
|
|
3292
3598
|
* @returns
|
|
3293
|
-
* 0: Success.
|
|
3599
|
+
* 0: Success.
|
|
3600
|
+
* < 0: Failure.
|
|
3294
3601
|
*/
|
|
3295
3602
|
abstract muteAllRemoteVideoStreams(mute: boolean): number;
|
|
3296
3603
|
|
|
@@ -3305,23 +3612,25 @@ export abstract class IRtcEngine {
|
|
|
3305
3612
|
* Call this method after joining a channel.
|
|
3306
3613
|
*
|
|
3307
3614
|
* @param uid The user ID of the specified user.
|
|
3308
|
-
* @param mute Whether to subscribe to the specified remote user's video stream.true: Stop subscribing to the video streams of the specified user.false: (Default) Subscribe to the video stream of the specified user.
|
|
3615
|
+
* @param mute Whether to subscribe to the specified remote user's video stream. true : Stop subscribing to the video streams of the specified user. false : (Default) Subscribe to the video stream of the specified user.
|
|
3309
3616
|
*
|
|
3310
3617
|
* @returns
|
|
3311
|
-
* 0: Success.
|
|
3618
|
+
* 0: Success.
|
|
3619
|
+
* < 0: Failure.
|
|
3312
3620
|
*/
|
|
3313
3621
|
abstract muteRemoteVideoStream(uid: number, mute: boolean): number;
|
|
3314
3622
|
|
|
3315
3623
|
/**
|
|
3316
3624
|
* Sets the stream type of the remote video.
|
|
3317
3625
|
*
|
|
3318
|
-
* Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (
|
|
3626
|
+
* Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream. By default, the SDK enables the low-quality video stream auto mode on the sending end (it does not actively send the low-quality video stream). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling this method (the call to this method by the audience receiver does not take effect). After receiving the application, the sending end automatically switches to the low-quality video stream mode. You can call this method either before or after joining a channel. If you call both setRemoteVideoStreamType and setRemoteDefaultVideoStreamType, the setting of setRemoteVideoStreamType takes effect.
|
|
3319
3627
|
*
|
|
3320
3628
|
* @param uid The user ID.
|
|
3321
3629
|
* @param streamType The video stream type: VideoStreamType.
|
|
3322
3630
|
*
|
|
3323
3631
|
* @returns
|
|
3324
|
-
* 0: Success.
|
|
3632
|
+
* 0: Success.
|
|
3633
|
+
* < 0: Failure.
|
|
3325
3634
|
*/
|
|
3326
3635
|
abstract setRemoteVideoStreamType(
|
|
3327
3636
|
uid: number,
|
|
@@ -3331,13 +3640,21 @@ export abstract class IRtcEngine {
|
|
|
3331
3640
|
/**
|
|
3332
3641
|
* Options for subscribing to remote video streams.
|
|
3333
3642
|
*
|
|
3334
|
-
* When a remote user has enabled dual-stream mode, you can call this method to choose the option for subscribing to the video streams sent by the remote user.
|
|
3643
|
+
* When a remote user has enabled dual-stream mode, you can call this method to choose the option for subscribing to the video streams sent by the remote user.
|
|
3644
|
+
* If you only register one IVideoFrameObserver object, the SDK subscribes to the raw video data and encoded video data by default (the effect is equivalent to setting encodedFrameOnly to false).
|
|
3645
|
+
* If you only register one IVideoEncodedFrameObserver object, the SDK only subscribes to the encoded video data by default (the effect is equivalent to setting encodedFrameOnly to true).
|
|
3646
|
+
* If you register one IVideoFrameObserver object and one IVideoEncodedFrameObserver object successively, the SDK subscribes to the encoded video data by default (the effect is equivalent to setting encodedFrameOnly to false).
|
|
3647
|
+
* If you call this method first with the options parameter set, and then register one IVideoFrameObserver or IVideoEncodedFrameObserver object, you need to call this method again and set the options parameter as described in the above two items to get the desired results. Agora recommends the following steps:
|
|
3648
|
+
* Set autoSubscribeVideo to false when calling joinChannel to join a channel.
|
|
3649
|
+
* Call this method after receiving the onUserJoined callback to set the subscription options for the specified remote user's video stream.
|
|
3650
|
+
* Call the muteRemoteVideoStream method to resume subscribing to the video stream of the specified remote user. If you set encodedFrameOnly to true in the previous step, the SDK triggers the onEncodedVideoFrameReceived callback locally to report the received encoded video frame information.
|
|
3335
3651
|
*
|
|
3336
3652
|
* @param uid The user ID of the remote user.
|
|
3337
3653
|
* @param options The video subscription options. See VideoSubscriptionOptions.
|
|
3338
3654
|
*
|
|
3339
3655
|
* @returns
|
|
3340
|
-
* 0: Success.
|
|
3656
|
+
* 0: Success.
|
|
3657
|
+
* < 0: Failure.
|
|
3341
3658
|
*/
|
|
3342
3659
|
abstract setRemoteVideoSubscriptionOptions(
|
|
3343
3660
|
uid: number,
|
|
@@ -3347,25 +3664,33 @@ export abstract class IRtcEngine {
|
|
|
3347
3664
|
/**
|
|
3348
3665
|
* Sets the default stream type of subscrption for remote video streams.
|
|
3349
3666
|
*
|
|
3350
|
-
*
|
|
3667
|
+
* By default, the SDK enables the low-quality video stream auto mode on the sending end (it does not actively send the low-quality video stream). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling this method (the call to this method by the audience receiver does not take effect). After receiving the application, the sending end automatically switches to the low-quality video stream mode. Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream.
|
|
3668
|
+
* Call this method before joining a channel. The SDK does not support changing the default subscribed video stream type after joining a channel.
|
|
3669
|
+
* If you call both this method and setRemoteVideoStreamType, the SDK applies the settings in the setRemoteVideoStreamType method.
|
|
3351
3670
|
*
|
|
3352
3671
|
* @param streamType The default video-stream type. See VideoStreamType.
|
|
3353
3672
|
*
|
|
3354
3673
|
* @returns
|
|
3355
|
-
* 0: Success.
|
|
3674
|
+
* 0: Success.
|
|
3675
|
+
* < 0: Failure.
|
|
3356
3676
|
*/
|
|
3357
3677
|
abstract setRemoteDefaultVideoStreamType(streamType: VideoStreamType): number;
|
|
3358
3678
|
|
|
3359
3679
|
/**
|
|
3360
3680
|
* Set the blocklist of subscriptions for audio streams.
|
|
3361
3681
|
*
|
|
3362
|
-
* You can call this method to specify the audio streams of a user that you do not want to subscribe to.
|
|
3682
|
+
* You can call this method to specify the audio streams of a user that you do not want to subscribe to.
|
|
3683
|
+
* You can call this method either before or after joining a channel.
|
|
3684
|
+
* The blocklist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams, and autoSubscribeAudio in ChannelMediaOptions.
|
|
3685
|
+
* Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3686
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3363
3687
|
*
|
|
3364
|
-
* @param uidList The user ID list of users that you do not want to subscribe to.If you want to specify the audio streams of a user that you do not want to subscribe to, add the user ID in this list. If you want to remove a user from the blocklist, you need to call the setSubscribeAudioBlocklist method to update the user ID list; this means you only add the uid of users that you do not want to subscribe to in the new user ID list.
|
|
3688
|
+
* @param uidList The user ID list of users that you do not want to subscribe to. If you want to specify the audio streams of a user that you do not want to subscribe to, add the user ID in this list. If you want to remove a user from the blocklist, you need to call the setSubscribeAudioBlocklist method to update the user ID list; this means you only add the uid of users that you do not want to subscribe to in the new user ID list.
|
|
3365
3689
|
* @param uidNumber The number of users in the user ID list.
|
|
3366
3690
|
*
|
|
3367
3691
|
* @returns
|
|
3368
|
-
* 0: Success.
|
|
3692
|
+
* 0: Success.
|
|
3693
|
+
* < 0: Failure.
|
|
3369
3694
|
*/
|
|
3370
3695
|
abstract setSubscribeAudioBlocklist(
|
|
3371
3696
|
uidList: number[],
|
|
@@ -3375,13 +3700,18 @@ export abstract class IRtcEngine {
|
|
|
3375
3700
|
/**
|
|
3376
3701
|
* Sets the allowlist of subscriptions for audio streams.
|
|
3377
3702
|
*
|
|
3378
|
-
* You can call this method to specify the audio streams of a user that you want to subscribe to.
|
|
3703
|
+
* You can call this method to specify the audio streams of a user that you want to subscribe to.
|
|
3704
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3705
|
+
* You can call this method either before or after joining a channel.
|
|
3706
|
+
* The allowlist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3707
|
+
* Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3379
3708
|
*
|
|
3380
|
-
* @param uidList The user ID list of users that you want to subscribe to.If you want to specify the audio streams of a user for subscription, add the user ID in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeAudioAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
|
|
3709
|
+
* @param uidList The user ID list of users that you want to subscribe to. If you want to specify the audio streams of a user for subscription, add the user ID in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeAudioAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
|
|
3381
3710
|
* @param uidNumber The number of users in the user ID list.
|
|
3382
3711
|
*
|
|
3383
3712
|
* @returns
|
|
3384
|
-
* 0: Success.
|
|
3713
|
+
* 0: Success.
|
|
3714
|
+
* < 0: Failure.
|
|
3385
3715
|
*/
|
|
3386
3716
|
abstract setSubscribeAudioAllowlist(
|
|
3387
3717
|
uidList: number[],
|
|
@@ -3391,13 +3721,18 @@ export abstract class IRtcEngine {
|
|
|
3391
3721
|
/**
|
|
3392
3722
|
* Set the blocklist of subscriptions for video streams.
|
|
3393
3723
|
*
|
|
3394
|
-
* You can call this method to specify the video streams of a user that you do not want to subscribe to.
|
|
3724
|
+
* You can call this method to specify the video streams of a user that you do not want to subscribe to.
|
|
3725
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3726
|
+
* Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3727
|
+
* You can call this method either before or after joining a channel.
|
|
3728
|
+
* The blocklist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3395
3729
|
*
|
|
3396
|
-
* @param uidList The user ID list of users that you do not want to subscribe to.If you want to specify the video streams of a user that you do not want to subscribe to, add the user ID of that user in this list. If you want to remove a user from the blocklist, you need to call the setSubscribeVideoBlocklist method to update the user ID list; this means you only add the uid of users that you do not want to subscribe to in the new user ID list.
|
|
3730
|
+
* @param uidList The user ID list of users that you do not want to subscribe to. If you want to specify the video streams of a user that you do not want to subscribe to, add the user ID of that user in this list. If you want to remove a user from the blocklist, you need to call the setSubscribeVideoBlocklist method to update the user ID list; this means you only add the uid of users that you do not want to subscribe to in the new user ID list.
|
|
3397
3731
|
* @param uidNumber The number of users in the user ID list.
|
|
3398
3732
|
*
|
|
3399
3733
|
* @returns
|
|
3400
|
-
* 0: Success.
|
|
3734
|
+
* 0: Success.
|
|
3735
|
+
* < 0: Failure.
|
|
3401
3736
|
*/
|
|
3402
3737
|
abstract setSubscribeVideoBlocklist(
|
|
3403
3738
|
uidList: number[],
|
|
@@ -3407,13 +3742,18 @@ export abstract class IRtcEngine {
|
|
|
3407
3742
|
/**
|
|
3408
3743
|
* Set the allowlist of subscriptions for video streams.
|
|
3409
3744
|
*
|
|
3410
|
-
* You can call this method to specify the video streams of a user that you want to subscribe to.
|
|
3745
|
+
* You can call this method to specify the video streams of a user that you want to subscribe to.
|
|
3746
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3747
|
+
* Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3748
|
+
* You can call this method either before or after joining a channel.
|
|
3749
|
+
* The allowlist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3411
3750
|
*
|
|
3412
|
-
* @param uidList The user ID list of users that you want to subscribe to.If you want to specify the video streams of a user for subscription, add the user ID of that user in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeVideoAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
|
|
3751
|
+
* @param uidList The user ID list of users that you want to subscribe to. If you want to specify the video streams of a user for subscription, add the user ID of that user in this list. If you want to remove a user from the allowlist, you need to call the setSubscribeVideoAllowlist method to update the user ID list; this means you only add the uid of users that you want to subscribe to in the new user ID list.
|
|
3413
3752
|
* @param uidNumber The number of users in the user ID list.
|
|
3414
3753
|
*
|
|
3415
3754
|
* @returns
|
|
3416
|
-
* 0: Success.
|
|
3755
|
+
* 0: Success.
|
|
3756
|
+
* < 0: Failure.
|
|
3417
3757
|
*/
|
|
3418
3758
|
abstract setSubscribeVideoAllowlist(
|
|
3419
3759
|
uidList: number[],
|
|
@@ -3425,12 +3765,15 @@ export abstract class IRtcEngine {
|
|
|
3425
3765
|
*
|
|
3426
3766
|
* This method enables the SDK to regularly report the volume information to the app of the local user who sends a stream and remote users (three users at most) whose instantaneous volumes are the highest. Once you call this method and users send streams in the channel, the SDK triggers the onAudioVolumeIndication callback at the time interval set in this method. You can call this method either before or after joining a channel.
|
|
3427
3767
|
*
|
|
3428
|
-
* @param interval Sets the time interval between two consecutive volume indications
|
|
3768
|
+
* @param interval Sets the time interval between two consecutive volume indications:
|
|
3769
|
+
* ≤ 0: Disables the volume indication.
|
|
3770
|
+
* > 0: Time interval (ms) between two consecutive volume indications. The lowest value is 50.
|
|
3429
3771
|
* @param smooth The smoothing factor that sets the sensitivity of the audio volume indicator. The value ranges between 0 and 10. The recommended value is 3. The greater the value, the more sensitive the indicator.
|
|
3430
|
-
* @param reportVad true: Enables the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user.false: (Default) Disables the voice activity detection of the local user. Once it is disabled, the vad parameter of the onAudioVolumeIndication callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
|
|
3772
|
+
* @param reportVad true : Enables the voice activity detection of the local user. Once it is enabled, the vad parameter of the onAudioVolumeIndication callback reports the voice activity status of the local user. false : (Default) Disables the voice activity detection of the local user. Once it is disabled, the vad parameter of the onAudioVolumeIndication callback does not report the voice activity status of the local user, except for the scenario where the engine automatically detects the voice activity of the local user.
|
|
3431
3773
|
*
|
|
3432
3774
|
* @returns
|
|
3433
|
-
* 0: Success.
|
|
3775
|
+
* 0: Success.
|
|
3776
|
+
* < 0: Failure.
|
|
3434
3777
|
*/
|
|
3435
3778
|
abstract enableAudioVolumeIndication(
|
|
3436
3779
|
interval: number,
|
|
@@ -3441,19 +3784,23 @@ export abstract class IRtcEngine {
|
|
|
3441
3784
|
/**
|
|
3442
3785
|
* Starts audio recording on the client and sets recording configurations.
|
|
3443
3786
|
*
|
|
3444
|
-
* The Agora SDK allows recording during a call. After successfully calling this method, you can record the audio of users in the channel and get an audio recording file. Supported formats of the recording file are as follows:
|
|
3787
|
+
* The Agora SDK allows recording during a call. After successfully calling this method, you can record the audio of users in the channel and get an audio recording file. Supported formats of the recording file are as follows:
|
|
3788
|
+
* WAV: High-fidelity files with typically larger file sizes. For example, if the sample rate is 32,000 Hz, the file size for 10-minute recording is approximately 73 MB.
|
|
3789
|
+
* AAC: Low-fidelity files with typically smaller file sizes. For example, if the sample rate is 32,000 Hz and the recording quality is AudioRecordingQualityMedium, the file size for 10-minute recording is approximately 2 MB. Once the user leaves the channel, the recording automatically stops. Call this method after joining a channel.
|
|
3445
3790
|
*
|
|
3446
3791
|
* @param config Recording configurations. See AudioRecordingConfiguration.
|
|
3447
3792
|
*
|
|
3448
3793
|
* @returns
|
|
3449
|
-
* 0: Success.
|
|
3794
|
+
* 0: Success.
|
|
3795
|
+
* < 0: Failure.
|
|
3450
3796
|
*/
|
|
3451
3797
|
abstract startAudioRecording(config: AudioRecordingConfiguration): number;
|
|
3452
3798
|
|
|
3453
3799
|
/**
|
|
3454
3800
|
* Registers an encoded audio observer.
|
|
3455
3801
|
*
|
|
3456
|
-
* Call this method after joining a channel.
|
|
3802
|
+
* Call this method after joining a channel.
|
|
3803
|
+
* You can call this method or startAudioRecording to set the recording type and quality of audio files, but Agora does not recommend using this method and startAudioRecording at the same time. Only the method called later will take effect.
|
|
3457
3804
|
*
|
|
3458
3805
|
* @returns
|
|
3459
3806
|
* One IAudioEncodedFrameObserver object.
|
|
@@ -3467,7 +3814,8 @@ export abstract class IRtcEngine {
|
|
|
3467
3814
|
* Stops the audio recording on the client.
|
|
3468
3815
|
*
|
|
3469
3816
|
* @returns
|
|
3470
|
-
* 0: Success.
|
|
3817
|
+
* 0: Success.
|
|
3818
|
+
* < 0: Failure.
|
|
3471
3819
|
*/
|
|
3472
3820
|
abstract stopAudioRecording(): number;
|
|
3473
3821
|
|
|
@@ -3475,7 +3823,8 @@ export abstract class IRtcEngine {
|
|
|
3475
3823
|
* Creates a media player instance.
|
|
3476
3824
|
*
|
|
3477
3825
|
* @returns
|
|
3478
|
-
* The IMediaPlayer instance, if the method call succeeds.
|
|
3826
|
+
* The IMediaPlayer instance, if the method call succeeds.
|
|
3827
|
+
* An empty pointer, if the method call fails.
|
|
3479
3828
|
*/
|
|
3480
3829
|
abstract createMediaPlayer(): IMediaPlayer;
|
|
3481
3830
|
|
|
@@ -3485,7 +3834,8 @@ export abstract class IRtcEngine {
|
|
|
3485
3834
|
* @param mediaPlayer One IMediaPlayer object.
|
|
3486
3835
|
*
|
|
3487
3836
|
* @returns
|
|
3488
|
-
* ≥ 0: Success. Returns the ID of media player instance.
|
|
3837
|
+
* ≥ 0: Success. Returns the ID of media player instance.
|
|
3838
|
+
* < 0: Failure.
|
|
3489
3839
|
*/
|
|
3490
3840
|
abstract destroyMediaPlayer(mediaPlayer: IMediaPlayer): number;
|
|
3491
3841
|
|
|
@@ -3502,17 +3852,29 @@ export abstract class IRtcEngine {
|
|
|
3502
3852
|
/**
|
|
3503
3853
|
* Starts playing the music file.
|
|
3504
3854
|
*
|
|
3505
|
-
* This method mixes the specified local or online audio file with the audio from the microphone, or replaces the microphone's audio with the specified local or remote audio file. A successful method call triggers the onAudioMixingStateChanged (
|
|
3855
|
+
* This method mixes the specified local or online audio file with the audio from the microphone, or replaces the microphone's audio with the specified local or remote audio file. A successful method call triggers the onAudioMixingStateChanged (AudioMixingStatePlaying) callback. When the audio mixing file playback finishes, the SDK triggers the onAudioMixingStateChanged (AudioMixingStateStopped) callback on the local client.
|
|
3856
|
+
* For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
|
|
3857
|
+
* You can call this method either before or after joining a channel. If you need to call startAudioMixing multiple times, ensure that the time interval between calling this method is more than 500 ms.
|
|
3858
|
+
* If the local music file does not exist, the SDK does not support the file format, or the the SDK cannot access the music file URL, the SDK reports 701.
|
|
3506
3859
|
*
|
|
3507
3860
|
* @param filePath File path:
|
|
3508
|
-
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: C:\music\audio.mp4.
|
|
3861
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
3509
3862
|
* macOS: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: /var/mobile/Containers/Data/audio.mp4.
|
|
3510
|
-
* @param loopback Whether to only play music files on the local client:true: Only play music files on the local client so that only the local user can hear the music.false: Publish music files to remote clients so that both the local user and remote users can hear the music.
|
|
3511
|
-
* @param cycle The number of times the music file plays
|
|
3863
|
+
* @param loopback Whether to only play music files on the local client: true : Only play music files on the local client so that only the local user can hear the music. false : Publish music files to remote clients so that both the local user and remote users can hear the music.
|
|
3864
|
+
* @param cycle The number of times the music file plays.
|
|
3865
|
+
* ≥ 0: The number of playback times. For example, 0 means that the SDK does not play the music file while 1 means that the SDK plays once.
|
|
3866
|
+
* -1: Play the audio file in an infinite loop.
|
|
3512
3867
|
* @param startPos The playback position (ms) of the music file.
|
|
3513
3868
|
*
|
|
3514
3869
|
* @returns
|
|
3515
|
-
* 0: Success.
|
|
3870
|
+
* 0: Success.
|
|
3871
|
+
* < 0: Failure.
|
|
3872
|
+
* -1: A general error occurs (no specified reason).
|
|
3873
|
+
* -2: The parameter is invalid.
|
|
3874
|
+
* -3: The SDK is not ready.
|
|
3875
|
+
* The audio module is disabled.
|
|
3876
|
+
* The program is not complete.
|
|
3877
|
+
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
|
|
3516
3878
|
*/
|
|
3517
3879
|
abstract startAudioMixing(
|
|
3518
3880
|
filePath: string,
|
|
@@ -3527,7 +3889,8 @@ export abstract class IRtcEngine {
|
|
|
3527
3889
|
* This method stops the audio mixing. Call this method when you are in a channel.
|
|
3528
3890
|
*
|
|
3529
3891
|
* @returns
|
|
3530
|
-
* 0: Success.
|
|
3892
|
+
* 0: Success.
|
|
3893
|
+
* < 0: Failure.
|
|
3531
3894
|
*/
|
|
3532
3895
|
abstract stopAudioMixing(): number;
|
|
3533
3896
|
|
|
@@ -3537,7 +3900,8 @@ export abstract class IRtcEngine {
|
|
|
3537
3900
|
* Call this method after joining a channel.
|
|
3538
3901
|
*
|
|
3539
3902
|
* @returns
|
|
3540
|
-
* 0: Success.
|
|
3903
|
+
* 0: Success.
|
|
3904
|
+
* < 0: Failure.
|
|
3541
3905
|
*/
|
|
3542
3906
|
abstract pauseAudioMixing(): number;
|
|
3543
3907
|
|
|
@@ -3547,177 +3911,203 @@ export abstract class IRtcEngine {
|
|
|
3547
3911
|
* This method resumes playing and mixing the music file. Call this method when you are in a channel.
|
|
3548
3912
|
*
|
|
3549
3913
|
* @returns
|
|
3550
|
-
* 0: Success.
|
|
3914
|
+
* 0: Success.
|
|
3915
|
+
* < 0: Failure.
|
|
3551
3916
|
*/
|
|
3552
3917
|
abstract resumeAudioMixing(): number;
|
|
3553
3918
|
|
|
3554
3919
|
/**
|
|
3555
3920
|
* Selects the audio track used during playback.
|
|
3556
3921
|
*
|
|
3557
|
-
* After getting the track index of the audio file, you can call this method to specify any track to play. For example, if different tracks of a multi-track file store songs in different languages, you can call this method to set the playback language.
|
|
3922
|
+
* After getting the track index of the audio file, you can call this method to specify any track to play. For example, if different tracks of a multi-track file store songs in different languages, you can call this method to set the playback language.
|
|
3923
|
+
* For the supported formats of audio files, see.
|
|
3924
|
+
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3558
3925
|
*
|
|
3559
|
-
* @param index The audio track you want to specify. The value range is [0, getAudioTrackCount()].
|
|
3926
|
+
* @param index The audio track you want to specify. The value range is [0, getAudioTrackCount ()].
|
|
3560
3927
|
*
|
|
3561
3928
|
* @returns
|
|
3562
|
-
* 0: Success.
|
|
3929
|
+
* 0: Success.
|
|
3930
|
+
* < 0: Failure.
|
|
3563
3931
|
*/
|
|
3564
3932
|
abstract selectAudioTrack(index: number): number;
|
|
3565
3933
|
|
|
3566
3934
|
/**
|
|
3567
3935
|
* Gets the index of audio tracks of the current music file.
|
|
3568
3936
|
*
|
|
3569
|
-
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3937
|
+
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3570
3938
|
*
|
|
3571
3939
|
* @returns
|
|
3572
|
-
* The SDK returns the index of the audio tracks if the method call succeeds.
|
|
3940
|
+
* The SDK returns the index of the audio tracks if the method call succeeds.
|
|
3941
|
+
* < 0: Failure.
|
|
3573
3942
|
*/
|
|
3574
3943
|
abstract getAudioTrackCount(): number;
|
|
3575
3944
|
|
|
3576
3945
|
/**
|
|
3577
3946
|
* Adjusts the volume during audio mixing.
|
|
3578
3947
|
*
|
|
3579
|
-
* This method adjusts the audio mixing volume on both the local client and remote clients.
|
|
3948
|
+
* This method adjusts the audio mixing volume on both the local client and remote clients.
|
|
3949
|
+
* Call this method after startAudioMixing.
|
|
3580
3950
|
*
|
|
3581
3951
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
3582
3952
|
*
|
|
3583
3953
|
* @returns
|
|
3584
|
-
* 0: Success.
|
|
3954
|
+
* 0: Success.
|
|
3955
|
+
* < 0: Failure.
|
|
3585
3956
|
*/
|
|
3586
3957
|
abstract adjustAudioMixingVolume(volume: number): number;
|
|
3587
3958
|
|
|
3588
3959
|
/**
|
|
3589
3960
|
* Adjusts the volume of audio mixing for publishing.
|
|
3590
3961
|
*
|
|
3591
|
-
* This method adjusts the volume of audio mixing for publishing (sending to other users). Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3962
|
+
* This method adjusts the volume of audio mixing for publishing (sending to other users). Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3592
3963
|
*
|
|
3593
3964
|
* @param volume The volume of audio mixing for local playback. The value ranges between 0 and 100 (default). 100 represents the original volume.
|
|
3594
3965
|
*
|
|
3595
3966
|
* @returns
|
|
3596
|
-
* 0: Success.
|
|
3967
|
+
* 0: Success.
|
|
3968
|
+
* < 0: Failure.
|
|
3597
3969
|
*/
|
|
3598
3970
|
abstract adjustAudioMixingPublishVolume(volume: number): number;
|
|
3599
3971
|
|
|
3600
3972
|
/**
|
|
3601
3973
|
* Retrieves the audio mixing volume for publishing.
|
|
3602
3974
|
*
|
|
3603
|
-
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3975
|
+
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3604
3976
|
*
|
|
3605
3977
|
* @returns
|
|
3606
|
-
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3978
|
+
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3979
|
+
* < 0: Failure.
|
|
3607
3980
|
*/
|
|
3608
3981
|
abstract getAudioMixingPublishVolume(): number;
|
|
3609
3982
|
|
|
3610
3983
|
/**
|
|
3611
3984
|
* Adjusts the volume of audio mixing for local playback.
|
|
3612
3985
|
*
|
|
3613
|
-
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3986
|
+
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3614
3987
|
*
|
|
3615
3988
|
* @param volume The volume of audio mixing for local playback. The value ranges between 0 and 100 (default). 100 represents the original volume.
|
|
3616
3989
|
*
|
|
3617
3990
|
* @returns
|
|
3618
|
-
* 0: Success.
|
|
3991
|
+
* 0: Success.
|
|
3992
|
+
* < 0: Failure.
|
|
3619
3993
|
*/
|
|
3620
3994
|
abstract adjustAudioMixingPlayoutVolume(volume: number): number;
|
|
3621
3995
|
|
|
3622
3996
|
/**
|
|
3623
3997
|
* Retrieves the audio mixing volume for local playback.
|
|
3624
3998
|
*
|
|
3625
|
-
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3999
|
+
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3626
4000
|
*
|
|
3627
4001
|
* @returns
|
|
3628
|
-
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
4002
|
+
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
4003
|
+
* < 0: Failure.
|
|
3629
4004
|
*/
|
|
3630
4005
|
abstract getAudioMixingPlayoutVolume(): number;
|
|
3631
4006
|
|
|
3632
4007
|
/**
|
|
3633
4008
|
* Retrieves the duration (ms) of the music file.
|
|
3634
4009
|
*
|
|
3635
|
-
* Retrieves the total duration (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
4010
|
+
* Retrieves the total duration (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3636
4011
|
*
|
|
3637
4012
|
* @returns
|
|
3638
|
-
* ≥ 0: The audio mixing duration, if this method call succeeds.
|
|
4013
|
+
* ≥ 0: The audio mixing duration, if this method call succeeds.
|
|
4014
|
+
* < 0: Failure.
|
|
3639
4015
|
*/
|
|
3640
4016
|
abstract getAudioMixingDuration(): number;
|
|
3641
4017
|
|
|
3642
4018
|
/**
|
|
3643
4019
|
* Retrieves the playback position (ms) of the music file.
|
|
3644
4020
|
*
|
|
3645
|
-
* Retrieves the playback position (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
4021
|
+
* Retrieves the playback position (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
4022
|
+
* If you need to call getAudioMixingCurrentPosition multiple times, ensure that the time interval between calling this method is more than 500 ms.
|
|
3646
4023
|
*
|
|
3647
4024
|
* @returns
|
|
3648
|
-
* ≥ 0: The current playback position (ms) of the audio mixing, if this method call succeeds. 0 represents that the current music file does not start playing.
|
|
4025
|
+
* ≥ 0: The current playback position (ms) of the audio mixing, if this method call succeeds. 0 represents that the current music file does not start playing.
|
|
4026
|
+
* < 0: Failure.
|
|
3649
4027
|
*/
|
|
3650
4028
|
abstract getAudioMixingCurrentPosition(): number;
|
|
3651
4029
|
|
|
3652
4030
|
/**
|
|
3653
4031
|
* Sets the audio mixing position.
|
|
3654
4032
|
*
|
|
3655
|
-
* Call this method to set the playback position of the music file to a different starting position (the default plays from the beginning). You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
4033
|
+
* Call this method to set the playback position of the music file to a different starting position (the default plays from the beginning). You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3656
4034
|
*
|
|
3657
4035
|
* @param pos Integer. The playback position (ms).
|
|
3658
4036
|
*
|
|
3659
4037
|
* @returns
|
|
3660
|
-
* 0: Success.
|
|
4038
|
+
* 0: Success.
|
|
4039
|
+
* < 0: Failure.
|
|
3661
4040
|
*/
|
|
3662
4041
|
abstract setAudioMixingPosition(pos: number): number;
|
|
3663
4042
|
|
|
3664
4043
|
/**
|
|
3665
4044
|
* Sets the channel mode of the current audio file.
|
|
3666
4045
|
*
|
|
3667
|
-
* In a stereo music file, the left and right channels can store different audio data. According to your needs, you can set the channel mode to original mode, left channel mode, right channel mode, or mixed channel mode. For example, in the KTV scenario, the left channel of the music file stores the musical accompaniment, and the right channel stores the singing voice. If you only need to listen to the accompaniment, call this method to set the channel mode of the music file to left channel mode; if you need to listen to the accompaniment and the singing voice at the same time, call this method to set the channel mode to mixed channel mode.
|
|
4046
|
+
* In a stereo music file, the left and right channels can store different audio data. According to your needs, you can set the channel mode to original mode, left channel mode, right channel mode, or mixed channel mode. For example, in the KTV scenario, the left channel of the music file stores the musical accompaniment, and the right channel stores the singing voice. If you only need to listen to the accompaniment, call this method to set the channel mode of the music file to left channel mode; if you need to listen to the accompaniment and the singing voice at the same time, call this method to set the channel mode to mixed channel mode.
|
|
4047
|
+
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
4048
|
+
* This method only applies to stereo audio files.
|
|
3668
4049
|
*
|
|
3669
4050
|
* @param mode The channel mode. See AudioMixingDualMonoMode.
|
|
3670
4051
|
*
|
|
3671
4052
|
* @returns
|
|
3672
|
-
* 0: Success.
|
|
4053
|
+
* 0: Success.
|
|
4054
|
+
* < 0: Failure.
|
|
3673
4055
|
*/
|
|
3674
4056
|
abstract setAudioMixingDualMonoMode(mode: AudioMixingDualMonoMode): number;
|
|
3675
4057
|
|
|
3676
4058
|
/**
|
|
3677
4059
|
* Sets the pitch of the local music file.
|
|
3678
4060
|
*
|
|
3679
|
-
* When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
4061
|
+
* When a local music file is mixed with a local human voice, call this method to set the pitch of the local music file only. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3680
4062
|
*
|
|
3681
4063
|
* @param pitch Sets the pitch of the local music file by the chromatic scale. The default value is 0, which means keeping the original pitch. The value ranges from -12 to 12, and the pitch value between consecutive values is a chromatic value. The greater the absolute value of this parameter, the higher or lower the pitch of the local music file.
|
|
3682
4064
|
*
|
|
3683
4065
|
* @returns
|
|
3684
|
-
* 0: Success.
|
|
4066
|
+
* 0: Success.
|
|
4067
|
+
* < 0: Failure.
|
|
3685
4068
|
*/
|
|
3686
4069
|
abstract setAudioMixingPitch(pitch: number): number;
|
|
3687
4070
|
|
|
3688
4071
|
/**
|
|
3689
4072
|
* Retrieves the volume of the audio effects.
|
|
3690
4073
|
*
|
|
3691
|
-
* The volume is an integer ranging from 0 to 100. The default value is 100, which means the original volume. Call this method after playEffect
|
|
4074
|
+
* The volume is an integer ranging from 0 to 100. The default value is 100, which means the original volume. Call this method after playEffect.
|
|
3692
4075
|
*
|
|
3693
4076
|
* @returns
|
|
3694
|
-
* Volume of the audio effects, if this method call succeeds.
|
|
4077
|
+
* Volume of the audio effects, if this method call succeeds.
|
|
4078
|
+
* < 0: Failure.
|
|
3695
4079
|
*/
|
|
3696
4080
|
abstract getEffectsVolume(): number;
|
|
3697
4081
|
|
|
3698
4082
|
/**
|
|
3699
4083
|
* Sets the volume of the audio effects.
|
|
3700
4084
|
*
|
|
3701
|
-
* Call this method after playEffect
|
|
4085
|
+
* Call this method after playEffect.
|
|
3702
4086
|
*
|
|
3703
4087
|
* @param volume The playback volume. The value range is [0, 100]. The default value is 100, which represents the original volume.
|
|
3704
4088
|
*
|
|
3705
4089
|
* @returns
|
|
3706
|
-
* 0: Success.
|
|
4090
|
+
* 0: Success.
|
|
4091
|
+
* < 0: Failure.
|
|
3707
4092
|
*/
|
|
3708
4093
|
abstract setEffectsVolume(volume: number): number;
|
|
3709
4094
|
|
|
3710
4095
|
/**
|
|
3711
4096
|
* Preloads a specified audio effect file into the memory.
|
|
3712
4097
|
*
|
|
3713
|
-
* To ensure smooth communication, It is recommended that you limit the size of the audio effect file. You can call this method to preload the audio effect before calling joinChannel
|
|
4098
|
+
* To ensure smooth communication, It is recommended that you limit the size of the audio effect file. You can call this method to preload the audio effect before calling joinChannel.
|
|
4099
|
+
* This method does not support online audio effect files.
|
|
4100
|
+
* For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
|
|
3714
4101
|
*
|
|
3715
4102
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3716
|
-
* @param filePath File path:
|
|
4103
|
+
* @param filePath File path:
|
|
4104
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
4105
|
+
* macOS: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: /var/mobile/Containers/Data/audio.mp4.
|
|
3717
4106
|
* @param startPos The playback position (ms) of the audio effect file.
|
|
3718
4107
|
*
|
|
3719
4108
|
* @returns
|
|
3720
|
-
* 0: Success.
|
|
4109
|
+
* 0: Success.
|
|
4110
|
+
* < 0: Failure.
|
|
3721
4111
|
*/
|
|
3722
4112
|
abstract preloadEffect(
|
|
3723
4113
|
soundId: number,
|
|
@@ -3728,19 +4118,25 @@ export abstract class IRtcEngine {
|
|
|
3728
4118
|
/**
|
|
3729
4119
|
* Plays the specified local or online audio effect file.
|
|
3730
4120
|
*
|
|
3731
|
-
* If you use this method to play an online audio effect file, Agora recommends that you cache the online audio effect file to your local device, call preloadEffect to preload the cached audio effect file into memory, and then call this method to play the audio effect. Otherwise, you might encounter playback failures or no sound during playback due to loading timeouts or failures. To play multiple audio effect files at the same time, call this method multiple times with different soundId and filePath
|
|
4121
|
+
* If you use this method to play an online audio effect file, Agora recommends that you cache the online audio effect file to your local device, call preloadEffect to preload the cached audio effect file into memory, and then call this method to play the audio effect. Otherwise, you might encounter playback failures or no sound during playback due to loading timeouts or failures. To play multiple audio effect files at the same time, call this method multiple times with different soundId and filePath. To achieve the optimal user experience, Agora recommends that do not playing more than three audio files at the same time. After the playback of an audio effect file completes, the SDK triggers the onAudioEffectFinished callback.
|
|
3732
4122
|
*
|
|
3733
|
-
* @param soundId The audio effect ID. The ID of each audio effect file is unique.If you have preloaded an audio effect into memory by calling preloadEffect, ensure that the value of this parameter is the same as that of soundId in preloadEffect.
|
|
3734
|
-
* @param filePath The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example, C:\music\audio.mp4. Supported audio formats include MP3, AAC, M4A, MP4, WAV, and 3GP. See supported audio formats.If you have preloaded an audio effect into memory by calling preloadEffect, ensure that the value of this parameter is the same as that of filePath in preloadEffect.
|
|
3735
|
-
* @param loopCount The number of times the audio effect loops
|
|
4123
|
+
* @param soundId The audio effect ID. The ID of each audio effect file is unique. If you have preloaded an audio effect into memory by calling preloadEffect, ensure that the value of this parameter is the same as that of soundId in preloadEffect.
|
|
4124
|
+
* @param filePath The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example, C:\music\audio.mp4. Supported audio formats include MP3, AAC, M4A, MP4, WAV, and 3GP. See supported audio formats. If you have preloaded an audio effect into memory by calling preloadEffect, ensure that the value of this parameter is the same as that of filePath in preloadEffect.
|
|
4125
|
+
* @param loopCount The number of times the audio effect loops.
|
|
4126
|
+
* ≥ 0: The number of playback times. For example, 1 means looping one time, which means playing the audio effect two times in total.
|
|
4127
|
+
* -1: Play the audio file in an infinite loop.
|
|
3736
4128
|
* @param pitch The pitch of the audio effect. The value range is 0.5 to 2.0. The default value is 1.0, which means the original pitch. The lower the value, the lower the pitch.
|
|
3737
|
-
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0
|
|
4129
|
+
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
|
4130
|
+
* -1.0: The audio effect is heard on the left of the user.
|
|
4131
|
+
* 0.0: The audio effect is heard in front of the user.
|
|
4132
|
+
* 1.0: The audio effect is heard on the right of the user.
|
|
3738
4133
|
* @param gain The volume of the audio effect. The value range is 0.0 to 100.0. The default value is 100.0, which means the original volume. The smaller the value, the lower the volume.
|
|
3739
|
-
* @param publish Whether to publish the audio effect to the remote users:true: Publish the audio effect to the remote users. Both the local user and remote users can hear the audio effect.false: Do not publish the audio effect to the remote users. Only the local user can hear the audio effect.
|
|
4134
|
+
* @param publish Whether to publish the audio effect to the remote users: true : Publish the audio effect to the remote users. Both the local user and remote users can hear the audio effect. false : Do not publish the audio effect to the remote users. Only the local user can hear the audio effect.
|
|
3740
4135
|
* @param startPos The playback position (ms) of the audio effect file.
|
|
3741
4136
|
*
|
|
3742
4137
|
* @returns
|
|
3743
|
-
* 0: Success.
|
|
4138
|
+
* 0: Success.
|
|
4139
|
+
* < 0: Failure.
|
|
3744
4140
|
*/
|
|
3745
4141
|
abstract playEffect(
|
|
3746
4142
|
soundId: number,
|
|
@@ -3758,14 +4154,21 @@ export abstract class IRtcEngine {
|
|
|
3758
4154
|
*
|
|
3759
4155
|
* After calling preloadEffect multiple times to preload multiple audio effects into the memory, you can call this method to play all the specified audio effects for all users in the channel.
|
|
3760
4156
|
*
|
|
3761
|
-
* @param loopCount The number of times the audio effect loops
|
|
4157
|
+
* @param loopCount The number of times the audio effect loops:
|
|
4158
|
+
* -1: Play the audio effect files in an indefinite loop until you call stopEffect or stopAllEffects.
|
|
4159
|
+
* 0: Play the audio effect once.
|
|
4160
|
+
* 1: Play the audio effect twice.
|
|
3762
4161
|
* @param pitch The pitch of the audio effect. The value ranges between 0.5 and 2.0. The default value is 1.0 (original pitch). The lower the value, the lower the pitch.
|
|
3763
|
-
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0
|
|
4162
|
+
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
|
4163
|
+
* -1.0: The audio effect shows on the left.
|
|
4164
|
+
* 0: The audio effect shows ahead.
|
|
4165
|
+
* 1.0: The audio effect shows on the right.
|
|
3764
4166
|
* @param gain The volume of the audio effect. The value range is [0, 100]. The default value is 100 (original volume). The smaller the value, the lower the volume.
|
|
3765
|
-
* @param publish Whether to publish the audio effect to the remote users:true: Publish the audio effect to the remote users. Both the local user and remote users can hear the audio effect.false: (Default) Do not publish the audio effect to the remote users. Only the local user can hear the audio effect.
|
|
4167
|
+
* @param publish Whether to publish the audio effect to the remote users: true : Publish the audio effect to the remote users. Both the local user and remote users can hear the audio effect. false : (Default) Do not publish the audio effect to the remote users. Only the local user can hear the audio effect.
|
|
3766
4168
|
*
|
|
3767
4169
|
* @returns
|
|
3768
|
-
* 0: Success.
|
|
4170
|
+
* 0: Success.
|
|
4171
|
+
* < 0: Failure.
|
|
3769
4172
|
*/
|
|
3770
4173
|
abstract playAllEffects(
|
|
3771
4174
|
loopCount: number,
|
|
@@ -3781,7 +4184,8 @@ export abstract class IRtcEngine {
|
|
|
3781
4184
|
* @param soundId The ID of the audio effect file.
|
|
3782
4185
|
*
|
|
3783
4186
|
* @returns
|
|
3784
|
-
* ≥ 0: Returns the volume of the specified audio effect, if the method call is successful. The value ranges between 0 and 100. 100 represents the original volume.
|
|
4187
|
+
* ≥ 0: Returns the volume of the specified audio effect, if the method call is successful. The value ranges between 0 and 100. 100 represents the original volume.
|
|
4188
|
+
* < 0: Failure.
|
|
3785
4189
|
*/
|
|
3786
4190
|
abstract getVolumeOfEffect(soundId: number): number;
|
|
3787
4191
|
|
|
@@ -3792,7 +4196,8 @@ export abstract class IRtcEngine {
|
|
|
3792
4196
|
* @param volume The playback volume. The value range is [0, 100]. The default value is 100, which represents the original volume.
|
|
3793
4197
|
*
|
|
3794
4198
|
* @returns
|
|
3795
|
-
* 0: Success.
|
|
4199
|
+
* 0: Success.
|
|
4200
|
+
* < 0: Failure.
|
|
3796
4201
|
*/
|
|
3797
4202
|
abstract setVolumeOfEffect(soundId: number, volume: number): number;
|
|
3798
4203
|
|
|
@@ -3802,7 +4207,8 @@ export abstract class IRtcEngine {
|
|
|
3802
4207
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3803
4208
|
*
|
|
3804
4209
|
* @returns
|
|
3805
|
-
* 0: Success.
|
|
4210
|
+
* 0: Success.
|
|
4211
|
+
* < 0: Failure.
|
|
3806
4212
|
*/
|
|
3807
4213
|
abstract pauseEffect(soundId: number): number;
|
|
3808
4214
|
|
|
@@ -3810,7 +4216,8 @@ export abstract class IRtcEngine {
|
|
|
3810
4216
|
* Pauses all audio effects.
|
|
3811
4217
|
*
|
|
3812
4218
|
* @returns
|
|
3813
|
-
* 0: Success.
|
|
4219
|
+
* 0: Success.
|
|
4220
|
+
* < 0: Failure.
|
|
3814
4221
|
*/
|
|
3815
4222
|
abstract pauseAllEffects(): number;
|
|
3816
4223
|
|
|
@@ -3820,7 +4227,8 @@ export abstract class IRtcEngine {
|
|
|
3820
4227
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3821
4228
|
*
|
|
3822
4229
|
* @returns
|
|
3823
|
-
* 0: Success.
|
|
4230
|
+
* 0: Success.
|
|
4231
|
+
* < 0: Failure.
|
|
3824
4232
|
*/
|
|
3825
4233
|
abstract resumeEffect(soundId: number): number;
|
|
3826
4234
|
|
|
@@ -3828,7 +4236,8 @@ export abstract class IRtcEngine {
|
|
|
3828
4236
|
* Resumes playing all audio effect files.
|
|
3829
4237
|
*
|
|
3830
4238
|
* @returns
|
|
3831
|
-
* 0: Success.
|
|
4239
|
+
* 0: Success.
|
|
4240
|
+
* < 0: Failure.
|
|
3832
4241
|
*/
|
|
3833
4242
|
abstract resumeAllEffects(): number;
|
|
3834
4243
|
|
|
@@ -3838,7 +4247,8 @@ export abstract class IRtcEngine {
|
|
|
3838
4247
|
* @param soundId The ID of the audio effect. Each audio effect has a unique ID.
|
|
3839
4248
|
*
|
|
3840
4249
|
* @returns
|
|
3841
|
-
* 0: Success.
|
|
4250
|
+
* 0: Success.
|
|
4251
|
+
* < 0: Failure.
|
|
3842
4252
|
*/
|
|
3843
4253
|
abstract stopEffect(soundId: number): number;
|
|
3844
4254
|
|
|
@@ -3846,7 +4256,8 @@ export abstract class IRtcEngine {
|
|
|
3846
4256
|
* Stops playing all audio effects.
|
|
3847
4257
|
*
|
|
3848
4258
|
* @returns
|
|
3849
|
-
* 0: Success.
|
|
4259
|
+
* 0: Success.
|
|
4260
|
+
* < 0: Failure.
|
|
3850
4261
|
*/
|
|
3851
4262
|
abstract stopAllEffects(): number;
|
|
3852
4263
|
|
|
@@ -3856,7 +4267,8 @@ export abstract class IRtcEngine {
|
|
|
3856
4267
|
* @param soundId The ID of the audio effect. Each audio effect has a unique ID.
|
|
3857
4268
|
*
|
|
3858
4269
|
* @returns
|
|
3859
|
-
* 0: Success.
|
|
4270
|
+
* 0: Success.
|
|
4271
|
+
* < 0: Failure.
|
|
3860
4272
|
*/
|
|
3861
4273
|
abstract unloadEffect(soundId: number): number;
|
|
3862
4274
|
|
|
@@ -3864,7 +4276,8 @@ export abstract class IRtcEngine {
|
|
|
3864
4276
|
* Releases a specified preloaded audio effect from the memory.
|
|
3865
4277
|
*
|
|
3866
4278
|
* @returns
|
|
3867
|
-
* 0: Success.
|
|
4279
|
+
* 0: Success.
|
|
4280
|
+
* < 0: Failure.
|
|
3868
4281
|
*/
|
|
3869
4282
|
abstract unloadAllEffects(): number;
|
|
3870
4283
|
|
|
@@ -3874,24 +4287,26 @@ export abstract class IRtcEngine {
|
|
|
3874
4287
|
* Call this method after joining a channel.
|
|
3875
4288
|
*
|
|
3876
4289
|
* @param filePath File path:
|
|
3877
|
-
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: C:\music\audio.mp4.
|
|
4290
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
3878
4291
|
* macOS: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: /var/mobile/Containers/Data/audio.mp4.
|
|
3879
4292
|
*
|
|
3880
4293
|
* @returns
|
|
3881
|
-
* The total duration (ms) of the specified audio effect file, if the method call succeeds.
|
|
4294
|
+
* The total duration (ms) of the specified audio effect file, if the method call succeeds.
|
|
4295
|
+
* < 0: Failure.
|
|
3882
4296
|
*/
|
|
3883
4297
|
abstract getEffectDuration(filePath: string): number;
|
|
3884
4298
|
|
|
3885
4299
|
/**
|
|
3886
4300
|
* Sets the playback position of an audio effect file.
|
|
3887
4301
|
*
|
|
3888
|
-
* After a successful setting, the local audio effect file starts playing at the specified position. Call this method after playEffect
|
|
4302
|
+
* After a successful setting, the local audio effect file starts playing at the specified position. Call this method after playEffect.
|
|
3889
4303
|
*
|
|
3890
4304
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3891
4305
|
* @param pos The playback position (ms) of the audio effect file.
|
|
3892
4306
|
*
|
|
3893
4307
|
* @returns
|
|
3894
|
-
* 0: Success.
|
|
4308
|
+
* 0: Success.
|
|
4309
|
+
* < 0: Failure.
|
|
3895
4310
|
*/
|
|
3896
4311
|
abstract setEffectPosition(soundId: number, pos: number): number;
|
|
3897
4312
|
|
|
@@ -3903,33 +4318,42 @@ export abstract class IRtcEngine {
|
|
|
3903
4318
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3904
4319
|
*
|
|
3905
4320
|
* @returns
|
|
3906
|
-
* The playback position (ms) of the specified audio effect file, if the method call succeeds.
|
|
4321
|
+
* The playback position (ms) of the specified audio effect file, if the method call succeeds.
|
|
4322
|
+
* < 0: Failure.
|
|
3907
4323
|
*/
|
|
3908
4324
|
abstract getEffectCurrentPosition(soundId: number): number;
|
|
3909
4325
|
|
|
3910
4326
|
/**
|
|
3911
4327
|
* Enables or disables stereo panning for remote users.
|
|
3912
4328
|
*
|
|
3913
|
-
* Ensure that you call this method before joining a channel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition
|
|
4329
|
+
* Ensure that you call this method before joining a channel to enable stereo panning for remote users so that the local user can track the position of a remote user by calling setRemoteVoicePosition.
|
|
3914
4330
|
*
|
|
3915
|
-
* @param enabled Whether to enable stereo panning for remote users:true: Enable stereo panning.false: Disable stereo panning.
|
|
4331
|
+
* @param enabled Whether to enable stereo panning for remote users: true : Enable stereo panning. false : Disable stereo panning.
|
|
3916
4332
|
*
|
|
3917
4333
|
* @returns
|
|
3918
|
-
* 0: Success.
|
|
4334
|
+
* 0: Success.
|
|
4335
|
+
* < 0: Failure.
|
|
3919
4336
|
*/
|
|
3920
4337
|
abstract enableSoundPositionIndication(enabled: boolean): number;
|
|
3921
4338
|
|
|
3922
4339
|
/**
|
|
3923
4340
|
* Sets the 2D position (the position on the horizontal plane) of the remote user's voice.
|
|
3924
4341
|
*
|
|
3925
|
-
* This method sets the 2D position and volume of a remote user, so that the local user can easily hear and identify the remote user's position. When the local user calls this method to set the voice position of a remote user, the voice difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a sense of space. This method applies to massive multiplayer online games, such as Battle Royale games.
|
|
4342
|
+
* This method sets the 2D position and volume of a remote user, so that the local user can easily hear and identify the remote user's position. When the local user calls this method to set the voice position of a remote user, the voice difference between the left and right channels allows the local user to track the real-time position of the remote user, creating a sense of space. This method applies to massive multiplayer online games, such as Battle Royale games.
|
|
4343
|
+
* For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel.
|
|
4344
|
+
* For the best voice positioning, Agora recommends using a wired headset.
|
|
4345
|
+
* Call this method after joining a channel.
|
|
3926
4346
|
*
|
|
3927
4347
|
* @param uid The user ID of the remote user.
|
|
3928
|
-
* @param pan The voice position of the remote user. The value ranges from -1.0 to 1.0:
|
|
4348
|
+
* @param pan The voice position of the remote user. The value ranges from -1.0 to 1.0:
|
|
4349
|
+
* 0.0: (Default) The remote voice comes from the front.
|
|
4350
|
+
* -1.0: The remote voice comes from the left.
|
|
4351
|
+
* 1.0: The remote voice comes from the right.
|
|
3929
4352
|
* @param gain The volume of the remote user. The value ranges from 0.0 to 100.0. The default value is 100.0 (the original volume of the remote user). The smaller the value, the lower the volume.
|
|
3930
4353
|
*
|
|
3931
4354
|
* @returns
|
|
3932
|
-
* 0: Success.
|
|
4355
|
+
* 0: Success.
|
|
4356
|
+
* < 0: Failure.
|
|
3933
4357
|
*/
|
|
3934
4358
|
abstract setRemoteVoicePosition(
|
|
3935
4359
|
uid: number,
|
|
@@ -3940,24 +4364,26 @@ export abstract class IRtcEngine {
|
|
|
3940
4364
|
/**
|
|
3941
4365
|
* Enables or disables the spatial audio effect.
|
|
3942
4366
|
*
|
|
3943
|
-
* After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
|
|
4367
|
+
* After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
|
|
4368
|
+
* You can call this method either before or after joining a channel.
|
|
4369
|
+
* This method relies on the spatial audio dynamic library libagora_spatial_audio_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3944
4370
|
*
|
|
3945
|
-
* @param enabled Whether to enable the spatial audio effect:true: Enable the spatial audio effect.false: Disable the spatial audio effect.
|
|
4371
|
+
* @param enabled Whether to enable the spatial audio effect: true : Enable the spatial audio effect. false : Disable the spatial audio effect.
|
|
3946
4372
|
*
|
|
3947
4373
|
* @returns
|
|
3948
|
-
* 0: Success.
|
|
4374
|
+
* 0: Success.
|
|
4375
|
+
* < 0: Failure.
|
|
3949
4376
|
*/
|
|
3950
4377
|
abstract enableSpatialAudio(enabled: boolean): number;
|
|
3951
4378
|
|
|
3952
4379
|
/**
|
|
3953
4380
|
* Sets the spatial audio effect parameters of the remote user.
|
|
3954
4381
|
*
|
|
3955
|
-
* Call this method after enableSpatialAudio
|
|
3956
|
-
*
|
|
3957
|
-
* @param uid The user ID.
|
|
4382
|
+
* Call this method after enableSpatialAudio. After successfully setting the spatial audio effect parameters of the remote user, the local user can hear the remote user with a sense of space.
|
|
3958
4383
|
*
|
|
3959
4384
|
* @returns
|
|
3960
|
-
* 0: Success.
|
|
4385
|
+
* 0: Success.
|
|
4386
|
+
* < 0: Failure.
|
|
3961
4387
|
*/
|
|
3962
4388
|
abstract setRemoteUserSpatialAudioParams(
|
|
3963
4389
|
uid: number,
|
|
@@ -3967,50 +4393,81 @@ export abstract class IRtcEngine {
|
|
|
3967
4393
|
/**
|
|
3968
4394
|
* Sets a preset voice beautifier effect.
|
|
3969
4395
|
*
|
|
3970
|
-
* Call this method to set a preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect. You can set different voice beautifier effects for different scenarios. For better voice effects, Agora recommends that you call setAudioProfile and set scenario to AudioScenarioGameStreaming (3) and profile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) before calling this method.
|
|
4396
|
+
* Call this method to set a preset voice beautifier effect for the local user who sends an audio stream. After setting a voice beautifier effect, all users in the channel can hear the effect. You can set different voice beautifier effects for different scenarios. For better voice effects, Agora recommends that you call setAudioProfile and set scenario to AudioScenarioGameStreaming (3) and profile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) before calling this method.
|
|
4397
|
+
* You can call this method either before or after joining a channel.
|
|
4398
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
4399
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4400
|
+
* After calling setVoiceBeautifierPreset, Agora does not recommend calling the following methods, otherwise the effect set by setVoiceBeautifierPreset will be overwritten: setAudioEffectPreset setAudioEffectParameters setLocalVoicePitch setLocalVoiceEqualization setLocalVoiceReverb setVoiceBeautifierParameters setVoiceConversionPreset
|
|
4401
|
+
* This method relies on the voice beautifier dynamic library libagora_audio_beauty_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3971
4402
|
*
|
|
3972
4403
|
* @param preset The preset voice beautifier effect options: VoiceBeautifierPreset.
|
|
3973
4404
|
*
|
|
3974
4405
|
* @returns
|
|
3975
|
-
* 0: Success.
|
|
4406
|
+
* 0: Success.
|
|
4407
|
+
* < 0: Failure.
|
|
3976
4408
|
*/
|
|
3977
4409
|
abstract setVoiceBeautifierPreset(preset: VoiceBeautifierPreset): number;
|
|
3978
4410
|
|
|
3979
4411
|
/**
|
|
3980
4412
|
* Sets an SDK preset audio effect.
|
|
3981
4413
|
*
|
|
3982
|
-
* Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect. To get better audio effect quality, Agora recommends setting the scenario parameter of setAudioProfile as AudioScenarioGameStreaming (3) before calling this method.
|
|
4414
|
+
* Call this method to set an SDK preset audio effect for the local user who sends an audio stream. This audio effect does not change the gender characteristics of the original voice. After setting an audio effect, all users in the channel can hear the effect. To get better audio effect quality, Agora recommends setting the scenario parameter of setAudioProfile as AudioScenarioGameStreaming (3) before calling this method.
|
|
4415
|
+
* You can call this method either before or after joining a channel.
|
|
4416
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect.
|
|
4417
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4418
|
+
* If you call setAudioEffectPreset and set enumerators except for RoomAcoustics3dVoice or PitchCorrection, do not call setAudioEffectParameters; otherwise, setAudioEffectPreset is overridden.
|
|
4419
|
+
* After calling setAudioEffectPreset, Agora does not recommend you to call the following methods, otherwise the effect set by setAudioEffectPreset will be overwritten: setVoiceBeautifierPreset setLocalVoicePitch setLocalVoiceEqualization setLocalVoiceReverb setVoiceBeautifierParameters setVoiceConversionPreset
|
|
4420
|
+
* This method relies on the voice beautifier dynamic library libagora_audio_beauty_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3983
4421
|
*
|
|
3984
4422
|
* @param preset The options for SDK preset audio effects. See AudioEffectPreset.
|
|
3985
4423
|
*
|
|
3986
4424
|
* @returns
|
|
3987
|
-
* 0: Success.
|
|
4425
|
+
* 0: Success.
|
|
4426
|
+
* < 0: Failure.
|
|
3988
4427
|
*/
|
|
3989
4428
|
abstract setAudioEffectPreset(preset: AudioEffectPreset): number;
|
|
3990
4429
|
|
|
3991
4430
|
/**
|
|
3992
4431
|
* Sets a preset voice beautifier effect.
|
|
3993
4432
|
*
|
|
3994
|
-
* Call this method to set a preset voice beautifier effect for the local user who sends an audio stream. After setting an audio effect, all users in the channel can hear the effect. You can set different voice beautifier effects for different scenarios. To achieve better audio effect quality, Agora recommends that you call setAudioProfile and set the profile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) and scenario to AudioScenarioGameStreaming (3) before calling this method.
|
|
4433
|
+
* Call this method to set a preset voice beautifier effect for the local user who sends an audio stream. After setting an audio effect, all users in the channel can hear the effect. You can set different voice beautifier effects for different scenarios. To achieve better audio effect quality, Agora recommends that you call setAudioProfile and set the profile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) and scenario to AudioScenarioGameStreaming (3) before calling this method.
|
|
4434
|
+
* You can call this method either before or after joining a channel.
|
|
4435
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
4436
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4437
|
+
* After calling setVoiceConversionPreset, Agora does not recommend you to call the following methods, otherwise the effect set by setVoiceConversionPreset will be overwritten: setAudioEffectPreset setAudioEffectParameters setVoiceBeautifierPreset setVoiceBeautifierParameters setLocalVoicePitch setLocalVoiceFormant setLocalVoiceEqualization setLocalVoiceReverb
|
|
4438
|
+
* This method relies on the voice beautifier dynamic library libagora_audio_beauty_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
3995
4439
|
*
|
|
3996
4440
|
* @param preset The options for the preset voice beautifier effects: VoiceConversionPreset.
|
|
3997
4441
|
*
|
|
3998
4442
|
* @returns
|
|
3999
|
-
* 0: Success.
|
|
4443
|
+
* 0: Success.
|
|
4444
|
+
* < 0: Failure.
|
|
4000
4445
|
*/
|
|
4001
4446
|
abstract setVoiceConversionPreset(preset: VoiceConversionPreset): number;
|
|
4002
4447
|
|
|
4003
4448
|
/**
|
|
4004
4449
|
* Sets parameters for SDK preset audio effects.
|
|
4005
4450
|
*
|
|
4006
|
-
* Call this method to set the following parameters for the local user who sends an audio stream:
|
|
4451
|
+
* Call this method to set the following parameters for the local user who sends an audio stream:
|
|
4452
|
+
* 3D voice effect: Sets the cycle period of the 3D voice effect.
|
|
4453
|
+
* Pitch correction effect: Sets the basic mode and tonic pitch of the pitch correction effect. Different songs have different modes and tonic pitches. Agora recommends bounding this method with interface elements to enable users to adjust the pitch correction interactively. After setting the audio parameters, all users in the channel can hear the effect.
|
|
4454
|
+
* You can call this method either before or after joining a channel.
|
|
4455
|
+
* To get better audio effect quality, Agora recommends setting the scenario parameter of setAudioProfile as AudioScenarioGameStreaming (3) before calling this method.
|
|
4456
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect.
|
|
4457
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4458
|
+
* After calling setAudioEffectParameters, Agora does not recommend you to call the following methods, otherwise the effect set by setAudioEffectParameters will be overwritten: setAudioEffectPreset setVoiceBeautifierPreset setLocalVoicePitch setLocalVoiceEqualization setLocalVoiceReverb setVoiceBeautifierParameters setVoiceConversionPreset
|
|
4007
4459
|
*
|
|
4008
|
-
* @param preset The options for SDK preset audio effects:RoomAcoustics3dVoice, 3D voice effect:
|
|
4009
|
-
*
|
|
4010
|
-
*
|
|
4460
|
+
* @param preset The options for SDK preset audio effects: RoomAcoustics3dVoice, 3D voice effect:
|
|
4461
|
+
* Call setAudioProfile and set the profile parameter in to AudioProfileMusicStandardStereo (3) or AudioProfileMusicHighQualityStereo (5) before setting this enumerator; otherwise, the enumerator setting does not take effect.
|
|
4462
|
+
* If the 3D voice effect is enabled, users need to use stereo audio playback devices to hear the anticipated voice effect. PitchCorrection, Pitch correction effect: To achieve better audio effect quality, Agora recommends setting the profile parameter in setAudioProfile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) before setting this enumerator.
|
|
4463
|
+
* @param param1 If you set preset to RoomAcoustics3dVoice, param1 sets the cycle period of the 3D voice effect. The value range is [1,60] and the unit is seconds. The default value is 10, indicating that the voice moves around you every 10 seconds.
|
|
4464
|
+
* If you set preset to PitchCorrection, param1 indicates the basic mode of the pitch correction effect: 1 : (Default) Natural major scale. 2 : Natural minor scale. 3 : Japanese pentatonic scale.
|
|
4465
|
+
* @param param2 If you set preset to RoomAcoustics3dVoice , you need to set param2 to 0.
|
|
4466
|
+
* If you set preset to PitchCorrection, param2 indicates the tonic pitch of the pitch correction effect: 1 : A 2 : A# 3 : B 4 : (Default) C 5 : C# 6 : D 7 : D# 8 : E 9 : F 10 : F# 11 : G 12 : G#
|
|
4011
4467
|
*
|
|
4012
4468
|
* @returns
|
|
4013
|
-
* 0: Success.
|
|
4469
|
+
* 0: Success.
|
|
4470
|
+
* < 0: Failure.
|
|
4014
4471
|
*/
|
|
4015
4472
|
abstract setAudioEffectParameters(
|
|
4016
4473
|
preset: AudioEffectPreset,
|
|
@@ -4021,14 +4478,19 @@ export abstract class IRtcEngine {
|
|
|
4021
4478
|
/**
|
|
4022
4479
|
* Sets parameters for the preset voice beautifier effects.
|
|
4023
4480
|
*
|
|
4024
|
-
* Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream. After setting the audio parameters, all users in the channel can hear the effect. For better voice effects, Agora recommends that you call setAudioProfile and set scenario to AudioScenarioGameStreaming (3) and profile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) before calling this method.
|
|
4481
|
+
* Call this method to set a gender characteristic and a reverberation effect for the singing beautifier effect. This method sets parameters for the local user who sends an audio stream. After setting the audio parameters, all users in the channel can hear the effect. For better voice effects, Agora recommends that you call setAudioProfile and set scenario to AudioScenarioGameStreaming (3) and profile to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5) before calling this method.
|
|
4482
|
+
* You can call this method either before or after joining a channel.
|
|
4483
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
4484
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4485
|
+
* After calling setVoiceBeautifierParameters, Agora does not recommend calling the following methods, otherwise the effect set by setVoiceBeautifierParameters will be overwritten: setAudioEffectPreset setAudioEffectParameters setVoiceBeautifierPreset setLocalVoicePitch setLocalVoiceEqualization setLocalVoiceReverb setVoiceConversionPreset
|
|
4025
4486
|
*
|
|
4026
|
-
* @param preset The option for the preset audio effect:SINGING_BEAUTIFIER: The singing beautifier effect.
|
|
4027
|
-
* @param param1 The gender characteristics options for the singing voice:1: A male-sounding voice.2: A female-sounding voice.
|
|
4028
|
-
* @param param2 The reverberation effect options for the singing voice:1: The reverberation effect sounds like singing in a small room.2: The reverberation effect sounds like singing in a large room.3: The reverberation effect sounds like singing in a hall.
|
|
4487
|
+
* @param preset The option for the preset audio effect: SINGING_BEAUTIFIER : The singing beautifier effect.
|
|
4488
|
+
* @param param1 The gender characteristics options for the singing voice: 1 : A male-sounding voice. 2 : A female-sounding voice.
|
|
4489
|
+
* @param param2 The reverberation effect options for the singing voice: 1 : The reverberation effect sounds like singing in a small room. 2 : The reverberation effect sounds like singing in a large room. 3 : The reverberation effect sounds like singing in a hall.
|
|
4029
4490
|
*
|
|
4030
4491
|
* @returns
|
|
4031
|
-
* 0: Success.
|
|
4492
|
+
* 0: Success.
|
|
4493
|
+
* < 0: Failure.
|
|
4032
4494
|
*/
|
|
4033
4495
|
abstract setVoiceBeautifierParameters(
|
|
4034
4496
|
preset: VoiceBeautifierPreset,
|
|
@@ -4053,19 +4515,21 @@ export abstract class IRtcEngine {
|
|
|
4053
4515
|
* @param pitch The local voice pitch. The value range is [0.5,2.0]. The lower the value, the lower the pitch. The default value is 1.0 (no change to the pitch).
|
|
4054
4516
|
*
|
|
4055
4517
|
* @returns
|
|
4056
|
-
* 0: Success.
|
|
4518
|
+
* 0: Success.
|
|
4519
|
+
* < 0: Failure.
|
|
4057
4520
|
*/
|
|
4058
4521
|
abstract setLocalVoicePitch(pitch: number): number;
|
|
4059
4522
|
|
|
4060
4523
|
/**
|
|
4061
4524
|
* Set the formant ratio to change the timbre of human voice.
|
|
4062
4525
|
*
|
|
4063
|
-
* Formant ratio affects the timbre of voice. The smaller the value, the deeper the sound will be, and the larger, the sharper. You can call this method to set the formant ratio of local audio to change the timbre of human voice. After you set the formant ratio, all users in the channel can hear the changed voice. If you want to change the timbre and pitch of voice at the same time, Agora recommends using this method together with setLocalVoicePitch
|
|
4526
|
+
* Formant ratio affects the timbre of voice. The smaller the value, the deeper the sound will be, and the larger, the sharper. You can call this method to set the formant ratio of local audio to change the timbre of human voice. After you set the formant ratio, all users in the channel can hear the changed voice. If you want to change the timbre and pitch of voice at the same time, Agora recommends using this method together with setLocalVoicePitch. You can call this method either before or after joining a channel.
|
|
4064
4527
|
*
|
|
4065
|
-
* @param formantRatio The formant ratio. The value range is [-1.0, 1.0]. The default value is 0.0, which means do not change the timbre of the voice.Agora recommends setting this value within the range of [-0.4, 0.6]. Otherwise, the voice may be seriously distorted.
|
|
4528
|
+
* @param formantRatio The formant ratio. The value range is [-1.0, 1.0]. The default value is 0.0, which means do not change the timbre of the voice. Agora recommends setting this value within the range of [-0.4, 0.6]. Otherwise, the voice may be seriously distorted.
|
|
4066
4529
|
*
|
|
4067
4530
|
* @returns
|
|
4068
|
-
* 0: Success.
|
|
4531
|
+
* 0: Success.
|
|
4532
|
+
* < 0: Failure.
|
|
4069
4533
|
*/
|
|
4070
4534
|
abstract setLocalVoiceFormant(formantRatio: number): number;
|
|
4071
4535
|
|
|
@@ -4078,7 +4542,8 @@ export abstract class IRtcEngine {
|
|
|
4078
4542
|
* @param bandGain The gain of each band in dB. The value ranges between -15 and 15. The default value is 0.
|
|
4079
4543
|
*
|
|
4080
4544
|
* @returns
|
|
4081
|
-
* 0: Success.
|
|
4545
|
+
* 0: Success.
|
|
4546
|
+
* < 0: Failure.
|
|
4082
4547
|
*/
|
|
4083
4548
|
abstract setLocalVoiceEqualization(
|
|
4084
4549
|
bandFrequency: AudioEqualizationBandFrequency,
|
|
@@ -4088,13 +4553,14 @@ export abstract class IRtcEngine {
|
|
|
4088
4553
|
/**
|
|
4089
4554
|
* Sets the local voice reverberation.
|
|
4090
4555
|
*
|
|
4091
|
-
* The SDK provides an easier-to-use method, setAudioEffectPreset
|
|
4556
|
+
* The SDK provides an easier-to-use method, setAudioEffectPreset, to directly implement preset reverb effects for such as pop, R&B, and KTV. You can call this method either before or after joining a channel.
|
|
4092
4557
|
*
|
|
4093
4558
|
* @param reverbKey The reverberation key. Agora provides five reverberation keys, see AudioReverbType.
|
|
4094
4559
|
* @param value The value of the reverberation key.
|
|
4095
4560
|
*
|
|
4096
4561
|
* @returns
|
|
4097
|
-
* 0: Success.
|
|
4562
|
+
* 0: Success.
|
|
4563
|
+
* < 0: Failure.
|
|
4098
4564
|
*/
|
|
4099
4565
|
abstract setLocalVoiceReverb(
|
|
4100
4566
|
reverbKey: AudioReverbType,
|
|
@@ -4109,7 +4575,9 @@ export abstract class IRtcEngine {
|
|
|
4109
4575
|
* @param preset The preset headphone equalization effect. See HeadphoneEqualizerPreset.
|
|
4110
4576
|
*
|
|
4111
4577
|
* @returns
|
|
4112
|
-
* 0: Success.
|
|
4578
|
+
* 0: Success.
|
|
4579
|
+
* < 0: Failure.
|
|
4580
|
+
* -1: A general error occurs (no specified reason).
|
|
4113
4581
|
*/
|
|
4114
4582
|
abstract setHeadphoneEQPreset(preset: HeadphoneEqualizerPreset): number;
|
|
4115
4583
|
|
|
@@ -4122,7 +4590,9 @@ export abstract class IRtcEngine {
|
|
|
4122
4590
|
* @param highGain The high-frequency parameters of the headphone equalizer. The value range is [-10,10]. The larger the value, the sharper the sound.
|
|
4123
4591
|
*
|
|
4124
4592
|
* @returns
|
|
4125
|
-
* 0: Success.
|
|
4593
|
+
* 0: Success.
|
|
4594
|
+
* < 0: Failure.
|
|
4595
|
+
* -1: A general error occurs (no specified reason).
|
|
4126
4596
|
*/
|
|
4127
4597
|
abstract setHeadphoneEQParameters(lowGain: number, highGain: number): number;
|
|
4128
4598
|
|
|
@@ -4134,19 +4604,21 @@ export abstract class IRtcEngine {
|
|
|
4134
4604
|
* @param filePath The complete path of the log files. These log files are encoded in UTF-8.
|
|
4135
4605
|
*
|
|
4136
4606
|
* @returns
|
|
4137
|
-
* 0: Success.
|
|
4607
|
+
* 0: Success.
|
|
4608
|
+
* < 0: Failure.
|
|
4138
4609
|
*/
|
|
4139
4610
|
abstract setLogFile(filePath: string): number;
|
|
4140
4611
|
|
|
4141
4612
|
/**
|
|
4142
4613
|
* Sets the log output level of the SDK.
|
|
4143
4614
|
*
|
|
4144
|
-
* Deprecated: Use logConfig in initialize instead. This method sets the output log level of the SDK. You can use one or a combination of the log filter levels. The log level follows the sequence of LogFilterOff
|
|
4615
|
+
* Deprecated: Use logConfig in initialize instead. This method sets the output log level of the SDK. You can use one or a combination of the log filter levels. The log level follows the sequence of LogFilterOff, LogFilterCritical, LogFilterError, LogFilterWarn, LogFilterInfo, and LogFilterDebug. Choose a level to see the logs preceding that level. If, for example, you set the log level to LogFilterWarn, you see the logs within levels LogFilterCritical, LogFilterError and LogFilterWarn.
|
|
4145
4616
|
*
|
|
4146
4617
|
* @param filter The output log level of the SDK. See LogFilterType.
|
|
4147
4618
|
*
|
|
4148
4619
|
* @returns
|
|
4149
|
-
* 0: Success.
|
|
4620
|
+
* 0: Success.
|
|
4621
|
+
* < 0: Failure.
|
|
4150
4622
|
*/
|
|
4151
4623
|
abstract setLogFilter(filter: LogFilterType): number;
|
|
4152
4624
|
|
|
@@ -4158,19 +4630,32 @@ export abstract class IRtcEngine {
|
|
|
4158
4630
|
* @param level The log level: LogLevel.
|
|
4159
4631
|
*
|
|
4160
4632
|
* @returns
|
|
4161
|
-
* 0: Success.
|
|
4633
|
+
* 0: Success.
|
|
4634
|
+
* < 0: Failure.
|
|
4162
4635
|
*/
|
|
4163
4636
|
abstract setLogLevel(level: LogLevel): number;
|
|
4164
4637
|
|
|
4165
4638
|
/**
|
|
4166
4639
|
* Sets the log file size.
|
|
4167
4640
|
*
|
|
4168
|
-
* Deprecated: Use the logConfig parameter in initialize instead. By default, the SDK generates five SDK log files and five API call log files with the following rules:
|
|
4641
|
+
* Deprecated: Use the logConfig parameter in initialize instead. By default, the SDK generates five SDK log files and five API call log files with the following rules:
|
|
4642
|
+
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
4643
|
+
* The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
|
|
4644
|
+
* The default size for each SDK log file is 1,024 KB; the default size for each API call log file is 2,048 KB. These log files are encoded in UTF-8.
|
|
4645
|
+
* The SDK writes the latest logs in agorasdk.log or agoraapi.log.
|
|
4646
|
+
* When agorasdk.log is full, the SDK processes the log files in the following order:
|
|
4647
|
+
* Delete the agorasdk.4.log file (if any).
|
|
4648
|
+
* Rename agorasdk.3.log to agorasdk.4.log.
|
|
4649
|
+
* Rename agorasdk.2.log to agorasdk.3.log.
|
|
4650
|
+
* Rename agorasdk.1.log to agorasdk.2.log.
|
|
4651
|
+
* Create a new agorasdk.log file.
|
|
4652
|
+
* The overwrite rules for the agoraapi.log file are the same as for agorasdk.log. This method is used to set the size of the agorasdk.log file only and does not effect the agoraapi.log file.
|
|
4169
4653
|
*
|
|
4170
|
-
* @param fileSizeInKBytes The size (KB) of an agorasdk.log file. The value range is [128,20480]. The default value is
|
|
4654
|
+
* @param fileSizeInKBytes The size (KB) of an agorasdk.log file. The value range is [128,20480]. The default value is 2,048 KB. If you set fileSizeInKByte smaller than 128 KB, the SDK automatically adjusts it to 128 KB; if you set fileSizeInKByte greater than 20,480 KB, the SDK automatically adjusts it to 20,480 KB.
|
|
4171
4655
|
*
|
|
4172
4656
|
* @returns
|
|
4173
|
-
* 0: Success.
|
|
4657
|
+
* 0: Success.
|
|
4658
|
+
* < 0: Failure.
|
|
4174
4659
|
*/
|
|
4175
4660
|
abstract setLogFileSize(fileSizeInKBytes: number): number;
|
|
4176
4661
|
|
|
@@ -4182,13 +4667,16 @@ export abstract class IRtcEngine {
|
|
|
4182
4667
|
/**
|
|
4183
4668
|
* Updates the display mode of the local video view.
|
|
4184
4669
|
*
|
|
4185
|
-
* After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream.
|
|
4670
|
+
* After initializing the local video view, you can call this method to update its rendering and mirror modes. It affects only the video view that the local user sees, not the published local video stream.
|
|
4671
|
+
* Ensure that you have called the setupLocalVideo method to initialize the local video view before calling this method.
|
|
4672
|
+
* During a call, you can call this method as many times as necessary to update the display mode of the local video view.
|
|
4186
4673
|
*
|
|
4187
4674
|
* @param renderMode The local video display mode. See RenderModeType.
|
|
4188
|
-
* @param mirrorMode The mirror mode of the local video view. See VideoMirrorModeType.If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
|
|
4675
|
+
* @param mirrorMode The mirror mode of the local video view. See VideoMirrorModeType. If you use a front camera, the SDK enables the mirror mode by default; if you use a rear camera, the SDK disables the mirror mode by default.
|
|
4189
4676
|
*
|
|
4190
4677
|
* @returns
|
|
4191
|
-
* 0: Success.
|
|
4678
|
+
* 0: Success.
|
|
4679
|
+
* < 0: Failure.
|
|
4192
4680
|
*/
|
|
4193
4681
|
abstract setLocalRenderMode(
|
|
4194
4682
|
renderMode: RenderModeType,
|
|
@@ -4198,14 +4686,17 @@ export abstract class IRtcEngine {
|
|
|
4198
4686
|
/**
|
|
4199
4687
|
* Updates the display mode of the video view of a remote user.
|
|
4200
4688
|
*
|
|
4201
|
-
* After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.
|
|
4689
|
+
* After initializing the video view of a remote user, you can call this method to update its rendering and mirror modes. This method affects only the video view that the local user sees.
|
|
4690
|
+
* Call this method after initializing the remote view by calling the setupRemoteVideo method.
|
|
4691
|
+
* During a call, you can call this method as many times as necessary to update the display mode of the video view of a remote user.
|
|
4202
4692
|
*
|
|
4203
4693
|
* @param uid The user ID of the remote user.
|
|
4204
4694
|
* @param renderMode The rendering mode of the remote user view.
|
|
4205
4695
|
* @param mirrorMode The mirror mode of the remote user view. See VideoMirrorModeType.
|
|
4206
4696
|
*
|
|
4207
4697
|
* @returns
|
|
4208
|
-
* 0: Success.
|
|
4698
|
+
* 0: Success.
|
|
4699
|
+
* < 0: Failure.
|
|
4209
4700
|
*/
|
|
4210
4701
|
abstract setRemoteRenderMode(
|
|
4211
4702
|
uid: number,
|
|
@@ -4221,20 +4712,27 @@ export abstract class IRtcEngine {
|
|
|
4221
4712
|
* @param mirrorMode The local video mirror mode. See VideoMirrorModeType.
|
|
4222
4713
|
*
|
|
4223
4714
|
* @returns
|
|
4224
|
-
* 0: Success.
|
|
4715
|
+
* 0: Success.
|
|
4716
|
+
* < 0: Failure.
|
|
4225
4717
|
*/
|
|
4226
4718
|
abstract setLocalVideoMirrorMode(mirrorMode: VideoMirrorModeType): number;
|
|
4227
4719
|
|
|
4228
4720
|
/**
|
|
4229
4721
|
* Enables or disables the dual-stream mode on the sender and sets the low-quality video stream.
|
|
4230
4722
|
*
|
|
4231
|
-
* Deprecated: This method is deprecated as of v4.2.0. Use setDualStreamMode instead. You can call this method to enable or disable the dual-stream mode on the publisher side. Dual streams are a pairing of a high-quality video stream and a low-quality video stream:
|
|
4723
|
+
* Deprecated: This method is deprecated as of v4.2.0. Use setDualStreamMode instead. You can call this method to enable or disable the dual-stream mode on the publisher side. Dual streams are a pairing of a high-quality video stream and a low-quality video stream:
|
|
4724
|
+
* High-quality video stream: High bitrate, high resolution.
|
|
4725
|
+
* Low-quality video stream: Low bitrate, low resolution. After you enable dual-stream mode, you can call setRemoteVideoStreamType to choose to receive either the high-quality video stream or the low-quality video stream on the subscriber side.
|
|
4726
|
+
* This method is applicable to all types of streams from the sender, including but not limited to video streams collected from cameras, screen sharing streams, and custom-collected video streams.
|
|
4727
|
+
* If you need to enable dual video streams in a multi-channel scenario, you can call the enableDualStreamModeEx method.
|
|
4728
|
+
* You can call this method either before or after joining a channel.
|
|
4232
4729
|
*
|
|
4233
|
-
* @param enabled Whether to enable dual-stream mode:true: Enable dual-stream mode.false: (Default) Disable dual-stream mode.
|
|
4730
|
+
* @param enabled Whether to enable dual-stream mode: true : Enable dual-stream mode. false : (Default) Disable dual-stream mode.
|
|
4234
4731
|
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.
|
|
4235
4732
|
*
|
|
4236
4733
|
* @returns
|
|
4237
|
-
* 0: Success.
|
|
4734
|
+
* 0: Success.
|
|
4735
|
+
* < 0: Failure.
|
|
4238
4736
|
*/
|
|
4239
4737
|
abstract enableDualStreamMode(
|
|
4240
4738
|
enabled: boolean,
|
|
@@ -4244,13 +4742,19 @@ export abstract class IRtcEngine {
|
|
|
4244
4742
|
/**
|
|
4245
4743
|
* Sets dual-stream mode configuration on the sender, and sets the low-quality video stream.
|
|
4246
4744
|
*
|
|
4247
|
-
* The
|
|
4745
|
+
* The SDK enables the low-quality video stream auto mode on the sender side by default (it does not actively sending low-quality video streams). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling setRemoteVideoStreamType. After receiving the application, the sending end automatically switches to the low-quality video stream mode.
|
|
4746
|
+
* If you want to modify this behavior, you can call this method and modify the mode to DisableSimulcastStream (never send low-quality video streams) or EnableSimulcastStream (always send low-quality video streams).
|
|
4747
|
+
* If you want to restore the default behavior after making changes, you can call this method again with mode set to AutoSimulcastStream. The difference and connection between this method and is as follows:
|
|
4748
|
+
* When calling this method and setting mode to DisableSimulcastStream, it has the same effect as calling and setting enabled to false.
|
|
4749
|
+
* When calling this method and setting mode to EnableSimulcastStream, it has the same effect as calling and setting enabled to true.
|
|
4750
|
+
* Both methods can be called before and after joining a channel. If both methods are used, the settings in the method called later takes precedence.
|
|
4248
4751
|
*
|
|
4249
4752
|
* @param mode The mode in which the video stream is sent. See SimulcastStreamMode.
|
|
4250
|
-
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
|
|
4753
|
+
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
|
|
4251
4754
|
*
|
|
4252
4755
|
* @returns
|
|
4253
|
-
* 0: Success.
|
|
4756
|
+
* 0: Success.
|
|
4757
|
+
* < 0: Failure.
|
|
4254
4758
|
*/
|
|
4255
4759
|
abstract setDualStreamMode(
|
|
4256
4760
|
mode: SimulcastStreamMode,
|
|
@@ -4268,15 +4772,20 @@ export abstract class IRtcEngine {
|
|
|
4268
4772
|
/**
|
|
4269
4773
|
* Sets the format of the captured raw audio data.
|
|
4270
4774
|
*
|
|
4271
|
-
* Sets the audio format for the onRecordAudioFrame callback.
|
|
4775
|
+
* Sets the audio format for the onRecordAudioFrame callback.
|
|
4776
|
+
* Ensure that you call this method before joining a channel.
|
|
4777
|
+
* The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method. Sample interval (sec) = samplePerCall /(sampleRate × channel). Ensure that the sample interval ≥ 0.01 (s).
|
|
4272
4778
|
*
|
|
4273
4779
|
* @param sampleRate The sample rate returned in the SDK, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
|
|
4274
|
-
* @param channel The number of channels returned by the SDK. You can set the value as 1 or 2:
|
|
4780
|
+
* @param channel The number of channels returned by the SDK. You can set the value as 1 or 2:
|
|
4781
|
+
* 1: Mono.
|
|
4782
|
+
* 2: Stereo.
|
|
4275
4783
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
4276
4784
|
* @param samplesPerCall The number of data samples returned in the SDK, such as 1024 for the Media Push.
|
|
4277
4785
|
*
|
|
4278
4786
|
* @returns
|
|
4279
|
-
* 0: Success.
|
|
4787
|
+
* 0: Success.
|
|
4788
|
+
* < 0: Failure.
|
|
4280
4789
|
*/
|
|
4281
4790
|
abstract setRecordingAudioFrameParameters(
|
|
4282
4791
|
sampleRate: number,
|
|
@@ -4288,15 +4797,20 @@ export abstract class IRtcEngine {
|
|
|
4288
4797
|
/**
|
|
4289
4798
|
* Sets the audio data format for playback.
|
|
4290
4799
|
*
|
|
4291
|
-
* Sets the data format for the onPlaybackAudioFrame callback.
|
|
4800
|
+
* Sets the data format for the onPlaybackAudioFrame callback.
|
|
4801
|
+
* Ensure that you call this method before joining a channel.
|
|
4802
|
+
* The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method. Sample interval (sec) = samplePerCall /(sampleRate × channel). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onPlaybackAudioFrame callback according to the sampling interval.
|
|
4292
4803
|
*
|
|
4293
4804
|
* @param sampleRate The sample rate returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
|
|
4294
|
-
* @param channel The number of channels returned in the onPlaybackAudioFrame callback:
|
|
4805
|
+
* @param channel The number of channels returned in the onPlaybackAudioFrame callback:
|
|
4806
|
+
* 1: Mono.
|
|
4807
|
+
* 2: Stereo.
|
|
4295
4808
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
4296
4809
|
* @param samplesPerCall The number of data samples returned in the onPlaybackAudioFrame callback, such as 1024 for the Media Push.
|
|
4297
4810
|
*
|
|
4298
4811
|
* @returns
|
|
4299
|
-
* 0: Success.
|
|
4812
|
+
* 0: Success.
|
|
4813
|
+
* < 0: Failure.
|
|
4300
4814
|
*/
|
|
4301
4815
|
abstract setPlaybackAudioFrameParameters(
|
|
4302
4816
|
sampleRate: number,
|
|
@@ -4313,7 +4827,8 @@ export abstract class IRtcEngine {
|
|
|
4313
4827
|
* @param samplesPerCall Sets the number of samples. In Media Push scenarios, set it as 1024.
|
|
4314
4828
|
*
|
|
4315
4829
|
* @returns
|
|
4316
|
-
* 0: Success.
|
|
4830
|
+
* 0: Success.
|
|
4831
|
+
* < 0: Failure.
|
|
4317
4832
|
*/
|
|
4318
4833
|
abstract setMixedAudioFrameParameters(
|
|
4319
4834
|
sampleRate: number,
|
|
@@ -4324,15 +4839,20 @@ export abstract class IRtcEngine {
|
|
|
4324
4839
|
/**
|
|
4325
4840
|
* Sets the format of the in-ear monitoring raw audio data.
|
|
4326
4841
|
*
|
|
4327
|
-
* This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
|
|
4842
|
+
* This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
|
|
4843
|
+
* Before calling this method, you need to call enableInEarMonitoring, and set includeAudioFilters to EarMonitoringFilterBuiltInAudioFilters or EarMonitoringFilterNoiseSuppression.
|
|
4844
|
+
* The SDK calculates the sampling interval based on the samplesPerCall, sampleRate and channel parameters set in this method. Sample interval (sec) = samplePerCall /(sampleRate × channel). Ensure that the sample interval ≥ 0.01 (s). The SDK triggers the onEarMonitoringAudioFrame callback according to the sampling interval.
|
|
4328
4845
|
*
|
|
4329
4846
|
* @param sampleRate The sample rate of the audio data reported in the onEarMonitoringAudioFrame callback, which can be set as 8,000, 16,000, 32,000, 44,100, or 48,000 Hz.
|
|
4330
|
-
* @param channel The number of audio channels reported in the onEarMonitoringAudioFrame callback.
|
|
4847
|
+
* @param channel The number of audio channels reported in the onEarMonitoringAudioFrame callback.
|
|
4848
|
+
* 1: Mono.
|
|
4849
|
+
* 2: Stereo.
|
|
4331
4850
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
4332
4851
|
* @param samplesPerCall The number of data samples reported in the onEarMonitoringAudioFrame callback, such as 1,024 for the Media Push.
|
|
4333
4852
|
*
|
|
4334
4853
|
* @returns
|
|
4335
|
-
* 0: Success.
|
|
4854
|
+
* 0: Success.
|
|
4855
|
+
* < 0: Failure.
|
|
4336
4856
|
*/
|
|
4337
4857
|
abstract setEarMonitoringAudioFrameParameters(
|
|
4338
4858
|
sampleRate: number,
|
|
@@ -4345,10 +4865,11 @@ export abstract class IRtcEngine {
|
|
|
4345
4865
|
* Sets the audio data format reported by onPlaybackAudioFrameBeforeMixing.
|
|
4346
4866
|
*
|
|
4347
4867
|
* @param sampleRate The sample rate (Hz) of the audio data, which can be set as 8000, 16000, 32000, 44100, or 48000.
|
|
4348
|
-
* @param channel The number of channels of the external audio source, which can be set as 1(Mono) or 2(Stereo).
|
|
4868
|
+
* @param channel The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
|
|
4349
4869
|
*
|
|
4350
4870
|
* @returns
|
|
4351
|
-
* 0: Success.
|
|
4871
|
+
* 0: Success.
|
|
4872
|
+
* < 0: Failure.
|
|
4352
4873
|
*/
|
|
4353
4874
|
abstract setPlaybackAudioFrameBeforeMixingParameters(
|
|
4354
4875
|
sampleRate: number,
|
|
@@ -4363,17 +4884,20 @@ export abstract class IRtcEngine {
|
|
|
4363
4884
|
* @param intervalInMS The interval (in milliseconds) at which the SDK triggers the onLocalAudioSpectrum and onRemoteAudioSpectrum callbacks. The default value is 100. Do not set this parameter to a value less than 10, otherwise calling this method would fail.
|
|
4364
4885
|
*
|
|
4365
4886
|
* @returns
|
|
4366
|
-
* 0: Success.
|
|
4887
|
+
* 0: Success.
|
|
4888
|
+
* < 0: Failure.
|
|
4889
|
+
* -2: Invalid parameters.
|
|
4367
4890
|
*/
|
|
4368
4891
|
abstract enableAudioSpectrumMonitor(intervalInMS?: number): number;
|
|
4369
4892
|
|
|
4370
4893
|
/**
|
|
4371
4894
|
* Disables audio spectrum monitoring.
|
|
4372
4895
|
*
|
|
4373
|
-
* After calling enableAudioSpectrumMonitor
|
|
4896
|
+
* After calling enableAudioSpectrumMonitor, if you want to disable audio spectrum monitoring, you can call this method. You can call this method either before or after joining a channel.
|
|
4374
4897
|
*
|
|
4375
4898
|
* @returns
|
|
4376
|
-
* 0: Success.
|
|
4899
|
+
* 0: Success.
|
|
4900
|
+
* < 0: Failure.
|
|
4377
4901
|
*/
|
|
4378
4902
|
abstract disableAudioSpectrumMonitor(): number;
|
|
4379
4903
|
|
|
@@ -4394,10 +4918,11 @@ export abstract class IRtcEngine {
|
|
|
4394
4918
|
/**
|
|
4395
4919
|
* Unregisters the audio spectrum observer.
|
|
4396
4920
|
*
|
|
4397
|
-
* After calling registerAudioSpectrumObserver
|
|
4921
|
+
* After calling registerAudioSpectrumObserver, if you want to disable audio spectrum monitoring, you can call this method. You can call this method either before or after joining a channel.
|
|
4398
4922
|
*
|
|
4399
4923
|
* @returns
|
|
4400
|
-
* 0: Success.
|
|
4924
|
+
* 0: Success.
|
|
4925
|
+
* < 0: Failure.
|
|
4401
4926
|
*/
|
|
4402
4927
|
abstract unregisterAudioSpectrumObserver(
|
|
4403
4928
|
observer: IAudioSpectrumObserver
|
|
@@ -4408,48 +4933,58 @@ export abstract class IRtcEngine {
|
|
|
4408
4933
|
*
|
|
4409
4934
|
* You can call this method either before or after joining a channel.
|
|
4410
4935
|
*
|
|
4411
|
-
* @param volume The volume of the user. The value range is [0,400].
|
|
4936
|
+
* @param volume The volume of the user. The value range is [0,400].
|
|
4937
|
+
* 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4938
|
+
* 100: (Default) The original volume.
|
|
4939
|
+
* 400: Four times the original volume (amplifying the audio signals by four times).
|
|
4412
4940
|
*
|
|
4413
4941
|
* @returns
|
|
4414
|
-
* 0: Success.
|
|
4942
|
+
* 0: Success.
|
|
4943
|
+
* < 0: Failure.
|
|
4415
4944
|
*/
|
|
4416
4945
|
abstract adjustRecordingSignalVolume(volume: number): number;
|
|
4417
4946
|
|
|
4418
4947
|
/**
|
|
4419
4948
|
* Whether to mute the recording signal.
|
|
4420
4949
|
*
|
|
4421
|
-
* @param mute true: The media file is muted.false: (Default) Do not mute the recording signal.If you have already called adjustRecordingSignalVolume to adjust the volume, then when you call this method and set it to true, the SDK will record the current volume and mute it. To restore the previous volume, call this method again and set it to false.
|
|
4950
|
+
* @param mute true : The media file is muted. false : (Default) Do not mute the recording signal. If you have already called adjustRecordingSignalVolume to adjust the volume, then when you call this method and set it to true, the SDK will record the current volume and mute it. To restore the previous volume, call this method again and set it to false.
|
|
4422
4951
|
*
|
|
4423
4952
|
* @returns
|
|
4424
|
-
* 0: Success.
|
|
4953
|
+
* 0: Success.
|
|
4954
|
+
* < 0: Failure.
|
|
4425
4955
|
*/
|
|
4426
4956
|
abstract muteRecordingSignal(mute: boolean): number;
|
|
4427
4957
|
|
|
4428
4958
|
/**
|
|
4429
4959
|
* Adjusts the playback signal volume of all remote users.
|
|
4430
4960
|
*
|
|
4431
|
-
* This method adjusts the playback volume that is the mixed volume of all remote users.
|
|
4961
|
+
* This method adjusts the playback volume that is the mixed volume of all remote users.
|
|
4962
|
+
* You can call this method either before or after joining a channel.
|
|
4432
4963
|
*
|
|
4433
4964
|
* @param volume The volume of the user. The value range is [0,400].
|
|
4434
|
-
* 0: Mute.If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4965
|
+
* 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4435
4966
|
* 100: (Default) The original volume.
|
|
4436
4967
|
* 400: Four times the original volume (amplifying the audio signals by four times).
|
|
4437
4968
|
*
|
|
4438
4969
|
* @returns
|
|
4439
|
-
* 0: Success.
|
|
4970
|
+
* 0: Success.
|
|
4971
|
+
* < 0: Failure.
|
|
4440
4972
|
*/
|
|
4441
4973
|
abstract adjustPlaybackSignalVolume(volume: number): number;
|
|
4442
4974
|
|
|
4443
4975
|
/**
|
|
4444
4976
|
* Adjusts the playback signal volume of a specified remote user.
|
|
4445
4977
|
*
|
|
4446
|
-
* You can call this method to adjust the playback volume of a specified remote user. To adjust the playback volume of different remote users, call the method as many times, once for each remote user.
|
|
4978
|
+
* You can call this method to adjust the playback volume of a specified remote user. To adjust the playback volume of different remote users, call the method as many times, once for each remote user.
|
|
4979
|
+
* Call this method after joining a channel.
|
|
4980
|
+
* The playback volume here refers to the mixed volume of a specified remote user.
|
|
4447
4981
|
*
|
|
4448
4982
|
* @param uid The user ID of the remote user.
|
|
4449
4983
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
4450
4984
|
*
|
|
4451
4985
|
* @returns
|
|
4452
|
-
* 0: Success.
|
|
4986
|
+
* 0: Success.
|
|
4987
|
+
* < 0: Failure.
|
|
4453
4988
|
*/
|
|
4454
4989
|
abstract adjustUserPlaybackSignalVolume(uid: number, volume: number): number;
|
|
4455
4990
|
|
|
@@ -4477,13 +5012,17 @@ export abstract class IRtcEngine {
|
|
|
4477
5012
|
/**
|
|
4478
5013
|
* Enables loopback audio capturing.
|
|
4479
5014
|
*
|
|
4480
|
-
* If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
|
|
5015
|
+
* If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
|
|
5016
|
+
* macOS does not support loopback audio capture of the default sound card. If you need to use this function, use a virtual sound card and pass its name to the deviceName parameter. Agora recommends using AgoraALD as the virtual sound card for audio capturing.
|
|
5017
|
+
* You can call this method either before or after joining a channel.
|
|
4481
5018
|
*
|
|
4482
|
-
* @param enabled Whether to enable loopback audio capturing.true: Enable loopback audio capturing.false: (Default) Disable loopback audio capturing.
|
|
4483
|
-
* @param deviceName macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing.
|
|
5019
|
+
* @param enabled Whether to enable loopback audio capturing. true : Enable loopback audio capturing. false : (Default) Disable loopback audio capturing.
|
|
5020
|
+
* @param deviceName macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing.
|
|
5021
|
+
* Windows: The device name of the sound card. The default is set to NULL, which means the SDK uses the sound card of your device for loopback audio capturing.
|
|
4484
5022
|
*
|
|
4485
5023
|
* @returns
|
|
4486
|
-
* 0: Success.
|
|
5024
|
+
* 0: Success.
|
|
5025
|
+
* < 0: Failure.
|
|
4487
5026
|
*/
|
|
4488
5027
|
abstract enableLoopbackRecording(
|
|
4489
5028
|
enabled: boolean,
|
|
@@ -4498,7 +5037,8 @@ export abstract class IRtcEngine {
|
|
|
4498
5037
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
4499
5038
|
*
|
|
4500
5039
|
* @returns
|
|
4501
|
-
* 0: Success.
|
|
5040
|
+
* 0: Success.
|
|
5041
|
+
* < 0: Failure.
|
|
4502
5042
|
*/
|
|
4503
5043
|
abstract adjustLoopbackSignalVolume(volume: number): number;
|
|
4504
5044
|
|
|
@@ -4510,13 +5050,17 @@ export abstract class IRtcEngine {
|
|
|
4510
5050
|
/**
|
|
4511
5051
|
* Enables in-ear monitoring.
|
|
4512
5052
|
*
|
|
4513
|
-
* This method enables or disables in-ear monitoring.
|
|
5053
|
+
* This method enables or disables in-ear monitoring.
|
|
5054
|
+
* Users must use earphones (wired or Bluetooth) to hear the in-ear monitoring effect.
|
|
5055
|
+
* You can call this method either before or after joining a channel.
|
|
4514
5056
|
*
|
|
4515
|
-
* @param enabled Enables or disables in-ear monitoring.true: Enables in-ear monitoring.false: (Default) Disables in-ear monitoring.
|
|
5057
|
+
* @param enabled Enables or disables in-ear monitoring. true : Enables in-ear monitoring. false : (Default) Disables in-ear monitoring.
|
|
4516
5058
|
* @param includeAudioFilters The audio filter of in-ear monitoring: See EarMonitoringFilterType.
|
|
4517
5059
|
*
|
|
4518
5060
|
* @returns
|
|
4519
|
-
* 0: Success.
|
|
5061
|
+
* 0: Success.
|
|
5062
|
+
* < 0: Failure.
|
|
5063
|
+
* - 8: Make sure the current audio routing is Bluetooth or headset.
|
|
4520
5064
|
*/
|
|
4521
5065
|
abstract enableInEarMonitoring(
|
|
4522
5066
|
enabled: boolean,
|
|
@@ -4526,7 +5070,8 @@ export abstract class IRtcEngine {
|
|
|
4526
5070
|
/**
|
|
4527
5071
|
* Sets the volume of the in-ear monitor.
|
|
4528
5072
|
*
|
|
4529
|
-
* Users must use wired earphones to hear their own voices.
|
|
5073
|
+
* Users must use wired earphones to hear their own voices.
|
|
5074
|
+
* You can call this method either before or after joining a channel.
|
|
4530
5075
|
*
|
|
4531
5076
|
* @param volume The volume of the in-ear monitor. The value ranges between 0 and 100. The default value is 100.
|
|
4532
5077
|
*
|
|
@@ -4541,10 +5086,11 @@ export abstract class IRtcEngine {
|
|
|
4541
5086
|
* This method applies to Windows only.
|
|
4542
5087
|
*
|
|
4543
5088
|
* @param path The extension library path and name. For example: /library/libagora_segmentation_extension.dll.
|
|
4544
|
-
* @param unloadAfterUse Whether to uninstall the current extension when you no longer using it:true: Uninstall the extension when the IRtcEngine is destroyed.false: (Rcommended) Do not uninstall the extension until the process terminates.
|
|
5089
|
+
* @param unloadAfterUse Whether to uninstall the current extension when you no longer using it: true : Uninstall the extension when the IRtcEngine is destroyed. false : (Rcommended) Do not uninstall the extension until the process terminates.
|
|
4545
5090
|
*
|
|
4546
5091
|
* @returns
|
|
4547
|
-
* 0: Success.
|
|
5092
|
+
* 0: Success.
|
|
5093
|
+
* < 0: Failure.
|
|
4548
5094
|
*/
|
|
4549
5095
|
abstract loadExtensionProvider(
|
|
4550
5096
|
path: string,
|
|
@@ -4554,14 +5100,15 @@ export abstract class IRtcEngine {
|
|
|
4554
5100
|
/**
|
|
4555
5101
|
* Sets the properties of the extension provider.
|
|
4556
5102
|
*
|
|
4557
|
-
* You can call this method to set the attributes of the extension provider and initialize the relevant parameters according to the type of the provider. Call this method after enableExtension
|
|
5103
|
+
* You can call this method to set the attributes of the extension provider and initialize the relevant parameters according to the type of the provider. Call this method after enableExtension, and before enabling the audio (enableAudio / enableLocalAudio) or the video (enableVideo / enableLocalVideo).
|
|
4558
5104
|
*
|
|
4559
5105
|
* @param provider The name of the extension provider.
|
|
4560
5106
|
* @param key The key of the extension.
|
|
4561
5107
|
* @param value The value of the extension key.
|
|
4562
5108
|
*
|
|
4563
5109
|
* @returns
|
|
4564
|
-
* 0: Success.
|
|
5110
|
+
* 0: Success.
|
|
5111
|
+
* < 0: Failure.
|
|
4565
5112
|
*/
|
|
4566
5113
|
abstract setExtensionProviderProperty(
|
|
4567
5114
|
provider: string,
|
|
@@ -4576,12 +5123,13 @@ export abstract class IRtcEngine {
|
|
|
4576
5123
|
*
|
|
4577
5124
|
* @param provider The name of the extension provider.
|
|
4578
5125
|
* @param extension The name of the extension.
|
|
4579
|
-
* @param type Type of media source. See MediaSourceType.In this method, this parameter supports only the following two settings:
|
|
5126
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
4580
5127
|
* The default value is UnknownMediaSource.
|
|
4581
5128
|
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
4582
5129
|
*
|
|
4583
5130
|
* @returns
|
|
4584
|
-
* 0: Success.
|
|
5131
|
+
* 0: Success.
|
|
5132
|
+
* < 0: Failure.
|
|
4585
5133
|
*/
|
|
4586
5134
|
abstract registerExtension(
|
|
4587
5135
|
provider: string,
|
|
@@ -4592,15 +5140,21 @@ export abstract class IRtcEngine {
|
|
|
4592
5140
|
/**
|
|
4593
5141
|
* Enables or disables extensions.
|
|
4594
5142
|
*
|
|
4595
|
-
* To call this method, call it immediately after initializing the IRtcEngine object.
|
|
5143
|
+
* To call this method, call it immediately after initializing the IRtcEngine object.
|
|
5144
|
+
* If you want to enable multiple extensions, you need to call this method multiple times.
|
|
5145
|
+
* The data processing order of different extensions in the SDK is determined by the order in which the extensions are enabled. That is, the extension that is enabled first will process the data first.
|
|
4596
5146
|
*
|
|
4597
5147
|
* @param provider The name of the extension provider.
|
|
4598
5148
|
* @param extension The name of the extension.
|
|
4599
|
-
* @param enable Whether to enable the extension:true: Enable the extension.false: Disable the extension.
|
|
4600
|
-
* @param type Type of media source. See MediaSourceType.In this method, this parameter supports only the following two settings:
|
|
5149
|
+
* @param enable Whether to enable the extension: true : Enable the extension. false : Disable the extension.
|
|
5150
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
5151
|
+
* The default value is UnknownMediaSource.
|
|
5152
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
4601
5153
|
*
|
|
4602
5154
|
* @returns
|
|
4603
|
-
* 0: Success.
|
|
5155
|
+
* 0: Success.
|
|
5156
|
+
* < 0: Failure.
|
|
5157
|
+
* -3: The extension library is not loaded. Agora recommends that you check the storage location or the name of the dynamic library.
|
|
4604
5158
|
*/
|
|
4605
5159
|
abstract enableExtension(
|
|
4606
5160
|
provider: string,
|
|
@@ -4618,10 +5172,13 @@ export abstract class IRtcEngine {
|
|
|
4618
5172
|
* @param extension The name of the extension.
|
|
4619
5173
|
* @param key The key of the extension.
|
|
4620
5174
|
* @param value The value of the extension key.
|
|
4621
|
-
* @param type
|
|
5175
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
5176
|
+
* The default value is UnknownMediaSource.
|
|
5177
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
4622
5178
|
*
|
|
4623
5179
|
* @returns
|
|
4624
|
-
* 0: Success.
|
|
5180
|
+
* 0: Success.
|
|
5181
|
+
* < 0: Failure.
|
|
4625
5182
|
*/
|
|
4626
5183
|
abstract setExtensionProperty(
|
|
4627
5184
|
provider: string,
|
|
@@ -4641,7 +5198,8 @@ export abstract class IRtcEngine {
|
|
|
4641
5198
|
* @param type Source type of the extension. See MediaSourceType.
|
|
4642
5199
|
*
|
|
4643
5200
|
* @returns
|
|
4644
|
-
* The extension information, if the method call succeeds.
|
|
5201
|
+
* The extension information, if the method call succeeds.
|
|
5202
|
+
* An empty string, if the method call fails.
|
|
4645
5203
|
*/
|
|
4646
5204
|
abstract getExtensionProperty(
|
|
4647
5205
|
provider: string,
|
|
@@ -4661,10 +5219,14 @@ export abstract class IRtcEngine {
|
|
|
4661
5219
|
/**
|
|
4662
5220
|
* Creates a customized video track.
|
|
4663
5221
|
*
|
|
4664
|
-
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
|
|
5222
|
+
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
|
|
5223
|
+
* Call this method to create a video track and get the video track ID.
|
|
5224
|
+
* In each channel's ChannelMediaOptions, set the customVideoTrackId parameter to the ID of the video track you want to publish, and set publishCustomVideoTrack to true.
|
|
5225
|
+
* If you call pushVideoFrame, and specify customVideoTrackId as the videoTrackId set in step 2, you can publish the corresponding custom video source in multiple channels.
|
|
4665
5226
|
*
|
|
4666
5227
|
* @returns
|
|
4667
|
-
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.
|
|
5228
|
+
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.
|
|
5229
|
+
* If the method call fails, a negative value is returned.
|
|
4668
5230
|
*/
|
|
4669
5231
|
abstract createCustomVideoTrack(): number;
|
|
4670
5232
|
|
|
@@ -4679,7 +5241,8 @@ export abstract class IRtcEngine {
|
|
|
4679
5241
|
* @param videoTrackId The video track ID returned by calling the createCustomVideoTrack method.
|
|
4680
5242
|
*
|
|
4681
5243
|
* @returns
|
|
4682
|
-
* 0: Success.
|
|
5244
|
+
* 0: Success.
|
|
5245
|
+
* < 0: Failure.
|
|
4683
5246
|
*/
|
|
4684
5247
|
abstract destroyCustomVideoTrack(videoTrackId: number): number;
|
|
4685
5248
|
|
|
@@ -4772,7 +5335,7 @@ export abstract class IRtcEngine {
|
|
|
4772
5335
|
/**
|
|
4773
5336
|
* @ignore
|
|
4774
5337
|
*/
|
|
4775
|
-
abstract setCameraExposureFactor(
|
|
5338
|
+
abstract setCameraExposureFactor(factor: number): number;
|
|
4776
5339
|
|
|
4777
5340
|
/**
|
|
4778
5341
|
* @ignore
|
|
@@ -4813,7 +5376,7 @@ export abstract class IRtcEngine {
|
|
|
4813
5376
|
*
|
|
4814
5377
|
* @param thumbSize The target size of the screen or window thumbnail (the width and height are in pixels). The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and thumbSize is 100 × 100, the actual size of the thumbnail is 100 × 75. If the target size is larger than the original size, the thumbnail is the original image and the SDK does not scale it.
|
|
4815
5378
|
* @param iconSize The target size of the icon corresponding to the application program (the width and height are in pixels). The SDK scales the original image to make the length of the longest side of the image the same as that of the target size without distorting the original image. For example, if the original image is 400 × 300 and iconSize is 100 × 100, the actual size of the icon is 100 × 75. If the target size is larger than the original size, the icon is the original image and the SDK does not scale it.
|
|
4816
|
-
* @param includeScreen Whether the SDK returns the screen information in addition to the window information:true: The SDK returns screen and window information.false: The SDK returns window information only.
|
|
5379
|
+
* @param includeScreen Whether the SDK returns the screen information in addition to the window information: true : The SDK returns screen and window information. false : The SDK returns window information only.
|
|
4817
5380
|
*
|
|
4818
5381
|
* @returns
|
|
4819
5382
|
* The ScreenCaptureSourceInfo array.
|
|
@@ -4834,14 +5397,19 @@ export abstract class IRtcEngine {
|
|
|
4834
5397
|
/**
|
|
4835
5398
|
* Captures the screen by specifying the display ID.
|
|
4836
5399
|
*
|
|
4837
|
-
* This method shares a screen or part of the screen. There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5400
|
+
* This method shares a screen or part of the screen. There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5401
|
+
* Call this method before joining a channel, and then call joinChannel to join a channel and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing.
|
|
5402
|
+
* Call this method after joining a channel, and then call updateChannelMediaOptions and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing.
|
|
4838
5403
|
*
|
|
4839
|
-
* @param displayId The display ID of the screen to be shared.For the Windows platform, if you need to simultaneously share two screens (main screen and secondary screen), you can set displayId to -1 when calling this method.
|
|
5404
|
+
* @param displayId The display ID of the screen to be shared. For the Windows platform, if you need to simultaneously share two screens (main screen and secondary screen), you can set displayId to -1 when calling this method.
|
|
4840
5405
|
* @param regionRect (Optional) Sets the relative location of the region to the screen. Pass in nil to share the entire screen.
|
|
4841
5406
|
* @param captureParams Screen sharing configurations. The default video dimension is 1920 x 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters.
|
|
4842
5407
|
*
|
|
4843
5408
|
* @returns
|
|
4844
|
-
* 0: Success.
|
|
5409
|
+
* 0: Success.
|
|
5410
|
+
* < 0: Failure.
|
|
5411
|
+
* -2: The parameter is invalid.
|
|
5412
|
+
* -8: The screen sharing state is invalid. Probably because you have shared other screens or windows. Try calling stopScreenCapture to stop the current sharing and start sharing the screen again.
|
|
4845
5413
|
*/
|
|
4846
5414
|
abstract startScreenCaptureByDisplayId(
|
|
4847
5415
|
displayId: number,
|
|
@@ -4852,14 +5420,19 @@ export abstract class IRtcEngine {
|
|
|
4852
5420
|
/**
|
|
4853
5421
|
* Captures the whole or part of a screen by specifying the screen rect.
|
|
4854
5422
|
*
|
|
4855
|
-
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5423
|
+
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5424
|
+
* Call this method before joining a channel, and then call joinChannel to join a channel and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing.
|
|
5425
|
+
* Call this method after joining a channel, and then call updateChannelMediaOptions and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing. Deprecated: This method is deprecated. Use startScreenCaptureByDisplayId instead. Agora strongly recommends using startScreenCaptureByDisplayId if you need to start screen sharing on a device connected to another display. This method shares a screen or part of the screen. You need to specify the area of the screen to be shared. This method applies to Windows only.
|
|
4856
5426
|
*
|
|
4857
5427
|
* @param screenRect Sets the relative location of the screen to the virtual screen.
|
|
4858
|
-
* @param regionRect Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen.
|
|
5428
|
+
* @param regionRect Sets the relative location of the region to the screen. If you do not set this parameter, the SDK shares the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen.
|
|
4859
5429
|
* @param captureParams The screen sharing encoding parameters. The default video resolution is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters.
|
|
4860
5430
|
*
|
|
4861
5431
|
* @returns
|
|
4862
|
-
* 0: Success.
|
|
5432
|
+
* 0: Success.
|
|
5433
|
+
* < 0: Failure.
|
|
5434
|
+
* -2: The parameter is invalid.
|
|
5435
|
+
* -8: The screen sharing state is invalid. Probably because you have shared other screens or windows. Try calling stopScreenCapture to stop the current sharing and start sharing the screen again.
|
|
4863
5436
|
*/
|
|
4864
5437
|
abstract startScreenCaptureByScreenRect(
|
|
4865
5438
|
screenRect: Rectangle,
|
|
@@ -4870,24 +5443,33 @@ export abstract class IRtcEngine {
|
|
|
4870
5443
|
/**
|
|
4871
5444
|
* Gets the audio device information.
|
|
4872
5445
|
*
|
|
4873
|
-
* After calling this method, you can get whether the audio device supports ultra-low-latency capture and playback.
|
|
5446
|
+
* After calling this method, you can get whether the audio device supports ultra-low-latency capture and playback.
|
|
5447
|
+
* You can call this method either before or after joining a channel.
|
|
4874
5448
|
*
|
|
4875
5449
|
* @returns
|
|
4876
|
-
* The DeviceInfo object that identifies the audio device information.
|
|
5450
|
+
* The DeviceInfo object that identifies the audio device information.
|
|
5451
|
+
* Not null: Success.
|
|
5452
|
+
* Null: Failure.
|
|
4877
5453
|
*/
|
|
4878
5454
|
abstract getAudioDeviceInfo(): DeviceInfo;
|
|
4879
5455
|
|
|
4880
5456
|
/**
|
|
4881
5457
|
* Captures the whole or part of a window by specifying the window ID.
|
|
4882
5458
|
*
|
|
4883
|
-
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5459
|
+
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5460
|
+
* Call this method before joining a channel, and then call joinChannel to join a channel and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing.
|
|
5461
|
+
* Call this method after joining a channel, and then call updateChannelMediaOptions and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing. This method captures a window or part of the window. You need to specify the ID of the window to be captured.
|
|
5462
|
+
* The window sharing feature of the Agora SDK relies on WGC (Windows Graphics Capture) or GDI (Graphics Device Interface) capture, and WGC cannot be set to disable mouse capture on systems earlier than Windows 10 2004. Therefore, captureMouseCursor(false) might not work when you start window sharing on a device with a system earlier than Windows 10 2004. See ScreenCaptureParameters. This method supports window sharing of UWP (Universal Windows Platform) applications. Agora tests the mainstream UWP applications by using the lastest SDK, see details as follows:
|
|
4884
5463
|
*
|
|
4885
5464
|
* @param windowId The ID of the window to be shared.
|
|
4886
5465
|
* @param regionRect (Optional) Sets the relative location of the region to the screen. If you do not set this parameter, the SDK shares the whole screen. See Rectangle. If the specified region overruns the window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole window.
|
|
4887
5466
|
* @param captureParams Screen sharing configurations. The default video resolution is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters.
|
|
4888
5467
|
*
|
|
4889
5468
|
* @returns
|
|
4890
|
-
* 0: Success.
|
|
5469
|
+
* 0: Success.
|
|
5470
|
+
* < 0: Failure.
|
|
5471
|
+
* -2: The parameter is invalid.
|
|
5472
|
+
* -8: The screen sharing state is invalid. Probably because you have shared other screens or windows. Try calling stopScreenCapture to stop the current sharing and start sharing the screen again.
|
|
4891
5473
|
*/
|
|
4892
5474
|
abstract startScreenCaptureByWindowId(
|
|
4893
5475
|
windowId: any,
|
|
@@ -4898,12 +5480,13 @@ export abstract class IRtcEngine {
|
|
|
4898
5480
|
/**
|
|
4899
5481
|
* Sets the content hint for screen sharing.
|
|
4900
5482
|
*
|
|
4901
|
-
* A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithms to different types of content. If you don't call this method, the default content hint is ContentHintNone
|
|
5483
|
+
* A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithms to different types of content. If you don't call this method, the default content hint is ContentHintNone. You can call this method either before or after you start screen sharing.
|
|
4902
5484
|
*
|
|
4903
5485
|
* @param contentHint The content hint for screen sharing. See VideoContentHint.
|
|
4904
5486
|
*
|
|
4905
5487
|
* @returns
|
|
4906
|
-
* 0: Success.
|
|
5488
|
+
* 0: Success.
|
|
5489
|
+
* < 0: Failure.
|
|
4907
5490
|
* -2: The parameter is invalid.
|
|
4908
5491
|
* -8: The screen sharing state is invalid. Probably because you have shared other screens or windows. Try calling stopScreenCapture to stop the current sharing and start sharing the screen again.
|
|
4909
5492
|
*/
|
|
@@ -4917,7 +5500,10 @@ export abstract class IRtcEngine {
|
|
|
4917
5500
|
* @param regionRect The relative location of the screen-share area to the screen or window. If you do not set this parameter, the SDK shares the whole screen or window. See Rectangle. If the specified region overruns the screen or window, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen or window.
|
|
4918
5501
|
*
|
|
4919
5502
|
* @returns
|
|
4920
|
-
* 0: Success.
|
|
5503
|
+
* 0: Success.
|
|
5504
|
+
* < 0: Failure.
|
|
5505
|
+
* -2: The parameter is invalid.
|
|
5506
|
+
* -8: The screen sharing state is invalid. Probably because you have shared other screens or windows. Try calling stopScreenCapture to stop the current sharing and start sharing the screen again.
|
|
4921
5507
|
*/
|
|
4922
5508
|
abstract updateScreenCaptureRegion(regionRect: Rectangle): number;
|
|
4923
5509
|
|
|
@@ -4926,10 +5512,11 @@ export abstract class IRtcEngine {
|
|
|
4926
5512
|
*
|
|
4927
5513
|
* Call this method after starting screen sharing or window sharing.
|
|
4928
5514
|
*
|
|
4929
|
-
* @param captureParams The screen sharing encoding parameters. The default video resolution is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters
|
|
5515
|
+
* @param captureParams The screen sharing encoding parameters. The default video resolution is 1920 × 1080, that is, 2,073,600 pixels. Agora uses the value of this parameter to calculate the charges. See ScreenCaptureParameters.
|
|
4930
5516
|
*
|
|
4931
5517
|
* @returns
|
|
4932
|
-
* 0: Success.
|
|
5518
|
+
* 0: Success.
|
|
5519
|
+
* < 0: Failure.
|
|
4933
5520
|
* -2: The parameter is invalid.
|
|
4934
5521
|
* -8: The screen sharing state is invalid. Probably because you have shared other screens or windows. Try calling stopScreenCapture to stop the current sharing and start sharing the screen again.
|
|
4935
5522
|
*/
|
|
@@ -4945,9 +5532,12 @@ export abstract class IRtcEngine {
|
|
|
4945
5532
|
/**
|
|
4946
5533
|
* Starts screen capture.
|
|
4947
5534
|
*
|
|
4948
|
-
* This method, as well as startScreenCaptureByDisplayId and startScreenCaptureByWindowId
|
|
5535
|
+
* This method, as well as startScreenCaptureByDisplayId and startScreenCaptureByWindowId, all have the capability to start screen capture, with the following differences: startScreenCaptureByDisplayId and startScreenCaptureByWindowId only support capturing video from a single screen or window. By calling this method and specifying the sourceType parameter, you can capture multiple video streams used for local video mixing or multi-channel publishing.
|
|
5536
|
+
* If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
|
|
4949
5537
|
*
|
|
4950
|
-
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5538
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5539
|
+
* Windows supports up to four screen capture video streams.
|
|
5540
|
+
* macOS supports only one screen capture video stream. You can only set this parameter to VideoSourceScreen (2).
|
|
4951
5541
|
* @param config The configuration of the captured screen. See ScreenCaptureConfiguration.
|
|
4952
5542
|
*/
|
|
4953
5543
|
abstract startScreenCaptureBySourceType(
|
|
@@ -4963,7 +5553,7 @@ export abstract class IRtcEngine {
|
|
|
4963
5553
|
/**
|
|
4964
5554
|
* @ignore
|
|
4965
5555
|
*/
|
|
4966
|
-
abstract queryScreenCaptureCapability():
|
|
5556
|
+
abstract queryScreenCaptureCapability(): number;
|
|
4967
5557
|
|
|
4968
5558
|
/**
|
|
4969
5559
|
* Sets the screen sharing scenario.
|
|
@@ -4973,7 +5563,8 @@ export abstract class IRtcEngine {
|
|
|
4973
5563
|
* @param screenScenario The screen sharing scenario. See ScreenScenarioType.
|
|
4974
5564
|
*
|
|
4975
5565
|
* @returns
|
|
4976
|
-
* 0: Success.
|
|
5566
|
+
* 0: Success.
|
|
5567
|
+
* < 0: Failure.
|
|
4977
5568
|
*/
|
|
4978
5569
|
abstract setScreenCaptureScenario(screenScenario: ScreenScenarioType): number;
|
|
4979
5570
|
|
|
@@ -4981,29 +5572,33 @@ export abstract class IRtcEngine {
|
|
|
4981
5572
|
* Stops screen capture.
|
|
4982
5573
|
*
|
|
4983
5574
|
* @returns
|
|
4984
|
-
* 0: Success.
|
|
5575
|
+
* 0: Success.
|
|
5576
|
+
* < 0: Failure.
|
|
4985
5577
|
*/
|
|
4986
5578
|
abstract stopScreenCapture(): number;
|
|
4987
5579
|
|
|
4988
5580
|
/**
|
|
4989
5581
|
* Stops screen capture.
|
|
4990
5582
|
*
|
|
4991
|
-
* After calling startScreenCaptureBySourceType to start capturing video from one or more screens, you can call this method and set the sourceType parameter to stop capturing from the specified screens.
|
|
5583
|
+
* After calling startScreenCaptureBySourceType to start capturing video from one or more screens, you can call this method and set the sourceType parameter to stop capturing from the specified screens.
|
|
5584
|
+
* If you call startScreenCaptureByWindowId or startScreenCaptureByDisplayId to start screen capture, Agora recommends that you call stopScreenCapture to stop the capture and do not use this one.
|
|
4992
5585
|
*
|
|
4993
5586
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4994
5587
|
*
|
|
4995
5588
|
* @returns
|
|
4996
|
-
* 0: Success.
|
|
5589
|
+
* 0: Success.
|
|
5590
|
+
* < 0: Failure.
|
|
4997
5591
|
*/
|
|
4998
5592
|
abstract stopScreenCaptureBySourceType(sourceType: VideoSourceType): number;
|
|
4999
5593
|
|
|
5000
5594
|
/**
|
|
5001
5595
|
* Retrieves the call ID.
|
|
5002
5596
|
*
|
|
5003
|
-
* When a user joins a channel on a client, a callId is generated to identify the call from the client. Some methods, such as rate and complain
|
|
5597
|
+
* When a user joins a channel on a client, a callId is generated to identify the call from the client. Some methods, such as rate and complain, must be called after the call ends to submit feedback to the SDK. These methods require the callId parameter. Call this method after joining a channel.
|
|
5004
5598
|
*
|
|
5005
5599
|
* @returns
|
|
5006
|
-
* The current call ID, if the method succeeds.
|
|
5600
|
+
* The current call ID, if the method succeeds.
|
|
5601
|
+
* An empty string, if the method call fails.
|
|
5007
5602
|
*/
|
|
5008
5603
|
abstract getCallId(): string;
|
|
5009
5604
|
|
|
@@ -5017,7 +5612,10 @@ export abstract class IRtcEngine {
|
|
|
5017
5612
|
* @param description A description of the call. The string length should be less than 800 bytes.
|
|
5018
5613
|
*
|
|
5019
5614
|
* @returns
|
|
5020
|
-
* 0: Success.
|
|
5615
|
+
* 0: Success.
|
|
5616
|
+
* < 0: Failure.
|
|
5617
|
+
* -2 (ERR_INVALID_ARGUMENT).
|
|
5618
|
+
* -3 (ERR_NOT_READY).
|
|
5021
5619
|
*/
|
|
5022
5620
|
abstract rate(callId: string, rating: number, description: string): number;
|
|
5023
5621
|
|
|
@@ -5030,32 +5628,54 @@ export abstract class IRtcEngine {
|
|
|
5030
5628
|
* @param description A description of the call. The string length should be less than 800 bytes.
|
|
5031
5629
|
*
|
|
5032
5630
|
* @returns
|
|
5033
|
-
* 0: Success.
|
|
5631
|
+
* 0: Success.
|
|
5632
|
+
* < 0: Failure.
|
|
5633
|
+
* -2: The parameter is invalid.
|
|
5634
|
+
* - 3: The SDK is not ready. Possible reasons include the following:
|
|
5635
|
+
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
|
|
5636
|
+
* No user has joined the channel when the method is called. Please check your code logic.
|
|
5637
|
+
* The user has not left the channel when the rate or complain method is called. Please check your code logic.
|
|
5638
|
+
* The audio module is disabled. The program is not complete.
|
|
5034
5639
|
*/
|
|
5035
5640
|
abstract complain(callId: string, description: string): number;
|
|
5036
5641
|
|
|
5037
5642
|
/**
|
|
5038
5643
|
* Starts pushing media streams to a CDN without transcoding.
|
|
5039
5644
|
*
|
|
5040
|
-
* Ensure that you enable the Media Push service before using this function. See Enable Media Push
|
|
5645
|
+
* Ensure that you enable the Media Push service before using this function. See Enable Media Push.
|
|
5646
|
+
* Call this method after joining a channel.
|
|
5647
|
+
* Only hosts in the LIVE_BROADCASTING profile can call this method.
|
|
5648
|
+
* If you want to retry pushing streams after a failed push, make sure to call stopRtmpStream first, then call this method to retry pushing streams; otherwise, the SDK returns the same error code as the last failed push. Agora recommends that you use the server-side Media Push function. You can call this method to push an audio or video stream to the specified CDN address. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
|
|
5041
5649
|
*
|
|
5042
5650
|
* @param url The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
|
|
5043
5651
|
*
|
|
5044
5652
|
* @returns
|
|
5045
|
-
* 0: Success.
|
|
5653
|
+
* 0: Success.
|
|
5654
|
+
* < 0: Failure.
|
|
5655
|
+
* -2: The URL is null or the string length is 0.
|
|
5656
|
+
* -7: The SDK is not initialized before calling this method.
|
|
5657
|
+
* -19: The Media Push URL is already in use, use another URL instead.
|
|
5046
5658
|
*/
|
|
5047
5659
|
abstract startRtmpStreamWithoutTranscoding(url: string): number;
|
|
5048
5660
|
|
|
5049
5661
|
/**
|
|
5050
5662
|
* Starts Media Push and sets the transcoding configuration.
|
|
5051
5663
|
*
|
|
5052
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
5664
|
+
* Agora recommends that you use the server-side Media Push function. You can call this method to push a live audio-and-video stream to the specified CDN address and set the transcoding configuration. This method can push media streams to only one CDN address at a time, so if you need to push streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
|
|
5665
|
+
* Ensure that you enable the Media Push service before using this function. See Enable Media Push.
|
|
5666
|
+
* Call this method after joining a channel.
|
|
5667
|
+
* Only hosts in the LIVE_BROADCASTING profile can call this method.
|
|
5668
|
+
* If you want to retry pushing streams after a failed push, make sure to call stopRtmpStream first, then call this method to retry pushing streams; otherwise, the SDK returns the same error code as the last failed push.
|
|
5053
5669
|
*
|
|
5054
5670
|
* @param url The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
|
|
5055
5671
|
* @param transcoding The transcoding configuration for Media Push. See LiveTranscoding.
|
|
5056
5672
|
*
|
|
5057
5673
|
* @returns
|
|
5058
|
-
* 0: Success.
|
|
5674
|
+
* 0: Success.
|
|
5675
|
+
* < 0: Failure.
|
|
5676
|
+
* -2: The URL is null or the string length is 0.
|
|
5677
|
+
* -7: The SDK is not initialized before calling this method.
|
|
5678
|
+
* -19: The Media Push URL is already in use, use another URL instead.
|
|
5059
5679
|
*/
|
|
5060
5680
|
abstract startRtmpStreamWithTranscoding(
|
|
5061
5681
|
url: string,
|
|
@@ -5065,36 +5685,47 @@ export abstract class IRtcEngine {
|
|
|
5065
5685
|
/**
|
|
5066
5686
|
* Updates the transcoding configuration.
|
|
5067
5687
|
*
|
|
5068
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
5688
|
+
* Agora recommends that you use the server-side Media Push function. After you start pushing media streams to CDN with transcoding, you can dynamically update the transcoding configuration according to the scenario. The SDK triggers the onTranscodingUpdated callback after the transcoding configuration is updated.
|
|
5069
5689
|
*
|
|
5070
5690
|
* @param transcoding The transcoding configuration for Media Push. See LiveTranscoding.
|
|
5071
5691
|
*
|
|
5072
5692
|
* @returns
|
|
5073
|
-
* 0: Success.
|
|
5693
|
+
* 0: Success.
|
|
5694
|
+
* < 0: Failure.
|
|
5074
5695
|
*/
|
|
5075
5696
|
abstract updateRtmpTranscoding(transcoding: LiveTranscoding): number;
|
|
5076
5697
|
|
|
5077
5698
|
/**
|
|
5078
5699
|
* Stops pushing media streams to a CDN.
|
|
5079
5700
|
*
|
|
5080
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
5701
|
+
* Agora recommends that you use the server-side Media Push function. You can call this method to stop the live stream on the specified CDN address. This method can stop pushing media streams to only one CDN address at a time, so if you need to stop pushing streams to multiple addresses, call this method multiple times. After you call this method, the SDK triggers the onRtmpStreamingStateChanged callback on the local client to report the state of the streaming.
|
|
5081
5702
|
*
|
|
5082
5703
|
* @param url The address of Media Push. The format is RTMP or RTMPS. The character length cannot exceed 1024 bytes. Special characters such as Chinese characters are not supported.
|
|
5083
5704
|
*
|
|
5084
5705
|
* @returns
|
|
5085
|
-
* 0: Success.
|
|
5706
|
+
* 0: Success.
|
|
5707
|
+
* < 0: Failure.
|
|
5086
5708
|
*/
|
|
5087
5709
|
abstract stopRtmpStream(url: string): number;
|
|
5088
5710
|
|
|
5089
5711
|
/**
|
|
5090
5712
|
* Starts the local video mixing.
|
|
5091
5713
|
*
|
|
5092
|
-
* After calling this method, you can merge multiple video streams into one video stream locally. For example, you can merge the video streams captured by the camera, screen sharing, media player, remote video, video files, images, etc. into one video stream, and then publish the mixed video stream to the channel.
|
|
5714
|
+
* After calling this method, you can merge multiple video streams into one video stream locally. For example, you can merge the video streams captured by the camera, screen sharing, media player, remote video, video files, images, etc. into one video stream, and then publish the mixed video stream to the channel.
|
|
5715
|
+
* Local video mixing requires more CPU resources. Therefore, Agora recommends enabling this function on devices with higher performance.
|
|
5716
|
+
* If you need to mix locally captured video streams, the SDK supports the following capture combinations:
|
|
5717
|
+
* On the Windows platform, it supports up to 4 video streams captured by cameras + 4 screen sharing streams.
|
|
5718
|
+
* On the macOS platform, it supports up to 4 video streams captured by cameras + 1 screen sharing stream.
|
|
5719
|
+
* If you need to mix the locally collected video streams, you need to call this method after startCameraCapture or startScreenCaptureBySourceType.
|
|
5720
|
+
* If you want to publish the mixed video stream to the channel, you need to set publishTranscodedVideoTrack in ChannelMediaOptions to true when calling joinChannel or updateChannelMediaOptions.
|
|
5093
5721
|
*
|
|
5094
|
-
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
5722
|
+
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
5723
|
+
* The maximum resolution of each video stream participating in the local video mixing is 4096 × 2160. If this limit is exceeded, video mixing does not take effect.
|
|
5724
|
+
* The maximum resolution of the mixed video stream is 4096 × 2160.
|
|
5095
5725
|
*
|
|
5096
5726
|
* @returns
|
|
5097
|
-
* 0: Success.
|
|
5727
|
+
* 0: Success.
|
|
5728
|
+
* < 0: Failure.
|
|
5098
5729
|
*/
|
|
5099
5730
|
abstract startLocalVideoTranscoder(
|
|
5100
5731
|
config: LocalTranscoderConfiguration
|
|
@@ -5103,12 +5734,13 @@ export abstract class IRtcEngine {
|
|
|
5103
5734
|
/**
|
|
5104
5735
|
* Updates the local video mixing configuration.
|
|
5105
5736
|
*
|
|
5106
|
-
* After calling startLocalVideoTranscoder
|
|
5737
|
+
* After calling startLocalVideoTranscoder, call this method if you want to update the local video mixing configuration. If you want to update the video source type used for local video mixing, such as adding a second camera or screen to capture video, you need to call this method after startCameraCapture or startScreenCaptureBySourceType.
|
|
5107
5738
|
*
|
|
5108
5739
|
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
5109
5740
|
*
|
|
5110
5741
|
* @returns
|
|
5111
|
-
* 0: Success.
|
|
5742
|
+
* 0: Success.
|
|
5743
|
+
* < 0: Failure.
|
|
5112
5744
|
*/
|
|
5113
5745
|
abstract updateLocalTranscoderConfiguration(
|
|
5114
5746
|
config: LocalTranscoderConfiguration
|
|
@@ -5117,16 +5749,17 @@ export abstract class IRtcEngine {
|
|
|
5117
5749
|
/**
|
|
5118
5750
|
* Stops the local video mixing.
|
|
5119
5751
|
*
|
|
5120
|
-
* After calling startLocalVideoTranscoder
|
|
5752
|
+
* After calling startLocalVideoTranscoder, call this method if you want to stop the local video mixing.
|
|
5121
5753
|
*/
|
|
5122
5754
|
abstract stopLocalVideoTranscoder(): number;
|
|
5123
5755
|
|
|
5124
5756
|
/**
|
|
5125
5757
|
* Starts camera capture.
|
|
5126
5758
|
*
|
|
5127
|
-
* You can call this method to start capturing video from one or more cameras by specifying sourceType
|
|
5759
|
+
* You can call this method to start capturing video from one or more cameras by specifying sourceType.
|
|
5128
5760
|
*
|
|
5129
|
-
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5761
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5762
|
+
* On the desktop platforms, you can capture video from up to 4 cameras.
|
|
5130
5763
|
* @param config The configuration of the video capture. See CameraCapturerConfiguration.
|
|
5131
5764
|
*/
|
|
5132
5765
|
abstract startCameraCapture(
|
|
@@ -5142,20 +5775,24 @@ export abstract class IRtcEngine {
|
|
|
5142
5775
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5143
5776
|
*
|
|
5144
5777
|
* @returns
|
|
5145
|
-
* 0: Success.
|
|
5778
|
+
* 0: Success.
|
|
5779
|
+
* < 0: Failure.
|
|
5146
5780
|
*/
|
|
5147
5781
|
abstract stopCameraCapture(sourceType: VideoSourceType): number;
|
|
5148
5782
|
|
|
5149
5783
|
/**
|
|
5150
5784
|
* Sets the rotation angle of the captured video.
|
|
5151
5785
|
*
|
|
5152
|
-
* This method applies to Windows only.
|
|
5786
|
+
* This method applies to Windows only.
|
|
5787
|
+
* You must call this method after enableVideo. The setting result will take effect after the camera is successfully turned on, that is, after the SDK triggers the onLocalVideoStateChanged callback and returns the local video state as LocalVideoStreamStateCapturing (1).
|
|
5788
|
+
* When the video capture device does not have the gravity sensing function, you can call this method to manually adjust the rotation angle of the captured video.
|
|
5153
5789
|
*
|
|
5154
5790
|
* @param type The video source type. See VideoSourceType.
|
|
5155
5791
|
* @param orientation The clockwise rotation angle. See VideoOrientation.
|
|
5156
5792
|
*
|
|
5157
5793
|
* @returns
|
|
5158
|
-
* 0: Success.
|
|
5794
|
+
* 0: Success.
|
|
5795
|
+
* < 0: Failure.
|
|
5159
5796
|
*/
|
|
5160
5797
|
abstract setCameraDeviceOrientation(
|
|
5161
5798
|
type: VideoSourceType,
|
|
@@ -5176,7 +5813,7 @@ export abstract class IRtcEngine {
|
|
|
5176
5813
|
* You can call this method either before or after joining a channel.
|
|
5177
5814
|
*
|
|
5178
5815
|
* @returns
|
|
5179
|
-
* The current connection state. See ConnectionStateType
|
|
5816
|
+
* The current connection state. See ConnectionStateType.
|
|
5180
5817
|
*/
|
|
5181
5818
|
abstract getConnectionState(): ConnectionStateType;
|
|
5182
5819
|
|
|
@@ -5218,24 +5855,35 @@ export abstract class IRtcEngine {
|
|
|
5218
5855
|
/**
|
|
5219
5856
|
* Sets the built-in encryption mode.
|
|
5220
5857
|
*
|
|
5221
|
-
* Deprecated: Use enableEncryption instead. The SDK supports built-in encryption schemes, AES-128-GCM is supported by default. Call this method to use other encryption modes. All users in the same channel must use the same encryption mode and secret
|
|
5858
|
+
* Deprecated: Use enableEncryption instead. The SDK supports built-in encryption schemes, AES-128-GCM is supported by default. Call this method to use other encryption modes. All users in the same channel must use the same encryption mode and secret. Refer to the information related to the AES encryption algorithm on the differences between the encryption modes. Before calling this method, please call setEncryptionSecret to enable the built-in encryption function.
|
|
5222
5859
|
*
|
|
5223
|
-
* @param encryptionMode The following encryption modes:
|
|
5860
|
+
* @param encryptionMode The following encryption modes:
|
|
5861
|
+
* " aes-128-xts ": 128-bit AES encryption, XTS mode.
|
|
5862
|
+
* " aes-128-ecb ": 128-bit AES encryption, ECB mode.
|
|
5863
|
+
* " aes-256-xts ": 256-bit AES encryption, XTS mode.
|
|
5864
|
+
* " sm4-128-ecb ": 128-bit SM4 encryption, ECB mode.
|
|
5865
|
+
* " aes-128-gcm ": 128-bit AES encryption, GCM mode.
|
|
5866
|
+
* " aes-256-gcm ": 256-bit AES encryption, GCM mode.
|
|
5867
|
+
* "": When this parameter is set as null, the encryption mode is set as " aes-128-gcm " by default.
|
|
5224
5868
|
*
|
|
5225
5869
|
* @returns
|
|
5226
|
-
* 0: Success.
|
|
5870
|
+
* 0: Success.
|
|
5871
|
+
* < 0: Failure.
|
|
5227
5872
|
*/
|
|
5228
5873
|
abstract setEncryptionMode(encryptionMode: string): number;
|
|
5229
5874
|
|
|
5230
5875
|
/**
|
|
5231
5876
|
* Enables built-in encryption with an encryption password before users join a channel.
|
|
5232
5877
|
*
|
|
5233
|
-
* Deprecated: Use enableEncryption instead. Before joining the channel, you need to call this method to set the secret parameter to enable the built-in encryption. All users in the same channel should use the same secret
|
|
5878
|
+
* Deprecated: Use enableEncryption instead. Before joining the channel, you need to call this method to set the secret parameter to enable the built-in encryption. All users in the same channel should use the same secret. The secret is automatically cleared once a user leaves the channel. If you do not specify the secret or secret is set as null, the built-in encryption is disabled.
|
|
5879
|
+
* Do not use this method for Media Push.
|
|
5880
|
+
* For optimal transmission, ensure that the encrypted data size does not exceed the original data size + 16 bytes. 16 bytes is the maximum padding size for AES encryption.
|
|
5234
5881
|
*
|
|
5235
5882
|
* @param secret The encryption password.
|
|
5236
5883
|
*
|
|
5237
5884
|
* @returns
|
|
5238
|
-
* 0: Success.
|
|
5885
|
+
* 0: Success.
|
|
5886
|
+
* < 0: Failure.
|
|
5239
5887
|
*/
|
|
5240
5888
|
abstract setEncryptionSecret(secret: string): number;
|
|
5241
5889
|
|
|
@@ -5244,11 +5892,15 @@ export abstract class IRtcEngine {
|
|
|
5244
5892
|
*
|
|
5245
5893
|
* In scenarios requiring high security, Agora recommends calling this method to enable the built-in encryption before joining a channel. All users in the same channel must use the same encryption mode and encryption key. After the user leaves the channel, the SDK automatically disables the built-in encryption. To enable the built-in encryption, call this method before the user joins the channel again. If you enable the built-in encryption, you cannot use the Media Push function.
|
|
5246
5894
|
*
|
|
5247
|
-
* @param enabled Whether to enable built-in encryption:true: Enable the built-in encryption.false: Disable the built-in encryption.
|
|
5895
|
+
* @param enabled Whether to enable built-in encryption: true : Enable the built-in encryption. false : Disable the built-in encryption.
|
|
5248
5896
|
* @param config Built-in encryption configurations. See EncryptionConfig.
|
|
5249
5897
|
*
|
|
5250
5898
|
* @returns
|
|
5251
|
-
* 0: Success.
|
|
5899
|
+
* 0: Success.
|
|
5900
|
+
* < 0: Failure.
|
|
5901
|
+
* -2: An invalid parameter is used. Set the parameter with a valid value.
|
|
5902
|
+
* -4: The built-in encryption mode is incorrect or the SDK fails to load the external encryption library. Check the enumeration or reload the external encryption library.
|
|
5903
|
+
* -7: The SDK is not initialized. Initialize the IRtcEngine instance before calling this method.
|
|
5252
5904
|
*/
|
|
5253
5905
|
abstract enableEncryption(enabled: boolean, config: EncryptionConfig): number;
|
|
5254
5906
|
|
|
@@ -5260,22 +5912,29 @@ export abstract class IRtcEngine {
|
|
|
5260
5912
|
* @param config The configurations for the data stream. See DataStreamConfig.
|
|
5261
5913
|
*
|
|
5262
5914
|
* @returns
|
|
5263
|
-
* ID of the created data stream, if the method call succeeds.
|
|
5915
|
+
* ID of the created data stream, if the method call succeeds.
|
|
5916
|
+
* < 0: Failure.
|
|
5264
5917
|
*/
|
|
5265
5918
|
abstract createDataStream(config: DataStreamConfig): number;
|
|
5266
5919
|
|
|
5267
5920
|
/**
|
|
5268
5921
|
* Sends data stream messages.
|
|
5269
5922
|
*
|
|
5270
|
-
* Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
|
|
5271
|
-
*
|
|
5923
|
+
* Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
|
|
5924
|
+
* Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 KB.
|
|
5925
|
+
* Each client can send up to 6 KB of data per second.
|
|
5926
|
+
* Each user can have up to five data streams simultaneously. A successful method call triggers the onStreamMessage callback on the remote client, from which the remote user gets the stream message.
|
|
5927
|
+
* A failed method call triggers the onStreamMessageError callback on the remote client.
|
|
5928
|
+
* Ensure that you call createDataStream to create a data channel before calling this method.
|
|
5929
|
+
* In live streaming scenarios, this method only applies to hosts.
|
|
5272
5930
|
*
|
|
5273
5931
|
* @param streamId The data stream ID. You can get the data stream ID by calling createDataStream.
|
|
5274
5932
|
* @param data The message to be sent.
|
|
5275
5933
|
* @param length The length of the data.
|
|
5276
5934
|
*
|
|
5277
5935
|
* @returns
|
|
5278
|
-
* 0: Success.
|
|
5936
|
+
* 0: Success.
|
|
5937
|
+
* < 0: Failure.
|
|
5279
5938
|
*/
|
|
5280
5939
|
abstract sendStreamMessage(
|
|
5281
5940
|
streamId: number,
|
|
@@ -5286,13 +5945,23 @@ export abstract class IRtcEngine {
|
|
|
5286
5945
|
/**
|
|
5287
5946
|
* Adds a watermark image to the local video.
|
|
5288
5947
|
*
|
|
5289
|
-
* This method adds a PNG watermark image to the local video in the live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. The Agora SDK supports adding only one watermark image onto a local video or CDN live stream. The newly added watermark image replaces the previous one. The watermark coordinates are dependent on the settings in the setVideoEncoderConfiguration method:
|
|
5948
|
+
* This method adds a PNG watermark image to the local video in the live streaming. Once the watermark image is added, all the audience in the channel (CDN audience included), and the capturing device can see and capture it. The Agora SDK supports adding only one watermark image onto a local video or CDN live stream. The newly added watermark image replaces the previous one. The watermark coordinates are dependent on the settings in the setVideoEncoderConfiguration method:
|
|
5949
|
+
* If the orientation mode of the encoding video (OrientationMode) is fixed landscape mode or the adaptive landscape mode, the watermark uses the landscape orientation.
|
|
5950
|
+
* If the orientation mode of the encoding video (OrientationMode) is fixed portrait mode or the adaptive portrait mode, the watermark uses the portrait orientation.
|
|
5951
|
+
* When setting the watermark position, the region must be less than the dimensions set in the setVideoEncoderConfiguration method; otherwise, the watermark image will be cropped.
|
|
5952
|
+
* Ensure that calling this method after enableVideo.
|
|
5953
|
+
* If you only want to add a watermark to the media push, you can call this method or the method.
|
|
5954
|
+
* This method supports adding a watermark image in the PNG file format only. Supported pixel formats of the PNG image are RGBA, RGB, Palette, Gray, and Alpha_gray.
|
|
5955
|
+
* If the dimensions of the PNG image differ from your settings in this method, the image will be cropped or zoomed to conform to your settings.
|
|
5956
|
+
* If you have enabled the local video preview by calling the startPreview method, you can use the visibleInPreview member to set whether or not the watermark is visible in the preview.
|
|
5957
|
+
* If you have enabled the mirror mode for the local video, the watermark on the local video is also mirrored. To avoid mirroring the watermark, Agora recommends that you do not use the mirror and watermark functions for the local video at the same time. You can implement the watermark function in your application layer.
|
|
5290
5958
|
*
|
|
5291
5959
|
* @param watermarkUrl The local file path of the watermark image to be added. This method supports adding a watermark image from the local absolute or relative file path.
|
|
5292
5960
|
* @param options The options of the watermark image to be added. See WatermarkOptions.
|
|
5293
5961
|
*
|
|
5294
5962
|
* @returns
|
|
5295
|
-
* 0: Success.
|
|
5963
|
+
* 0: Success.
|
|
5964
|
+
* < 0: Failure.
|
|
5296
5965
|
*/
|
|
5297
5966
|
abstract addVideoWatermark(
|
|
5298
5967
|
watermarkUrl: string,
|
|
@@ -5303,7 +5972,8 @@ export abstract class IRtcEngine {
|
|
|
5303
5972
|
* Removes the watermark image from the video stream.
|
|
5304
5973
|
*
|
|
5305
5974
|
* @returns
|
|
5306
|
-
* 0: Success.
|
|
5975
|
+
* 0: Success.
|
|
5976
|
+
* < 0: Failure.
|
|
5307
5977
|
*/
|
|
5308
5978
|
abstract clearVideoWatermarks(): number;
|
|
5309
5979
|
|
|
@@ -5322,10 +5992,11 @@ export abstract class IRtcEngine {
|
|
|
5322
5992
|
*
|
|
5323
5993
|
* Deprecated: The SDK automatically enables interoperability with the Web SDK, so you no longer need to call this method. You can call this method to enable or disable interoperability with the Agora Web SDK. If a channel has Web SDK users, ensure that you call this method, or the video of the Native user will be a black screen for the Web user. This method is only applicable in live streaming scenarios, and interoperability is enabled by default in communication scenarios.
|
|
5324
5994
|
*
|
|
5325
|
-
* @param enabled Whether to enable interoperability:true: Enable interoperability.false: (Default) Disable interoperability.
|
|
5995
|
+
* @param enabled Whether to enable interoperability: true : Enable interoperability. false : (Default) Disable interoperability.
|
|
5326
5996
|
*
|
|
5327
5997
|
* @returns
|
|
5328
|
-
* 0: Success.
|
|
5998
|
+
* 0: Success.
|
|
5999
|
+
* < 0: Failure.
|
|
5329
6000
|
*/
|
|
5330
6001
|
abstract enableWebSdkInteroperability(enabled: boolean): number;
|
|
5331
6002
|
|
|
@@ -5346,13 +6017,14 @@ export abstract class IRtcEngine {
|
|
|
5346
6017
|
* Registers the metadata observer.
|
|
5347
6018
|
*
|
|
5348
6019
|
* You need to implement the IMetadataObserver class and specify the metadata type in this method. This method enables you to add synchronized metadata in the video stream for more diversified
|
|
5349
|
-
* live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. Call this method before joinChannel
|
|
6020
|
+
* live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. Call this method before joinChannel.
|
|
5350
6021
|
*
|
|
5351
6022
|
* @param observer The metadata observer. See IMetadataObserver.
|
|
5352
6023
|
* @param type The metadata type. The SDK currently only supports VideoMetadata. See MetadataType.
|
|
5353
6024
|
*
|
|
5354
6025
|
* @returns
|
|
5355
|
-
* 0: Success.
|
|
6026
|
+
* 0: Success.
|
|
6027
|
+
* < 0: Failure.
|
|
5356
6028
|
*/
|
|
5357
6029
|
abstract registerMediaMetadataObserver(
|
|
5358
6030
|
observer: IMetadataObserver,
|
|
@@ -5366,7 +6038,8 @@ export abstract class IRtcEngine {
|
|
|
5366
6038
|
* @param type The metadata type. The SDK currently only supports VideoMetadata. See MetadataType.
|
|
5367
6039
|
*
|
|
5368
6040
|
* @returns
|
|
5369
|
-
* 0: Success.
|
|
6041
|
+
* 0: Success.
|
|
6042
|
+
* < 0: Failure.
|
|
5370
6043
|
*/
|
|
5371
6044
|
abstract unregisterMediaMetadataObserver(
|
|
5372
6045
|
observer: IMetadataObserver,
|
|
@@ -5398,41 +6071,79 @@ export abstract class IRtcEngine {
|
|
|
5398
6071
|
/**
|
|
5399
6072
|
* Sets whether to enable the AI noise suppression function and set the noise suppression mode.
|
|
5400
6073
|
*
|
|
5401
|
-
* You can call this method to enable AI noise suppression function. Once enabled, the SDK automatically detects and reduces stationary and non-stationary noise from your audio on the premise of ensuring the quality of human voice. Stationary noise refers to noise signal with constant average statistical properties and negligibly small fluctuations of level within the period of observation. Common sources of stationary noises are:
|
|
6074
|
+
* You can call this method to enable AI noise suppression function. Once enabled, the SDK automatically detects and reduces stationary and non-stationary noise from your audio on the premise of ensuring the quality of human voice. Stationary noise refers to noise signal with constant average statistical properties and negligibly small fluctuations of level within the period of observation. Common sources of stationary noises are:
|
|
6075
|
+
* Television;
|
|
6076
|
+
* Air conditioner;
|
|
6077
|
+
* Machinery, etc. Non-stationary noise refers to noise signal with huge fluctuations of level within the period of observation; common sources of non-stationary noises are:
|
|
6078
|
+
* Thunder;
|
|
6079
|
+
* Explosion;
|
|
6080
|
+
* Cracking, etc.
|
|
5402
6081
|
*
|
|
5403
|
-
* @param enabled Whether to enable the AI noise suppression function:true: Enable the AI noise suppression.false: (Default) Disable the AI noise suppression.
|
|
6082
|
+
* @param enabled Whether to enable the AI noise suppression function: true : Enable the AI noise suppression. false : (Default) Disable the AI noise suppression.
|
|
5404
6083
|
* @param mode The AI noise suppression modes. See AudioAinsMode.
|
|
5405
6084
|
*
|
|
5406
6085
|
* @returns
|
|
5407
|
-
* 0: Success.
|
|
6086
|
+
* 0: Success.
|
|
6087
|
+
* < 0: Failure.
|
|
5408
6088
|
*/
|
|
5409
6089
|
abstract setAINSMode(enabled: boolean, mode: AudioAinsMode): number;
|
|
5410
6090
|
|
|
5411
6091
|
/**
|
|
5412
6092
|
* Registers a user account.
|
|
5413
6093
|
*
|
|
5414
|
-
* Once registered, the user account can be used to identify the local user when the user joins the channel. After the registration is successful, the user account can identify the identity of the local user, and the user can use it to join the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and account of the local user. This method is optional. To join a channel with a user account, you can choose either of the following ways:
|
|
6094
|
+
* Once registered, the user account can be used to identify the local user when the user joins the channel. After the registration is successful, the user account can identify the identity of the local user, and the user can use it to join the channel. After the user successfully registers a user account, the SDK triggers the onLocalUserRegistered callback on the local client, reporting the user ID and account of the local user. This method is optional. To join a channel with a user account, you can choose either of the following ways:
|
|
6095
|
+
* Call registerLocalUserAccount to create a user account, and then call joinChannelWithUserAccount to join the channel.
|
|
6096
|
+
* Call the joinChannelWithUserAccount method to join the channel. The difference between the two ways is that the time elapsed between calling the registerLocalUserAccount method and joining the channel is shorter than directly calling joinChannelWithUserAccount.
|
|
6097
|
+
* Ensure that you set the userAccount parameter; otherwise, this method does not take effect.
|
|
6098
|
+
* Ensure that the userAccount is unique in the channel.
|
|
6099
|
+
* To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.
|
|
5415
6100
|
*
|
|
5416
6101
|
* @param appId The App ID of your project on Agora Console.
|
|
5417
|
-
* @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follow(89 in total):
|
|
6102
|
+
* @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are as follow(89 in total):
|
|
6103
|
+
* The 26 lowercase English letters: a to z.
|
|
6104
|
+
* The 26 uppercase English letters: A to Z.
|
|
6105
|
+
* All numeric characters: 0 to 9.
|
|
6106
|
+
* Space
|
|
6107
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5418
6108
|
*
|
|
5419
6109
|
* @returns
|
|
5420
|
-
* 0: Success.
|
|
6110
|
+
* 0: Success.
|
|
6111
|
+
* < 0: Failure.
|
|
5421
6112
|
*/
|
|
5422
6113
|
abstract registerLocalUserAccount(appId: string, userAccount: string): number;
|
|
5423
6114
|
|
|
5424
6115
|
/**
|
|
5425
6116
|
* Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
|
|
5426
6117
|
*
|
|
5427
|
-
* This method allows a user to join the channel with the user account. After the user successfully joins the channel, the SDK triggers the following callbacks:
|
|
6118
|
+
* This method allows a user to join the channel with the user account. After the user successfully joins the channel, the SDK triggers the following callbacks:
|
|
6119
|
+
* The local client: onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
6120
|
+
* The remote client: The onUserJoined callback, if the user is in the COMMUNICATION profile, and the onUserInfoUpdated callback if the user is a host in the LIVE_BROADCASTING profile. Once a user joins the channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. To stop subscribing to a specified stream or all remote streams, call the corresponding mute methods. To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.
|
|
5428
6121
|
*
|
|
5429
6122
|
* @param token The token generated on your server for authentication.
|
|
5430
|
-
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
5431
|
-
*
|
|
6123
|
+
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
6124
|
+
* All lowercase English letters: a to z.
|
|
6125
|
+
* All uppercase English letters: A to Z.
|
|
6126
|
+
* All numeric characters: 0 to 9.
|
|
6127
|
+
* Space
|
|
6128
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
6129
|
+
* @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are (89 in total):
|
|
6130
|
+
* The 26 lowercase English letters: a to z.
|
|
6131
|
+
* The 26 uppercase English letters: A to Z.
|
|
6132
|
+
* All numeric characters: 0 to 9.
|
|
6133
|
+
* Space
|
|
6134
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5432
6135
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
5433
6136
|
*
|
|
5434
6137
|
* @returns
|
|
5435
|
-
* 0: Success.
|
|
6138
|
+
* 0: Success.
|
|
6139
|
+
* < 0: Failure.
|
|
6140
|
+
* -2: The parameter is invalid. For example, the token is invalid, the uid parameter is not set to an integer, or the value of a member in ChannelMediaOptions is invalid. You need to pass in a valid parameter and join the channel again.
|
|
6141
|
+
* -3: Failes to initialize the IRtcEngine object. You need to reinitialize the IRtcEngine object.
|
|
6142
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
6143
|
+
* -8: The internal state of the IRtcEngine object is wrong. The typical cause is that you call this method to join the channel without calling startEchoTest to stop the test after calling stopEchoTest to start a call loop test. You need to call stopEchoTest before calling this method.
|
|
6144
|
+
* -17: The request to join the channel is rejected. The typical cause is that the user is in the channel. Agora recommends that you use the onConnectionStateChanged callback to determine whether the user exists in the channel. Do not call this method to join the channel unless you receive the ConnectionStateDisconnected (1) state.
|
|
6145
|
+
* -102: The channel name is invalid. You need to pass in a valid channelname in channelId to rejoin the channel.
|
|
6146
|
+
* -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel.
|
|
5436
6147
|
*/
|
|
5437
6148
|
abstract joinChannelWithUserAccount(
|
|
5438
6149
|
token: string,
|
|
@@ -5444,20 +6155,28 @@ export abstract class IRtcEngine {
|
|
|
5444
6155
|
/**
|
|
5445
6156
|
* Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
|
|
5446
6157
|
*
|
|
5447
|
-
* This method allows a user to join the channel with the user account. After the user successfully joins the channel, the SDK triggers the following callbacks:
|
|
6158
|
+
* This method allows a user to join the channel with the user account. After the user successfully joins the channel, the SDK triggers the following callbacks:
|
|
6159
|
+
* The local client: onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
6160
|
+
* The remote client: The onUserJoined callback, if the user is in the COMMUNICATION profile, and the onUserInfoUpdated callback if the user is a host in the LIVE_BROADCASTING profile. Once a user joins the channel, the user subscribes to the audio and video streams of all the other users in the channel by default, giving rise to usage and billing calculation. To stop subscribing to a specified stream or all remote streams, call the corresponding mute methods. To ensure smooth communication, use the same parameter type to identify the user. For example, if a user joins the channel with a user ID, then ensure all the other users use the user ID too. The same applies to the user account. If a user joins the channel with the Agora Web SDK, ensure that the ID of the user is set to the same parameter type.
|
|
5448
6161
|
*
|
|
5449
6162
|
* @param token The token generated on your server for authentication.
|
|
5450
|
-
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
6163
|
+
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
6164
|
+
* All lowercase English letters: a to z.
|
|
6165
|
+
* All uppercase English letters: A to Z.
|
|
6166
|
+
* All numeric characters: 0 to 9.
|
|
6167
|
+
* Space
|
|
6168
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5451
6169
|
* @param userAccount The user account. This parameter is used to identify the user in the channel for real-time audio and video engagement. You need to set and manage user accounts yourself and ensure that each user account in the same channel is unique. The maximum length of this parameter is 255 bytes. Ensure that you set this parameter and do not set it as NULL. Supported characters are (89 in total):
|
|
5452
6170
|
* The 26 lowercase English letters: a to z.
|
|
5453
6171
|
* The 26 uppercase English letters: A to Z.
|
|
5454
6172
|
* All numeric characters: 0 to 9.
|
|
5455
6173
|
* Space
|
|
5456
|
-
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=
|
|
6174
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5457
6175
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
5458
6176
|
*
|
|
5459
6177
|
* @returns
|
|
5460
|
-
* 0: Success.
|
|
6178
|
+
* 0: Success.
|
|
6179
|
+
* < 0: Failure.
|
|
5461
6180
|
*/
|
|
5462
6181
|
abstract joinChannelWithUserAccountEx(
|
|
5463
6182
|
token: string,
|
|
@@ -5474,7 +6193,8 @@ export abstract class IRtcEngine {
|
|
|
5474
6193
|
* @param userAccount The user account.
|
|
5475
6194
|
*
|
|
5476
6195
|
* @returns
|
|
5477
|
-
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6196
|
+
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6197
|
+
* If the call fails, returns NULL.
|
|
5478
6198
|
*/
|
|
5479
6199
|
abstract getUserInfoByUserAccount(userAccount: string): UserInfo;
|
|
5480
6200
|
|
|
@@ -5486,19 +6206,31 @@ export abstract class IRtcEngine {
|
|
|
5486
6206
|
* @param uid The user ID.
|
|
5487
6207
|
*
|
|
5488
6208
|
* @returns
|
|
5489
|
-
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6209
|
+
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6210
|
+
* If the call fails, returns NULL.
|
|
5490
6211
|
*/
|
|
5491
6212
|
abstract getUserInfoByUid(uid: number): UserInfo;
|
|
5492
6213
|
|
|
5493
6214
|
/**
|
|
5494
6215
|
* Starts relaying media streams across channels or updates channels for media relay.
|
|
5495
6216
|
*
|
|
5496
|
-
* The first successful call to this method starts relaying media streams from the source channel to the destination channels. To relay the media stream to other channels, or exit one of the current media relays, you can call this method again to update the destination channels. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback, and this callback returns the state of the media stream relay. Common states are as follows:
|
|
6217
|
+
* The first successful call to this method starts relaying media streams from the source channel to the destination channels. To relay the media stream to other channels, or exit one of the current media relays, you can call this method again to update the destination channels. This feature supports relaying media streams to a maximum of six destination channels. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback, and this callback returns the state of the media stream relay. Common states are as follows:
|
|
6218
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateRunning (2) and RelayOk (0), it means that the SDK starts relaying media streams from the source channel to the destination channel.
|
|
6219
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
|
|
6220
|
+
* Call this method after joining the channel.
|
|
6221
|
+
* This method takes effect only when you are a host in a live streaming channel.
|
|
6222
|
+
* The relaying media streams across channels function needs to be enabled by contacting.
|
|
6223
|
+
* Agora does not support string user accounts in this API.
|
|
5497
6224
|
*
|
|
5498
6225
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
5499
6226
|
*
|
|
5500
6227
|
* @returns
|
|
5501
|
-
* 0: Success.
|
|
6228
|
+
* 0: Success.
|
|
6229
|
+
* < 0: Failure.
|
|
6230
|
+
* -1: A general error occurs (no specified reason).
|
|
6231
|
+
* -2: The parameter is invalid.
|
|
6232
|
+
* -7: The method call was rejected. It may be because the SDK has not been initialized successfully, or the user role is not a host.
|
|
6233
|
+
* -8: Internal state error. Probably because the user is not a broadcaster.
|
|
5502
6234
|
*/
|
|
5503
6235
|
abstract startOrUpdateChannelMediaRelay(
|
|
5504
6236
|
configuration: ChannelMediaRelayConfiguration
|
|
@@ -5507,12 +6239,24 @@ export abstract class IRtcEngine {
|
|
|
5507
6239
|
/**
|
|
5508
6240
|
* Starts relaying media streams across channels. This method can be used to implement scenarios such as co-host across channels.
|
|
5509
6241
|
*
|
|
5510
|
-
* Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelay instead. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
|
|
6242
|
+
* Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelay instead. After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged and onChannelMediaRelayEvent callbacks, and these callbacks return the state and events of the media stream relay.
|
|
6243
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateRunning (2) and RelayOk (0), and the onChannelMediaRelayEvent callback returns RelayEventPacketSentToDestChannel (4), it means that the SDK starts relaying media streams between the source channel and the target channel.
|
|
6244
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
|
|
6245
|
+
* Call this method after joining the channel.
|
|
6246
|
+
* This method takes effect only when you are a host in a live streaming channel.
|
|
6247
|
+
* After a successful method call, if you want to call this method again, ensure that you call the stopChannelMediaRelay method to quit the current relay.
|
|
6248
|
+
* The relaying media streams across channels function needs to be enabled by contacting.
|
|
6249
|
+
* Agora does not support string user accounts in this API.
|
|
5511
6250
|
*
|
|
5512
6251
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
5513
6252
|
*
|
|
5514
6253
|
* @returns
|
|
5515
|
-
* 0: Success.
|
|
6254
|
+
* 0: Success.
|
|
6255
|
+
* < 0: Failure.
|
|
6256
|
+
* -1: A general error occurs (no specified reason).
|
|
6257
|
+
* -2: The parameter is invalid.
|
|
6258
|
+
* -7: The method call was rejected. It may be because the SDK has not been initialized successfully, or the user role is not a host.
|
|
6259
|
+
* -8: Internal state error. Probably because the user is not a broadcaster.
|
|
5516
6260
|
*/
|
|
5517
6261
|
abstract startChannelMediaRelay(
|
|
5518
6262
|
configuration: ChannelMediaRelayConfiguration
|
|
@@ -5521,12 +6265,13 @@ export abstract class IRtcEngine {
|
|
|
5521
6265
|
/**
|
|
5522
6266
|
* Updates the channels for media stream relay.
|
|
5523
6267
|
*
|
|
5524
|
-
* Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelay instead. After the media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call this method. After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RelayEventPacketUpdateDestChannel (7) state code. Call the method after successfully calling the startChannelMediaRelay method and receiving onChannelMediaRelayStateChanged (
|
|
6268
|
+
* Deprecated: This method is deprecated. Use startOrUpdateChannelMediaRelay instead. After the media relay starts, if you want to relay the media stream to more channels, or leave the current relay channel, you can call this method. After a successful method call, the SDK triggers the onChannelMediaRelayEvent callback with the RelayEventPacketUpdateDestChannel (7) state code. Call the method after successfully calling the startChannelMediaRelay method and receiving onChannelMediaRelayStateChanged (RelayStateRunning, RelayOk); otherwise, the method call fails.
|
|
5525
6269
|
*
|
|
5526
6270
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
5527
6271
|
*
|
|
5528
6272
|
* @returns
|
|
5529
|
-
* 0: Success.
|
|
6273
|
+
* 0: Success.
|
|
6274
|
+
* < 0: Failure.
|
|
5530
6275
|
*/
|
|
5531
6276
|
abstract updateChannelMediaRelay(
|
|
5532
6277
|
configuration: ChannelMediaRelayConfiguration
|
|
@@ -5538,27 +6283,30 @@ export abstract class IRtcEngine {
|
|
|
5538
6283
|
* After a successful method call, the SDK triggers the onChannelMediaRelayStateChanged callback. If the callback reports RelayStateIdle (0) and RelayOk (0), the host successfully stops the relay. If the method call fails, the SDK triggers the onChannelMediaRelayStateChanged callback with the RelayErrorServerNoResponse (2) or RelayErrorServerConnectionLost (8) status code. You can call the leaveChannel method to leave the channel, and the media stream relay automatically stops.
|
|
5539
6284
|
*
|
|
5540
6285
|
* @returns
|
|
5541
|
-
* 0: Success.
|
|
6286
|
+
* 0: Success.
|
|
6287
|
+
* < 0: Failure.
|
|
5542
6288
|
*/
|
|
5543
6289
|
abstract stopChannelMediaRelay(): number;
|
|
5544
6290
|
|
|
5545
6291
|
/**
|
|
5546
6292
|
* Pauses the media stream relay to all target channels.
|
|
5547
6293
|
*
|
|
5548
|
-
* After the cross-channel media stream relay starts, you can call this method to pause relaying media streams to all target channels; after the pause, if you want to resume the relay, call resumeAllChannelMediaRelay
|
|
6294
|
+
* After the cross-channel media stream relay starts, you can call this method to pause relaying media streams to all target channels; after the pause, if you want to resume the relay, call resumeAllChannelMediaRelay. Call this method after startOrUpdateChannelMediaRelay.
|
|
5549
6295
|
*
|
|
5550
6296
|
* @returns
|
|
5551
|
-
* 0: Success.
|
|
6297
|
+
* 0: Success.
|
|
6298
|
+
* < 0: Failure.
|
|
5552
6299
|
*/
|
|
5553
6300
|
abstract pauseAllChannelMediaRelay(): number;
|
|
5554
6301
|
|
|
5555
6302
|
/**
|
|
5556
6303
|
* Resumes the media stream relay to all target channels.
|
|
5557
6304
|
*
|
|
5558
|
-
* After calling the pauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels. Call this method after pauseAllChannelMediaRelay
|
|
6305
|
+
* After calling the pauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels. Call this method after pauseAllChannelMediaRelay.
|
|
5559
6306
|
*
|
|
5560
6307
|
* @returns
|
|
5561
|
-
* 0: Success.
|
|
6308
|
+
* 0: Success.
|
|
6309
|
+
* < 0: Failure.
|
|
5562
6310
|
*/
|
|
5563
6311
|
abstract resumeAllChannelMediaRelay(): number;
|
|
5564
6312
|
|
|
@@ -5579,10 +6327,11 @@ export abstract class IRtcEngine {
|
|
|
5579
6327
|
*
|
|
5580
6328
|
* This method only affects video streams captured by cameras or screens, or from custom video capture sources. That is, when you set publishCameraTrack or publishCustomVideoTrack in DirectCdnStreamingMediaOptions as true to capture videos, you can call this method to set the video profiles. If your local camera does not support the video resolution you set,the SDK automatically adjusts the video resolution to a value that is closest to your settings for capture, encoding or streaming, with the same aspect ratio as the resolution you set. You can get the actual resolution of the video streams through the onDirectCdnStreamingStats callback.
|
|
5581
6329
|
*
|
|
5582
|
-
* @param config Video profile. See VideoEncoderConfiguration.During CDN live streaming, Agora only supports setting OrientationMode as OrientationFixedLandscape or OrientationFixedPortrait.
|
|
6330
|
+
* @param config Video profile. See VideoEncoderConfiguration. During CDN live streaming, Agora only supports setting OrientationMode as OrientationFixedLandscape or OrientationFixedPortrait.
|
|
5583
6331
|
*
|
|
5584
6332
|
* @returns
|
|
5585
|
-
* 0: Success.
|
|
6333
|
+
* 0: Success.
|
|
6334
|
+
* < 0: Failure.
|
|
5586
6335
|
*/
|
|
5587
6336
|
abstract setDirectCdnStreamingVideoConfiguration(
|
|
5588
6337
|
config: VideoEncoderConfiguration
|
|
@@ -5591,14 +6340,15 @@ export abstract class IRtcEngine {
|
|
|
5591
6340
|
/**
|
|
5592
6341
|
* Starts pushing media streams to the CDN directly.
|
|
5593
6342
|
*
|
|
5594
|
-
* Aogra does not support pushing media streams to one URL repeatedly. Media options Agora does not support setting the value of publishCameraTrack and publishCustomVideoTrack as true
|
|
6343
|
+
* Aogra does not support pushing media streams to one URL repeatedly. Media options Agora does not support setting the value of publishCameraTrack and publishCustomVideoTrack as true, or the value of publishMicrophoneTrack and publishCustomAudioTrack as true at the same time. When choosing media setting options (DirectCdnStreamingMediaOptions), you can refer to the following examples: If you want to push audio and video streams published by the host to the CDN, the media setting options should be set as follows: publishCustomAudioTrack is set as true and call the pushAudioFrame method publishCustomVideoTrack is set as true and call the pushVideoFrame method publishCameraTrack is set as false (the default value) publishMicrophoneTrack is set as false (the default value) As of v4.2.0, Agora SDK supports audio-only live streaming. You can set publishCustomAudioTrack or publishMicrophoneTrack in DirectCdnStreamingMediaOptions as true and call pushAudioFrame to push audio streams. Agora only supports pushing one audio and video streams or one audio streams to CDN.
|
|
5595
6344
|
*
|
|
5596
6345
|
* @param eventHandler See onDirectCdnStreamingStateChanged and onDirectCdnStreamingStats.
|
|
5597
6346
|
* @param publishUrl The CDN live streaming URL.
|
|
5598
6347
|
* @param options The media setting options for the host. See DirectCdnStreamingMediaOptions.
|
|
5599
6348
|
*
|
|
5600
6349
|
* @returns
|
|
5601
|
-
* 0: Success.
|
|
6350
|
+
* 0: Success.
|
|
6351
|
+
* < 0: Failure.
|
|
5602
6352
|
*/
|
|
5603
6353
|
abstract startDirectCdnStreaming(
|
|
5604
6354
|
eventHandler: IDirectCdnStreamingEventHandler,
|
|
@@ -5610,7 +6360,8 @@ export abstract class IRtcEngine {
|
|
|
5610
6360
|
* Stops pushing media streams to the CDN directly.
|
|
5611
6361
|
*
|
|
5612
6362
|
* @returns
|
|
5613
|
-
* 0: Success.
|
|
6363
|
+
* 0: Success.
|
|
6364
|
+
* < 0: Failure.
|
|
5614
6365
|
*/
|
|
5615
6366
|
abstract stopDirectCdnStreaming(): number;
|
|
5616
6367
|
|
|
@@ -5643,26 +6394,34 @@ export abstract class IRtcEngine {
|
|
|
5643
6394
|
/**
|
|
5644
6395
|
* Takes a snapshot of a video stream.
|
|
5645
6396
|
*
|
|
5646
|
-
* This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
|
|
6397
|
+
* This method takes a snapshot of a video stream from the specified user, generates a JPG image, and saves it to the specified path. The method is asynchronous, and the SDK has not taken the snapshot when the method call returns. After a successful method call, the SDK triggers the onSnapshotTaken callback to report whether the snapshot is successfully taken, as well as the details for that snapshot.
|
|
6398
|
+
* Call this method after joining a channel.
|
|
6399
|
+
* When used for local video snapshots, this method takes a snapshot for the video streams specified in ChannelMediaOptions.
|
|
6400
|
+
* If the user's video has been preprocessed, for example, watermarked or beautified, the resulting snapshot includes the pre-processing effect.
|
|
5647
6401
|
*
|
|
5648
6402
|
* @param uid The user ID. Set uid as 0 if you want to take a snapshot of the local user's video.
|
|
5649
|
-
* @param filePath The local path (including filename extensions) of the snapshot. For example:
|
|
6403
|
+
* @param filePath The local path (including filename extensions) of the snapshot. For example:
|
|
6404
|
+
* Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
|
|
6405
|
+
* macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable.
|
|
5650
6406
|
*
|
|
5651
6407
|
* @returns
|
|
5652
|
-
* 0: Success.
|
|
6408
|
+
* 0: Success.
|
|
6409
|
+
* < 0: Failure.
|
|
5653
6410
|
*/
|
|
5654
6411
|
abstract takeSnapshot(uid: number, filePath: string): number;
|
|
5655
6412
|
|
|
5656
6413
|
/**
|
|
5657
6414
|
* Enables or disables video screenshot and upload.
|
|
5658
6415
|
*
|
|
5659
|
-
* When video screenshot and upload function is enabled, the SDK takes screenshots and upload videos sent by local users based on the type and frequency of the module you set in ContentInspectConfig
|
|
6416
|
+
* When video screenshot and upload function is enabled, the SDK takes screenshots and upload videos sent by local users based on the type and frequency of the module you set in ContentInspectConfig. After video screenshot and upload, the Agora server sends the callback notification to your app server in HTTPS requests and sends all screenshots to the third-party cloud storage service. Before calling this method, ensure that the video screenshot upload service has been activated. Before calling this method, ensure that Video content moderation service has been activated.
|
|
6417
|
+
* This method relies on the video screenshot and upload dynamic library libagora_content_inspect_extension.dll. If the dynamic library is deleted, the function cannot be enabled normally.
|
|
5660
6418
|
*
|
|
5661
|
-
* @param enabled Whether to enable video screenshot and
|
|
6419
|
+
* @param enabled Whether to enable video screenshot and upload : true : Enables video screenshot and upload. false : Disables video screenshot and upload.
|
|
5662
6420
|
* @param config Configuration of video screenshot and upload. See ContentInspectConfig.
|
|
5663
6421
|
*
|
|
5664
6422
|
* @returns
|
|
5665
|
-
* 0: Success.
|
|
6423
|
+
* 0: Success.
|
|
6424
|
+
* < 0: Failure.
|
|
5666
6425
|
*/
|
|
5667
6426
|
abstract enableContentInspect(
|
|
5668
6427
|
enabled: boolean,
|
|
@@ -5670,15 +6429,16 @@ export abstract class IRtcEngine {
|
|
|
5670
6429
|
): number;
|
|
5671
6430
|
|
|
5672
6431
|
/**
|
|
5673
|
-
* Adjusts the volume of the custom
|
|
6432
|
+
* Adjusts the volume of the custom audio track played remotely.
|
|
5674
6433
|
*
|
|
5675
|
-
* Ensure you have called the createCustomAudioTrack method to create
|
|
6434
|
+
* Ensure you have called the createCustomAudioTrack method to create a custom audio track before calling this method. If you want to change the volume of the audio to be published, you need to call this method again.
|
|
5676
6435
|
*
|
|
5677
6436
|
* @param trackId The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack.
|
|
5678
6437
|
* @param volume The volume of the audio source. The value can range from 0 to 100. 0 means mute; 100 means the original volume.
|
|
5679
6438
|
*
|
|
5680
6439
|
* @returns
|
|
5681
|
-
* 0: Success.
|
|
6440
|
+
* 0: Success.
|
|
6441
|
+
* < 0: Failure.
|
|
5682
6442
|
*/
|
|
5683
6443
|
abstract adjustCustomAudioPublishVolume(
|
|
5684
6444
|
trackId: number,
|
|
@@ -5696,12 +6456,18 @@ export abstract class IRtcEngine {
|
|
|
5696
6456
|
/**
|
|
5697
6457
|
* Sets up cloud proxy service.
|
|
5698
6458
|
*
|
|
5699
|
-
* When users' network access is restricted by a firewall, configure the firewall to allow specific IP addresses and ports provided by Agora; then, call this method to enable the cloud proxyType and set the cloud proxy type with the proxyType parameter. After successfully connecting to the cloud proxy, the SDK triggers the onConnectionStateChanged (
|
|
6459
|
+
* When users' network access is restricted by a firewall, configure the firewall to allow specific IP addresses and ports provided by Agora; then, call this method to enable the cloud proxyType and set the cloud proxy type with the proxyType parameter. After successfully connecting to the cloud proxy, the SDK triggers the onConnectionStateChanged (ConnectionStateConnecting, ConnectionChangedSettingProxyServer) callback. To disable the cloud proxy that has been set, call the setCloudProxy (NoneProxy). To change the cloud proxy type that has been set, call the setCloudProxy (NoneProxy) first, and then call the setCloudProxy to set the proxyType you want.
|
|
6460
|
+
* Agora recommends that you call this method after joining a channel.
|
|
6461
|
+
* When a user is behind a firewall and uses the Force UDP cloud proxy, the services for Media Push and cohosting across channels are not available.
|
|
6462
|
+
* When you use the Force TCP cloud proxy, note that an error would occur when calling the startAudioMixing method to play online music files in the HTTP protocol. The services for Media Push and cohosting across channels use the cloud proxy with the TCP protocol.
|
|
5700
6463
|
*
|
|
5701
|
-
* @param proxyType The type of the cloud proxy. See CloudProxyType.This parameter is mandatory. The SDK reports an error if you do not pass in a value.
|
|
6464
|
+
* @param proxyType The type of the cloud proxy. See CloudProxyType. This parameter is mandatory. The SDK reports an error if you do not pass in a value.
|
|
5702
6465
|
*
|
|
5703
6466
|
* @returns
|
|
5704
|
-
* 0: Success.
|
|
6467
|
+
* 0: Success.
|
|
6468
|
+
* < 0: Failure.
|
|
6469
|
+
* -2: The parameter is invalid.
|
|
6470
|
+
* -7: The SDK is not initialized.
|
|
5705
6471
|
*/
|
|
5706
6472
|
abstract setCloudProxy(proxyType: CloudProxyType): number;
|
|
5707
6473
|
|
|
@@ -5713,12 +6479,13 @@ export abstract class IRtcEngine {
|
|
|
5713
6479
|
/**
|
|
5714
6480
|
* Sets audio advanced options.
|
|
5715
6481
|
*
|
|
5716
|
-
* If you have advanced audio processing requirements, such as capturing and sending stereo audio, you can call this method to set advanced audio options. Call this method after calling joinChannel
|
|
6482
|
+
* If you have advanced audio processing requirements, such as capturing and sending stereo audio, you can call this method to set advanced audio options. Call this method after calling joinChannel, enableAudio and enableLocalAudio.
|
|
5717
6483
|
*
|
|
5718
6484
|
* @param options The advanced options for audio. See AdvancedAudioOptions.
|
|
5719
6485
|
*
|
|
5720
6486
|
* @returns
|
|
5721
|
-
* 0: Success.
|
|
6487
|
+
* 0: Success.
|
|
6488
|
+
* < 0: Failure.
|
|
5722
6489
|
*/
|
|
5723
6490
|
abstract setAdvancedAudioOptions(
|
|
5724
6491
|
options: AdvancedAudioOptions,
|
|
@@ -5735,11 +6502,12 @@ export abstract class IRtcEngine {
|
|
|
5735
6502
|
*
|
|
5736
6503
|
* Agora recommends that you call this method after joining a channel. When publishing video streams, you can call this method to replace the current video feeds with custom images. Once you enable this function, you can select images to replace the video feeds through the ImageTrackOptions parameter. If you disable this function, the remote users see the video feeds that you publish.
|
|
5737
6504
|
*
|
|
5738
|
-
* @param enable Whether to replace the current video feeds with custom images:true: Replace the current video feeds with custom images.false: (Default) Do not replace the current video feeds with custom images.
|
|
6505
|
+
* @param enable Whether to replace the current video feeds with custom images: true : Replace the current video feeds with custom images. false : (Default) Do not replace the current video feeds with custom images.
|
|
5739
6506
|
* @param options Image configurations. See ImageTrackOptions.
|
|
5740
6507
|
*
|
|
5741
6508
|
* @returns
|
|
5742
|
-
* 0: Success.
|
|
6509
|
+
* 0: Success.
|
|
6510
|
+
* < 0: Failure.
|
|
5743
6511
|
*/
|
|
5744
6512
|
abstract enableVideoImageSource(
|
|
5745
6513
|
enable: boolean,
|
|
@@ -5749,10 +6517,11 @@ export abstract class IRtcEngine {
|
|
|
5749
6517
|
/**
|
|
5750
6518
|
* Gets the current Monotonic Time of the SDK.
|
|
5751
6519
|
*
|
|
5752
|
-
* Monotonic Time refers to a monotonically increasing time series whose value increases over time. The unit is milliseconds. In custom video capture and custom audio capture scenarios, in order to ensure audio and video synchronization, Agora recommends that you call this method to obtain the current Monotonic Time of the SDK, and then pass this value into the timestamp parameter in the captured video frame (
|
|
6520
|
+
* Monotonic Time refers to a monotonically increasing time series whose value increases over time. The unit is milliseconds. In custom video capture and custom audio capture scenarios, in order to ensure audio and video synchronization, Agora recommends that you call this method to obtain the current Monotonic Time of the SDK, and then pass this value into the timestamp parameter in the captured video frame (VideoFrame) and audio frame (AudioFrame).
|
|
5753
6521
|
*
|
|
5754
6522
|
* @returns
|
|
5755
|
-
* ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
|
|
6523
|
+
* ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
|
|
6524
|
+
* < 0: Failure.
|
|
5756
6525
|
*/
|
|
5757
6526
|
abstract getCurrentMonotonicTimeInMs(): number;
|
|
5758
6527
|
|
|
@@ -5767,9 +6536,18 @@ export abstract class IRtcEngine {
|
|
|
5767
6536
|
* You can use this method to get the type of network in use at any stage. You can call this method either before or after joining a channel.
|
|
5768
6537
|
*
|
|
5769
6538
|
* @returns
|
|
5770
|
-
* ≥ 0: The method call is successful, and the local network connection type is returned.
|
|
6539
|
+
* ≥ 0: The method call is successful, and the local network connection type is returned.
|
|
6540
|
+
* 0: The SDK disconnects from the network.
|
|
6541
|
+
* 1: The network type is LAN.
|
|
6542
|
+
* 2: The network type is Wi-Fi (including hotspots).
|
|
6543
|
+
* 3: The network type is mobile 2G.
|
|
6544
|
+
* 4: The network type is mobile 3G.
|
|
6545
|
+
* 5: The network type is mobile 4G.
|
|
6546
|
+
* 6: The network type is mobile 5G.
|
|
6547
|
+
* < 0: The method call failed with an error code.
|
|
6548
|
+
* -1: The network type is unknown.
|
|
5771
6549
|
*/
|
|
5772
|
-
abstract getNetworkType():
|
|
6550
|
+
abstract getNetworkType(): number;
|
|
5773
6551
|
|
|
5774
6552
|
/**
|
|
5775
6553
|
* Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
|
|
@@ -5777,27 +6555,36 @@ export abstract class IRtcEngine {
|
|
|
5777
6555
|
* @param parameters Pointer to the set parameters in a JSON string.
|
|
5778
6556
|
*
|
|
5779
6557
|
* @returns
|
|
5780
|
-
* 0: Success.
|
|
6558
|
+
* 0: Success.
|
|
6559
|
+
* < 0: Failure.
|
|
5781
6560
|
*/
|
|
5782
6561
|
abstract setParameters(parameters: string): number;
|
|
5783
6562
|
|
|
5784
6563
|
/**
|
|
5785
6564
|
* Enables tracing the video frame rendering process.
|
|
5786
6565
|
*
|
|
5787
|
-
* The SDK starts tracing the rendering status of the video frames in the channel from the moment this method is successfully called and reports information about the event through the onVideoRenderingTracingResult callback.
|
|
6566
|
+
* The SDK starts tracing the rendering status of the video frames in the channel from the moment this method is successfully called and reports information about the event through the onVideoRenderingTracingResult callback.
|
|
6567
|
+
* By default, the SDK starts tracing the video rendering event automatically when the local user successfully joins the channel. You can call this method at an appropriate time according to the actual application scenario to customize the tracing process.
|
|
6568
|
+
* After the local user leaves the current channel, the SDK automatically resets the time point to the next time when the user successfully joins the channel.
|
|
5788
6569
|
*
|
|
5789
6570
|
* @returns
|
|
5790
|
-
* 0: Success.
|
|
6571
|
+
* 0: Success.
|
|
6572
|
+
* < 0: Failure.
|
|
6573
|
+
* -7: The method is called before IRtcEngine is initialized.
|
|
5791
6574
|
*/
|
|
5792
6575
|
abstract startMediaRenderingTracing(): number;
|
|
5793
6576
|
|
|
5794
6577
|
/**
|
|
5795
6578
|
* Enables audio and video frame instant rendering.
|
|
5796
6579
|
*
|
|
5797
|
-
* After successfully calling this method, the SDK enables the instant frame rendering mode, which can speed up the first frame rendering speed after the user joins the channel.
|
|
6580
|
+
* After successfully calling this method, the SDK enables the instant frame rendering mode, which can speed up the first frame rendering speed after the user joins the channel.
|
|
6581
|
+
* Once the instant rendering function is enabled, it can only be canceled by calling the release method to destroy the IRtcEngine object.
|
|
6582
|
+
* In this mode, the SDK uses Agora's custom encryption algorithm to shorten the time required to establish transmission links, and the security is reduced compared to the standard DTLS (Datagram Transport Layer Security). If the application scenario requires higher security standards, Agora recommends that you do not use this method.
|
|
5798
6583
|
*
|
|
5799
6584
|
* @returns
|
|
5800
|
-
* 0: Success.
|
|
6585
|
+
* 0: Success.
|
|
6586
|
+
* < 0: Failure.
|
|
6587
|
+
* -7: The method is called before IRtcEngine is initialized.
|
|
5801
6588
|
*/
|
|
5802
6589
|
abstract enableInstantMediaRendering(): number;
|
|
5803
6590
|
|
|
@@ -5864,7 +6651,8 @@ export abstract class IRtcEngine {
|
|
|
5864
6651
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5865
6652
|
*
|
|
5866
6653
|
* @returns
|
|
5867
|
-
* 0: Success.
|
|
6654
|
+
* 0: Success.
|
|
6655
|
+
* < 0: Failure.
|
|
5868
6656
|
*/
|
|
5869
6657
|
abstract sendMetaData(
|
|
5870
6658
|
metadata: Metadata,
|
|
@@ -5874,12 +6662,13 @@ export abstract class IRtcEngine {
|
|
|
5874
6662
|
/**
|
|
5875
6663
|
* Sets the maximum size of the media metadata.
|
|
5876
6664
|
*
|
|
5877
|
-
* After calling registerMediaMetadataObserver
|
|
6665
|
+
* After calling registerMediaMetadataObserver, you can call this method to set the maximum size of the media metadata.
|
|
5878
6666
|
*
|
|
5879
6667
|
* @param size The maximum size of media metadata.
|
|
5880
6668
|
*
|
|
5881
6669
|
* @returns
|
|
5882
|
-
* 0: Success.
|
|
6670
|
+
* 0: Success.
|
|
6671
|
+
* < 0: Failure.
|
|
5883
6672
|
*/
|
|
5884
6673
|
abstract setMaxMetadataSize(size: number): number;
|
|
5885
6674
|
|
|
@@ -5894,7 +6683,12 @@ export abstract class IRtcEngine {
|
|
|
5894
6683
|
* Destroys multiple video renderer objects at one time.
|
|
5895
6684
|
*
|
|
5896
6685
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5897
|
-
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
6686
|
+
* @param channelId The channel name. This parameter signifies the channel in which users engage in real-time audio and video interaction. Under the premise of the same App ID, users who fill in the same channel ID enter the same channel for audio and video interaction. The string length must be less than 64 bytes. Supported characters:
|
|
6687
|
+
* All lowercase English letters: a to z.
|
|
6688
|
+
* All uppercase English letters: A to Z.
|
|
6689
|
+
* All numeric characters: 0 to 9.
|
|
6690
|
+
* Space
|
|
6691
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5898
6692
|
* @param uid The user ID of the remote user.
|
|
5899
6693
|
*/
|
|
5900
6694
|
abstract destroyRendererByConfig(
|
|
@@ -5909,7 +6703,8 @@ export abstract class IRtcEngine {
|
|
|
5909
6703
|
* @param observer The encoded audio observer. See IAudioEncodedFrameObserver.
|
|
5910
6704
|
*
|
|
5911
6705
|
* @returns
|
|
5912
|
-
* 0: Success.
|
|
6706
|
+
* 0: Success.
|
|
6707
|
+
* < 0: Failure.
|
|
5913
6708
|
*/
|
|
5914
6709
|
abstract unregisterAudioEncodedFrameObserver(
|
|
5915
6710
|
observer: IAudioEncodedFrameObserver
|
|
@@ -6027,15 +6822,15 @@ export enum VideoProfileType {
|
|
|
6027
6822
|
*/
|
|
6028
6823
|
VideoProfileLandscape360p8 = 37,
|
|
6029
6824
|
/**
|
|
6030
|
-
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6825
|
+
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6031
6826
|
*/
|
|
6032
6827
|
VideoProfileLandscape360p9 = 38,
|
|
6033
6828
|
/**
|
|
6034
|
-
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6829
|
+
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6035
6830
|
*/
|
|
6036
6831
|
VideoProfileLandscape360p10 = 39,
|
|
6037
6832
|
/**
|
|
6038
|
-
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
6833
|
+
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
6039
6834
|
*/
|
|
6040
6835
|
VideoProfileLandscape360p11 = 100,
|
|
6041
6836
|
/**
|
|
@@ -6167,15 +6962,15 @@ export enum VideoProfileType {
|
|
|
6167
6962
|
*/
|
|
6168
6963
|
VideoProfilePortrait360p8 = 1037,
|
|
6169
6964
|
/**
|
|
6170
|
-
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6965
|
+
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6171
6966
|
*/
|
|
6172
6967
|
VideoProfilePortrait360p9 = 1038,
|
|
6173
6968
|
/**
|
|
6174
|
-
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6969
|
+
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6175
6970
|
*/
|
|
6176
6971
|
VideoProfilePortrait360p10 = 1039,
|
|
6177
6972
|
/**
|
|
6178
|
-
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
6973
|
+
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
6179
6974
|
*/
|
|
6180
6975
|
VideoProfilePortrait360p11 = 1100,
|
|
6181
6976
|
/**
|