agora-electron-sdk 4.2.2-dev.4 → 4.2.2-dev.6
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 +121 -51
- package/js/Private/AgoraMediaBase.js +9 -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/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 +278 -131
- package/ts/Private/AgoraMediaBase.ts +52 -34
- package/ts/Private/AgoraMediaPlayerTypes.ts +8 -5
- package/ts/Private/IAgoraLog.ts +7 -3
- package/ts/Private/IAgoraMediaEngine.ts +73 -31
- package/ts/Private/IAgoraMediaPlayer.ts +126 -64
- package/ts/Private/IAgoraMediaPlayerSource.ts +3 -1
- package/ts/Private/IAgoraRtcEngine.ts +1307 -519
- package/ts/Private/IAgoraRtcEngineEx.ts +227 -94
- package/ts/Private/IAgoraSpatialAudio.ts +70 -35
- 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/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 +278 -131
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +52 -34
- 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 +73 -31
- 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 +1308 -519
- 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 +70 -35
- 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/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
|
/**
|
|
@@ -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, publishAudioTrack, 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. See
|
|
1157
|
+
* (Optional) The token generated on your server for authentication. See
|
|
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.
|
|
@@ -1574,7 +1594,11 @@ export interface IRtcEngineEventHandler {
|
|
|
1574
1594
|
/**
|
|
1575
1595
|
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves 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 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,
|
|
@@ -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 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 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 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 to enable multi-camera capture:
|
|
3138
|
+
* If it is enabled before, the local video preview shows the image captured by the two cameras at the same time.
|
|
3139
|
+
* If it is enabled after, 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,17 @@ 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.
|
|
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
3265
|
* @param type The type of the video source, see MediaSourceType.
|
|
3039
3266
|
*
|
|
3040
3267
|
* @returns
|
|
3041
|
-
* 0: Success.
|
|
3268
|
+
* 0: Success.
|
|
3269
|
+
* < 0: Failure.
|
|
3042
3270
|
*/
|
|
3043
3271
|
abstract setBeautyEffectOptions(
|
|
3044
3272
|
enabled: boolean,
|
|
@@ -3049,14 +3277,21 @@ export abstract class IRtcEngine {
|
|
|
3049
3277
|
/**
|
|
3050
3278
|
* Sets low-light enhancement.
|
|
3051
3279
|
*
|
|
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.
|
|
3280
|
+
* 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.
|
|
3281
|
+
* Call this method after calling enableVideo.
|
|
3282
|
+
* 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.
|
|
3283
|
+
* Both this method and setExtensionProperty can turn on low-light enhancement:
|
|
3284
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
3285
|
+
* 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.
|
|
3286
|
+
* 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
3287
|
*
|
|
3054
|
-
* @param enabled Whether to enable low-light enhancement function:true: Enable low-light enhancement function.false: (Default) Disable low-light enhancement function.
|
|
3288
|
+
* @param enabled Whether to enable low-light enhancement function: true : Enable low-light enhancement function. false : (Default) Disable low-light enhancement function.
|
|
3055
3289
|
* @param options The low-light enhancement options. See LowlightEnhanceOptions.
|
|
3056
3290
|
* @param type The type of the video source. See MediaSourceType.
|
|
3057
3291
|
*
|
|
3058
3292
|
* @returns
|
|
3059
|
-
* 0: Success.
|
|
3293
|
+
* 0: Success.
|
|
3294
|
+
* < 0: Failure.
|
|
3060
3295
|
*/
|
|
3061
3296
|
abstract setLowlightEnhanceOptions(
|
|
3062
3297
|
enabled: boolean,
|
|
@@ -3067,14 +3302,21 @@ export abstract class IRtcEngine {
|
|
|
3067
3302
|
/**
|
|
3068
3303
|
* Sets video noise reduction.
|
|
3069
3304
|
*
|
|
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.
|
|
3305
|
+
* 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.
|
|
3306
|
+
* Call this method after calling enableVideo.
|
|
3307
|
+
* 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.
|
|
3308
|
+
* Both this method and setExtensionProperty can turn on video noise reduction function:
|
|
3309
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
3310
|
+
* 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.
|
|
3311
|
+
* 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
3312
|
*
|
|
3072
|
-
* @param enabled Whether to enable video noise reduction:true: Enable video noise reduction.false: (Default) Disable video noise reduction.
|
|
3313
|
+
* @param enabled Whether to enable video noise reduction: true : Enable video noise reduction. false : (Default) Disable video noise reduction.
|
|
3073
3314
|
* @param options The video noise reduction options. See VideoDenoiserOptions.
|
|
3074
3315
|
* @param type The type of the video source. See MediaSourceType.
|
|
3075
3316
|
*
|
|
3076
3317
|
* @returns
|
|
3077
|
-
* 0: Success.
|
|
3318
|
+
* 0: Success.
|
|
3319
|
+
* < 0: Failure.
|
|
3078
3320
|
*/
|
|
3079
3321
|
abstract setVideoDenoiserOptions(
|
|
3080
3322
|
enabled: boolean,
|
|
@@ -3085,14 +3327,21 @@ export abstract class IRtcEngine {
|
|
|
3085
3327
|
/**
|
|
3086
3328
|
* Sets color enhancement.
|
|
3087
3329
|
*
|
|
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.
|
|
3330
|
+
* 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.
|
|
3331
|
+
* Call this method after calling enableVideo.
|
|
3332
|
+
* 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.
|
|
3333
|
+
* Both this method and setExtensionProperty can enable color enhancement:
|
|
3334
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
3335
|
+
* 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.
|
|
3336
|
+
* 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
3337
|
*
|
|
3090
|
-
* @param enabled Whether to enable color enhancement:true Enable color enhancement.false: (Default) Disable color enhancement.
|
|
3338
|
+
* @param enabled Whether to enable color enhancement: true Enable color enhancement. false : (Default) Disable color enhancement.
|
|
3091
3339
|
* @param options The color enhancement options. See ColorEnhanceOptions.
|
|
3092
3340
|
* @param type The type of the video source. See MediaSourceType.
|
|
3093
3341
|
*
|
|
3094
3342
|
* @returns
|
|
3095
|
-
* 0: Success.
|
|
3343
|
+
* 0: Success.
|
|
3344
|
+
* < 0: Failure.
|
|
3096
3345
|
*/
|
|
3097
3346
|
abstract setColorEnhanceOptions(
|
|
3098
3347
|
enabled: boolean,
|
|
@@ -3103,15 +3352,27 @@ export abstract class IRtcEngine {
|
|
|
3103
3352
|
/**
|
|
3104
3353
|
* Enables/Disables the virtual background.
|
|
3105
3354
|
*
|
|
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
|
|
3355
|
+
* 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.
|
|
3356
|
+
* This feature requires high performance devices. Agora recommends that you implement it on devices equipped with the following chips:
|
|
3357
|
+
* Devices with an i5 CPU and better
|
|
3358
|
+
* Agora recommends that you use this feature in scenarios that meet the following conditions:
|
|
3359
|
+
* A high-definition camera device is used, and the environment is uniformly lit.
|
|
3360
|
+
* 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.
|
|
3361
|
+
* 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
3362
|
*
|
|
3108
|
-
* @param enabled Whether to enable virtual background:true: Enable virtual background.false: Disable virtual background.
|
|
3363
|
+
* @param enabled Whether to enable virtual background: true : Enable virtual background. false : Disable virtual background.
|
|
3109
3364
|
* @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
3365
|
* @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:
|
|
3366
|
+
* @param type The type of the video source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
3367
|
+
* The default value is PrimaryCameraSource.
|
|
3368
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
3112
3369
|
*
|
|
3113
3370
|
* @returns
|
|
3114
|
-
* 0: Success.
|
|
3371
|
+
* 0: Success.
|
|
3372
|
+
* < 0: Failure.
|
|
3373
|
+
* -1: The custom background image does not exist. Check the value of source in VirtualBackgroundSource.
|
|
3374
|
+
* -2: The color format of the custom background image is invalid. Check the value of color in VirtualBackgroundSource.
|
|
3375
|
+
* -3: The device does not support virtual background.
|
|
3115
3376
|
*/
|
|
3116
3377
|
abstract enableVirtualBackground(
|
|
3117
3378
|
enabled: boolean,
|
|
@@ -3123,24 +3384,28 @@ export abstract class IRtcEngine {
|
|
|
3123
3384
|
/**
|
|
3124
3385
|
* Initializes the video view of a remote user.
|
|
3125
3386
|
*
|
|
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.
|
|
3387
|
+
* 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.
|
|
3388
|
+
* 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
3389
|
*
|
|
3128
3390
|
* @param canvas The remote video view and settings. See VideoCanvas.
|
|
3129
3391
|
*
|
|
3130
3392
|
* @returns
|
|
3131
|
-
* 0: Success.
|
|
3393
|
+
* 0: Success.
|
|
3394
|
+
* < 0: Failure.
|
|
3132
3395
|
*/
|
|
3133
3396
|
abstract setupRemoteVideo(canvas: VideoCanvas): number;
|
|
3134
3397
|
|
|
3135
3398
|
/**
|
|
3136
3399
|
* Initializes the local video view.
|
|
3137
3400
|
*
|
|
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
|
|
3401
|
+
* 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.
|
|
3402
|
+
* You can call this method either before or after joining a channel.
|
|
3139
3403
|
*
|
|
3140
3404
|
* @param canvas The local video view and settings. See VideoCanvas.
|
|
3141
3405
|
*
|
|
3142
3406
|
* @returns
|
|
3143
|
-
* 0: Success.
|
|
3407
|
+
* 0: Success.
|
|
3408
|
+
* < 0: Failure.
|
|
3144
3409
|
*/
|
|
3145
3410
|
abstract setupLocalVideo(canvas: VideoCanvas): number;
|
|
3146
3411
|
|
|
@@ -3149,43 +3414,65 @@ export abstract class IRtcEngine {
|
|
|
3149
3414
|
*
|
|
3150
3415
|
* 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
3416
|
*
|
|
3152
|
-
* @param scenarioType The type of video application scenario. See VideoApplicationScenarioType.If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
|
|
3417
|
+
* @param scenarioType The type of video application scenario. See VideoApplicationScenarioType. If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
|
|
3418
|
+
* 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.
|
|
3419
|
+
* 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.
|
|
3420
|
+
* If nobody subscribers to the high-quality stream, the SDK automatically reduces its bitrate and frame rate to save upstream bandwidth.
|
|
3421
|
+
* 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:
|
|
3422
|
+
* Resolution: 1280 × 720
|
|
3423
|
+
* Frame rate: 15 fps
|
|
3424
|
+
* Bitrate: 1600 Kbps
|
|
3425
|
+
* 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.
|
|
3426
|
+
* If nobody subscribes to the low-quality stream, the SDK automatically disables it to save upstream bandwidth.
|
|
3427
|
+
* 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:
|
|
3428
|
+
* Resolution: 480 × 272
|
|
3429
|
+
* Frame rate: 15 fps
|
|
3430
|
+
* Bitrate: 500 Kbps
|
|
3153
3431
|
*
|
|
3154
3432
|
* @returns
|
|
3155
|
-
* 0: Success.
|
|
3433
|
+
* 0: Success.
|
|
3434
|
+
* < 0: Failure.
|
|
3156
3435
|
*/
|
|
3157
3436
|
abstract setVideoScenario(scenarioType: VideoApplicationScenarioType): number;
|
|
3158
3437
|
|
|
3159
3438
|
/**
|
|
3160
3439
|
* Enables the audio module.
|
|
3161
3440
|
*
|
|
3162
|
-
* The audio mode is enabled by default.
|
|
3441
|
+
* The audio mode is enabled by default.
|
|
3442
|
+
* This method enables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
3443
|
+
* 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.
|
|
3444
|
+
* A successful call of this method resets enableLocalAudio, muteRemoteAudioStream, and muteAllRemoteAudioStreams. Proceed it with caution.
|
|
3163
3445
|
*
|
|
3164
3446
|
* @returns
|
|
3165
|
-
* 0: Success.
|
|
3447
|
+
* 0: Success.
|
|
3448
|
+
* < 0: Failure.
|
|
3166
3449
|
*/
|
|
3167
3450
|
abstract enableAudio(): number;
|
|
3168
3451
|
|
|
3169
3452
|
/**
|
|
3170
3453
|
* Disables the audio module.
|
|
3171
3454
|
*
|
|
3172
|
-
* This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
3455
|
+
* This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
3456
|
+
* 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
3457
|
*
|
|
3174
3458
|
* @returns
|
|
3175
|
-
* 0: Success.
|
|
3459
|
+
* 0: Success.
|
|
3460
|
+
* < 0: Failure.
|
|
3176
3461
|
*/
|
|
3177
3462
|
abstract disableAudio(): number;
|
|
3178
3463
|
|
|
3179
3464
|
/**
|
|
3180
3465
|
* Sets the audio profile and audio scenario.
|
|
3181
3466
|
*
|
|
3182
|
-
* You can call this method either before or after joining a channel.
|
|
3467
|
+
* You can call this method either before or after joining a channel.
|
|
3468
|
+
* 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
3469
|
*
|
|
3184
3470
|
* @param profile The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AudioProfileType.
|
|
3185
3471
|
* @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
|
|
3186
3472
|
*
|
|
3187
3473
|
* @returns
|
|
3188
|
-
* 0: Success.
|
|
3474
|
+
* 0: Success.
|
|
3475
|
+
* < 0: Failure.
|
|
3189
3476
|
*/
|
|
3190
3477
|
abstract setAudioProfile(
|
|
3191
3478
|
profile: AudioProfileType,
|
|
@@ -3200,19 +3487,23 @@ export abstract class IRtcEngine {
|
|
|
3200
3487
|
* @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
|
|
3201
3488
|
*
|
|
3202
3489
|
* @returns
|
|
3203
|
-
* 0: Success.
|
|
3490
|
+
* 0: Success.
|
|
3491
|
+
* < 0: Failure.
|
|
3204
3492
|
*/
|
|
3205
3493
|
abstract setAudioScenario(scenario: AudioScenarioType): number;
|
|
3206
3494
|
|
|
3207
3495
|
/**
|
|
3208
3496
|
* Enables or disables the local audio capture.
|
|
3209
3497
|
*
|
|
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 (
|
|
3498
|
+
* 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).
|
|
3499
|
+
* 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.
|
|
3500
|
+
* 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
3501
|
*
|
|
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.
|
|
3502
|
+
* @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
3503
|
*
|
|
3214
3504
|
* @returns
|
|
3215
|
-
* 0: Success.
|
|
3505
|
+
* 0: Success.
|
|
3506
|
+
* < 0: Failure.
|
|
3216
3507
|
*/
|
|
3217
3508
|
abstract enableLocalAudio(enabled: boolean): number;
|
|
3218
3509
|
|
|
@@ -3221,22 +3512,26 @@ export abstract class IRtcEngine {
|
|
|
3221
3512
|
*
|
|
3222
3513
|
* 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
3514
|
*
|
|
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.
|
|
3515
|
+
* @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
3516
|
*
|
|
3226
3517
|
* @returns
|
|
3227
|
-
* 0: Success.
|
|
3518
|
+
* 0: Success.
|
|
3519
|
+
* < 0: Failure.
|
|
3228
3520
|
*/
|
|
3229
3521
|
abstract muteLocalAudioStream(mute: boolean): number;
|
|
3230
3522
|
|
|
3231
3523
|
/**
|
|
3232
3524
|
* Stops or resumes subscribing to the audio streams of all remote users.
|
|
3233
3525
|
*
|
|
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.
|
|
3526
|
+
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
3527
|
+
* Call this method after joining a channel.
|
|
3528
|
+
* 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
3529
|
*
|
|
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.
|
|
3530
|
+
* @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
3531
|
*
|
|
3238
3532
|
* @returns
|
|
3239
|
-
* 0: Success.
|
|
3533
|
+
* 0: Success.
|
|
3534
|
+
* < 0: Failure.
|
|
3240
3535
|
*/
|
|
3241
3536
|
abstract muteAllRemoteAudioStreams(mute: boolean): number;
|
|
3242
3537
|
|
|
@@ -3251,46 +3546,56 @@ export abstract class IRtcEngine {
|
|
|
3251
3546
|
* Call this method after joining a channel.
|
|
3252
3547
|
*
|
|
3253
3548
|
* @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.
|
|
3549
|
+
* @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
3550
|
*
|
|
3256
3551
|
* @returns
|
|
3257
|
-
* 0: Success.
|
|
3552
|
+
* 0: Success.
|
|
3553
|
+
* < 0: Failure.
|
|
3258
3554
|
*/
|
|
3259
3555
|
abstract muteRemoteAudioStream(uid: number, mute: boolean): number;
|
|
3260
3556
|
|
|
3261
3557
|
/**
|
|
3262
3558
|
* Stops or resumes publishing the local video stream.
|
|
3263
3559
|
*
|
|
3264
|
-
* A successful call of this method triggers the onUserMuteVideo callback on the remote client.
|
|
3560
|
+
* A successful call of this method triggers the onUserMuteVideo callback on the remote client.
|
|
3561
|
+
* This method executes faster than the enableLocalVideo (false) method, which controls the sending of the local video stream.
|
|
3562
|
+
* This method does not affect any ongoing video recording, because it does not disable the camera.
|
|
3265
3563
|
*
|
|
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.
|
|
3564
|
+
* @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
3565
|
*
|
|
3268
3566
|
* @returns
|
|
3269
|
-
* 0: Success.
|
|
3567
|
+
* 0: Success.
|
|
3568
|
+
* < 0: Failure.
|
|
3270
3569
|
*/
|
|
3271
3570
|
abstract muteLocalVideoStream(mute: boolean): number;
|
|
3272
3571
|
|
|
3273
3572
|
/**
|
|
3274
3573
|
* Enables/Disables the local video capture.
|
|
3275
3574
|
*
|
|
3276
|
-
* This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo
|
|
3575
|
+
* 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.
|
|
3576
|
+
* You can call this method either before or after joining a channel.
|
|
3577
|
+
* This method enables the internal engine and is valid after leaving the channel.
|
|
3277
3578
|
*
|
|
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.
|
|
3579
|
+
* @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
3580
|
*
|
|
3280
3581
|
* @returns
|
|
3281
|
-
* 0: Success.
|
|
3582
|
+
* 0: Success.
|
|
3583
|
+
* < 0: Failure.
|
|
3282
3584
|
*/
|
|
3283
3585
|
abstract enableLocalVideo(enabled: boolean): number;
|
|
3284
3586
|
|
|
3285
3587
|
/**
|
|
3286
3588
|
* Stops or resumes subscribing to the video streams of all remote users.
|
|
3287
3589
|
*
|
|
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.
|
|
3590
|
+
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
3591
|
+
* Call this method after joining a channel.
|
|
3592
|
+
* 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
3593
|
*
|
|
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.
|
|
3594
|
+
* @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
3595
|
*
|
|
3292
3596
|
* @returns
|
|
3293
|
-
* 0: Success.
|
|
3597
|
+
* 0: Success.
|
|
3598
|
+
* < 0: Failure.
|
|
3294
3599
|
*/
|
|
3295
3600
|
abstract muteAllRemoteVideoStreams(mute: boolean): number;
|
|
3296
3601
|
|
|
@@ -3305,23 +3610,25 @@ export abstract class IRtcEngine {
|
|
|
3305
3610
|
* Call this method after joining a channel.
|
|
3306
3611
|
*
|
|
3307
3612
|
* @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.
|
|
3613
|
+
* @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
3614
|
*
|
|
3310
3615
|
* @returns
|
|
3311
|
-
* 0: Success.
|
|
3616
|
+
* 0: Success.
|
|
3617
|
+
* < 0: Failure.
|
|
3312
3618
|
*/
|
|
3313
3619
|
abstract muteRemoteVideoStream(uid: number, mute: boolean): number;
|
|
3314
3620
|
|
|
3315
3621
|
/**
|
|
3316
3622
|
* Sets the stream type of the remote video.
|
|
3317
3623
|
*
|
|
3318
|
-
* Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (
|
|
3624
|
+
* 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. The SDK enables the low-quality video stream auto mode on the sender by default (not actively sending low-quality video streams). The host at the receiving end can call this method to initiate a low-quality video stream stream request on the receiving end, and the sender automatically switches to the low-quality video stream mode after receiving the request. 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
3625
|
*
|
|
3320
3626
|
* @param uid The user ID.
|
|
3321
3627
|
* @param streamType The video stream type: VideoStreamType.
|
|
3322
3628
|
*
|
|
3323
3629
|
* @returns
|
|
3324
|
-
* 0: Success.
|
|
3630
|
+
* 0: Success.
|
|
3631
|
+
* < 0: Failure.
|
|
3325
3632
|
*/
|
|
3326
3633
|
abstract setRemoteVideoStreamType(
|
|
3327
3634
|
uid: number,
|
|
@@ -3331,13 +3638,21 @@ export abstract class IRtcEngine {
|
|
|
3331
3638
|
/**
|
|
3332
3639
|
* Options for subscribing to remote video streams.
|
|
3333
3640
|
*
|
|
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.
|
|
3641
|
+
* 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.
|
|
3642
|
+
* 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).
|
|
3643
|
+
* 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).
|
|
3644
|
+
* 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).
|
|
3645
|
+
* 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:
|
|
3646
|
+
* Set autoSubscribeVideo to false when calling joinChannel to join a channel.
|
|
3647
|
+
* Call this method after receiving the onUserJoined callback to set the subscription options for the specified remote user's video stream.
|
|
3648
|
+
* 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
3649
|
*
|
|
3336
3650
|
* @param uid The user ID of the remote user.
|
|
3337
3651
|
* @param options The video subscription options. See VideoSubscriptionOptions.
|
|
3338
3652
|
*
|
|
3339
3653
|
* @returns
|
|
3340
|
-
* 0: Success.
|
|
3654
|
+
* 0: Success.
|
|
3655
|
+
* < 0: Failure.
|
|
3341
3656
|
*/
|
|
3342
3657
|
abstract setRemoteVideoSubscriptionOptions(
|
|
3343
3658
|
uid: number,
|
|
@@ -3347,25 +3662,33 @@ export abstract class IRtcEngine {
|
|
|
3347
3662
|
/**
|
|
3348
3663
|
* Sets the default stream type of subscrption for remote video streams.
|
|
3349
3664
|
*
|
|
3350
|
-
* The SDK enables the low-quality video stream auto mode on the sender by default (not actively sending low-quality video streams). The host at the receiving end can call this method to initiate a low-quality video stream stream request on the receiving end, and the sender automatically switches to the low-quality video stream mode after receiving the request. Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (
|
|
3665
|
+
* The SDK enables the low-quality video stream auto mode on the sender by default (not actively sending low-quality video streams). The host at the receiving end can call this method to initiate a low-quality video stream stream request on the receiving end, and the sender automatically switches to the low-quality video stream mode after receiving the request. 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.
|
|
3666
|
+
* Call this method before joining a channel. The SDK does not support changing the default subscribed video stream type after joining a channel.
|
|
3667
|
+
* If you call both this method and setRemoteVideoStreamType, the SDK applies the settings in the setRemoteVideoStreamType method.
|
|
3351
3668
|
*
|
|
3352
3669
|
* @param streamType The default video-stream type. See VideoStreamType.
|
|
3353
3670
|
*
|
|
3354
3671
|
* @returns
|
|
3355
|
-
* 0: Success.
|
|
3672
|
+
* 0: Success.
|
|
3673
|
+
* < 0: Failure.
|
|
3356
3674
|
*/
|
|
3357
3675
|
abstract setRemoteDefaultVideoStreamType(streamType: VideoStreamType): number;
|
|
3358
3676
|
|
|
3359
3677
|
/**
|
|
3360
3678
|
* Set the blocklist of subscriptions for audio streams.
|
|
3361
3679
|
*
|
|
3362
|
-
* You can call this method to specify the audio streams of a user that you do not want to subscribe to.
|
|
3680
|
+
* You can call this method to specify the audio streams of a user that you do not want to subscribe to.
|
|
3681
|
+
* You can call this method either before or after joining a channel.
|
|
3682
|
+
* The blocklist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams, and autoSubscribeAudio in ChannelMediaOptions.
|
|
3683
|
+
* Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3684
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3363
3685
|
*
|
|
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.
|
|
3686
|
+
* @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
3687
|
* @param uidNumber The number of users in the user ID list.
|
|
3366
3688
|
*
|
|
3367
3689
|
* @returns
|
|
3368
|
-
* 0: Success.
|
|
3690
|
+
* 0: Success.
|
|
3691
|
+
* < 0: Failure.
|
|
3369
3692
|
*/
|
|
3370
3693
|
abstract setSubscribeAudioBlocklist(
|
|
3371
3694
|
uidList: number[],
|
|
@@ -3375,13 +3698,18 @@ export abstract class IRtcEngine {
|
|
|
3375
3698
|
/**
|
|
3376
3699
|
* Sets the allowlist of subscriptions for audio streams.
|
|
3377
3700
|
*
|
|
3378
|
-
* You can call this method to specify the audio streams of a user that you want to subscribe to.
|
|
3701
|
+
* You can call this method to specify the audio streams of a user that you want to subscribe to.
|
|
3702
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3703
|
+
* You can call this method either before or after joining a channel.
|
|
3704
|
+
* The allowlist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3705
|
+
* Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3379
3706
|
*
|
|
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.
|
|
3707
|
+
* @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
3708
|
* @param uidNumber The number of users in the user ID list.
|
|
3382
3709
|
*
|
|
3383
3710
|
* @returns
|
|
3384
|
-
* 0: Success.
|
|
3711
|
+
* 0: Success.
|
|
3712
|
+
* < 0: Failure.
|
|
3385
3713
|
*/
|
|
3386
3714
|
abstract setSubscribeAudioAllowlist(
|
|
3387
3715
|
uidList: number[],
|
|
@@ -3391,13 +3719,18 @@ export abstract class IRtcEngine {
|
|
|
3391
3719
|
/**
|
|
3392
3720
|
* Set the blocklist of subscriptions for video streams.
|
|
3393
3721
|
*
|
|
3394
|
-
* You can call this method to specify the video streams of a user that you do not want to subscribe to.
|
|
3722
|
+
* You can call this method to specify the video streams of a user that you do not want to subscribe to.
|
|
3723
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3724
|
+
* Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3725
|
+
* You can call this method either before or after joining a channel.
|
|
3726
|
+
* The blocklist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3395
3727
|
*
|
|
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.
|
|
3728
|
+
* @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
3729
|
* @param uidNumber The number of users in the user ID list.
|
|
3398
3730
|
*
|
|
3399
3731
|
* @returns
|
|
3400
|
-
* 0: Success.
|
|
3732
|
+
* 0: Success.
|
|
3733
|
+
* < 0: Failure.
|
|
3401
3734
|
*/
|
|
3402
3735
|
abstract setSubscribeVideoBlocklist(
|
|
3403
3736
|
uidList: number[],
|
|
@@ -3407,13 +3740,18 @@ export abstract class IRtcEngine {
|
|
|
3407
3740
|
/**
|
|
3408
3741
|
* Set the allowlist of subscriptions for video streams.
|
|
3409
3742
|
*
|
|
3410
|
-
* You can call this method to specify the video streams of a user that you want to subscribe to.
|
|
3743
|
+
* You can call this method to specify the video streams of a user that you want to subscribe to.
|
|
3744
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3745
|
+
* Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3746
|
+
* You can call this method either before or after joining a channel.
|
|
3747
|
+
* The allowlist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3411
3748
|
*
|
|
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.
|
|
3749
|
+
* @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
3750
|
* @param uidNumber The number of users in the user ID list.
|
|
3414
3751
|
*
|
|
3415
3752
|
* @returns
|
|
3416
|
-
* 0: Success.
|
|
3753
|
+
* 0: Success.
|
|
3754
|
+
* < 0: Failure.
|
|
3417
3755
|
*/
|
|
3418
3756
|
abstract setSubscribeVideoAllowlist(
|
|
3419
3757
|
uidList: number[],
|
|
@@ -3425,12 +3763,15 @@ export abstract class IRtcEngine {
|
|
|
3425
3763
|
*
|
|
3426
3764
|
* 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
3765
|
*
|
|
3428
|
-
* @param interval Sets the time interval between two consecutive volume indications
|
|
3766
|
+
* @param interval Sets the time interval between two consecutive volume indications:
|
|
3767
|
+
* ≤ 0: Disables the volume indication.
|
|
3768
|
+
* > 0: Time interval (ms) between two consecutive volume indications. The lowest value is 50.
|
|
3429
3769
|
* @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.
|
|
3770
|
+
* @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
3771
|
*
|
|
3432
3772
|
* @returns
|
|
3433
|
-
* 0: Success.
|
|
3773
|
+
* 0: Success.
|
|
3774
|
+
* < 0: Failure.
|
|
3434
3775
|
*/
|
|
3435
3776
|
abstract enableAudioVolumeIndication(
|
|
3436
3777
|
interval: number,
|
|
@@ -3441,19 +3782,23 @@ export abstract class IRtcEngine {
|
|
|
3441
3782
|
/**
|
|
3442
3783
|
* Starts audio recording on the client and sets recording configurations.
|
|
3443
3784
|
*
|
|
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:
|
|
3785
|
+
* 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:
|
|
3786
|
+
* 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.
|
|
3787
|
+
* 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
3788
|
*
|
|
3446
3789
|
* @param config Recording configurations. See AudioRecordingConfiguration.
|
|
3447
3790
|
*
|
|
3448
3791
|
* @returns
|
|
3449
|
-
* 0: Success.
|
|
3792
|
+
* 0: Success.
|
|
3793
|
+
* < 0: Failure.
|
|
3450
3794
|
*/
|
|
3451
3795
|
abstract startAudioRecording(config: AudioRecordingConfiguration): number;
|
|
3452
3796
|
|
|
3453
3797
|
/**
|
|
3454
3798
|
* Registers an encoded audio observer.
|
|
3455
3799
|
*
|
|
3456
|
-
* Call this method after joining a channel.
|
|
3800
|
+
* Call this method after joining a channel.
|
|
3801
|
+
* 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
3802
|
*
|
|
3458
3803
|
* @returns
|
|
3459
3804
|
* One IAudioEncodedFrameObserver object.
|
|
@@ -3467,7 +3812,8 @@ export abstract class IRtcEngine {
|
|
|
3467
3812
|
* Stops the audio recording on the client.
|
|
3468
3813
|
*
|
|
3469
3814
|
* @returns
|
|
3470
|
-
* 0: Success.
|
|
3815
|
+
* 0: Success.
|
|
3816
|
+
* < 0: Failure.
|
|
3471
3817
|
*/
|
|
3472
3818
|
abstract stopAudioRecording(): number;
|
|
3473
3819
|
|
|
@@ -3475,7 +3821,8 @@ export abstract class IRtcEngine {
|
|
|
3475
3821
|
* Creates a media player instance.
|
|
3476
3822
|
*
|
|
3477
3823
|
* @returns
|
|
3478
|
-
* The IMediaPlayer instance, if the method call succeeds.
|
|
3824
|
+
* The IMediaPlayer instance, if the method call succeeds.
|
|
3825
|
+
* An empty pointer, if the method call fails.
|
|
3479
3826
|
*/
|
|
3480
3827
|
abstract createMediaPlayer(): IMediaPlayer;
|
|
3481
3828
|
|
|
@@ -3485,7 +3832,8 @@ export abstract class IRtcEngine {
|
|
|
3485
3832
|
* @param mediaPlayer One IMediaPlayer object.
|
|
3486
3833
|
*
|
|
3487
3834
|
* @returns
|
|
3488
|
-
* ≥ 0: Success. Returns the ID of media player instance.
|
|
3835
|
+
* ≥ 0: Success. Returns the ID of media player instance.
|
|
3836
|
+
* < 0: Failure.
|
|
3489
3837
|
*/
|
|
3490
3838
|
abstract destroyMediaPlayer(mediaPlayer: IMediaPlayer): number;
|
|
3491
3839
|
|
|
@@ -3502,17 +3850,29 @@ export abstract class IRtcEngine {
|
|
|
3502
3850
|
/**
|
|
3503
3851
|
* Starts playing the music file.
|
|
3504
3852
|
*
|
|
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 (
|
|
3853
|
+
* 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.
|
|
3854
|
+
* For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
|
|
3855
|
+
* 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.
|
|
3856
|
+
* 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
3857
|
*
|
|
3507
3858
|
* @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.
|
|
3859
|
+
* 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
3860
|
* 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
|
|
3861
|
+
* @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.
|
|
3862
|
+
* @param cycle The number of times the music file plays.
|
|
3863
|
+
* ≥ 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.
|
|
3864
|
+
* -1: Play the audio file in an infinite loop.
|
|
3512
3865
|
* @param startPos The playback position (ms) of the music file.
|
|
3513
3866
|
*
|
|
3514
3867
|
* @returns
|
|
3515
|
-
* 0: Success.
|
|
3868
|
+
* 0: Success.
|
|
3869
|
+
* < 0: Failure.
|
|
3870
|
+
* -1: A general error occurs (no specified reason).
|
|
3871
|
+
* -2: The parameter is invalid.
|
|
3872
|
+
* -3: The SDK is not ready.
|
|
3873
|
+
* The audio module is disabled.
|
|
3874
|
+
* The program is not complete.
|
|
3875
|
+
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
|
|
3516
3876
|
*/
|
|
3517
3877
|
abstract startAudioMixing(
|
|
3518
3878
|
filePath: string,
|
|
@@ -3527,7 +3887,8 @@ export abstract class IRtcEngine {
|
|
|
3527
3887
|
* This method stops the audio mixing. Call this method when you are in a channel.
|
|
3528
3888
|
*
|
|
3529
3889
|
* @returns
|
|
3530
|
-
* 0: Success.
|
|
3890
|
+
* 0: Success.
|
|
3891
|
+
* < 0: Failure.
|
|
3531
3892
|
*/
|
|
3532
3893
|
abstract stopAudioMixing(): number;
|
|
3533
3894
|
|
|
@@ -3537,7 +3898,8 @@ export abstract class IRtcEngine {
|
|
|
3537
3898
|
* Call this method after joining a channel.
|
|
3538
3899
|
*
|
|
3539
3900
|
* @returns
|
|
3540
|
-
* 0: Success.
|
|
3901
|
+
* 0: Success.
|
|
3902
|
+
* < 0: Failure.
|
|
3541
3903
|
*/
|
|
3542
3904
|
abstract pauseAudioMixing(): number;
|
|
3543
3905
|
|
|
@@ -3547,177 +3909,203 @@ export abstract class IRtcEngine {
|
|
|
3547
3909
|
* This method resumes playing and mixing the music file. Call this method when you are in a channel.
|
|
3548
3910
|
*
|
|
3549
3911
|
* @returns
|
|
3550
|
-
* 0: Success.
|
|
3912
|
+
* 0: Success.
|
|
3913
|
+
* < 0: Failure.
|
|
3551
3914
|
*/
|
|
3552
3915
|
abstract resumeAudioMixing(): number;
|
|
3553
3916
|
|
|
3554
3917
|
/**
|
|
3555
3918
|
* Selects the audio track used during playback.
|
|
3556
3919
|
*
|
|
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.
|
|
3920
|
+
* 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.
|
|
3921
|
+
* For the supported formats of audio files, see.
|
|
3922
|
+
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3558
3923
|
*
|
|
3559
|
-
* @param index The audio track you want to specify. The value range is [0, getAudioTrackCount()].
|
|
3924
|
+
* @param index The audio track you want to specify. The value range is [0, getAudioTrackCount ()].
|
|
3560
3925
|
*
|
|
3561
3926
|
* @returns
|
|
3562
|
-
* 0: Success.
|
|
3927
|
+
* 0: Success.
|
|
3928
|
+
* < 0: Failure.
|
|
3563
3929
|
*/
|
|
3564
3930
|
abstract selectAudioTrack(index: number): number;
|
|
3565
3931
|
|
|
3566
3932
|
/**
|
|
3567
3933
|
* Gets the index of audio tracks of the current music file.
|
|
3568
3934
|
*
|
|
3569
|
-
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3935
|
+
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3570
3936
|
*
|
|
3571
3937
|
* @returns
|
|
3572
|
-
* The SDK returns the index of the audio tracks if the method call succeeds.
|
|
3938
|
+
* The SDK returns the index of the audio tracks if the method call succeeds.
|
|
3939
|
+
* < 0: Failure.
|
|
3573
3940
|
*/
|
|
3574
3941
|
abstract getAudioTrackCount(): number;
|
|
3575
3942
|
|
|
3576
3943
|
/**
|
|
3577
3944
|
* Adjusts the volume during audio mixing.
|
|
3578
3945
|
*
|
|
3579
|
-
* This method adjusts the audio mixing volume on both the local client and remote clients.
|
|
3946
|
+
* This method adjusts the audio mixing volume on both the local client and remote clients.
|
|
3947
|
+
* Call this method after startAudioMixing.
|
|
3580
3948
|
*
|
|
3581
3949
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
3582
3950
|
*
|
|
3583
3951
|
* @returns
|
|
3584
|
-
* 0: Success.
|
|
3952
|
+
* 0: Success.
|
|
3953
|
+
* < 0: Failure.
|
|
3585
3954
|
*/
|
|
3586
3955
|
abstract adjustAudioMixingVolume(volume: number): number;
|
|
3587
3956
|
|
|
3588
3957
|
/**
|
|
3589
3958
|
* Adjusts the volume of audio mixing for publishing.
|
|
3590
3959
|
*
|
|
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 (
|
|
3960
|
+
* 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
3961
|
*
|
|
3593
3962
|
* @param volume The volume of audio mixing for local playback. The value ranges between 0 and 100 (default). 100 represents the original volume.
|
|
3594
3963
|
*
|
|
3595
3964
|
* @returns
|
|
3596
|
-
* 0: Success.
|
|
3965
|
+
* 0: Success.
|
|
3966
|
+
* < 0: Failure.
|
|
3597
3967
|
*/
|
|
3598
3968
|
abstract adjustAudioMixingPublishVolume(volume: number): number;
|
|
3599
3969
|
|
|
3600
3970
|
/**
|
|
3601
3971
|
* Retrieves the audio mixing volume for publishing.
|
|
3602
3972
|
*
|
|
3603
|
-
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3973
|
+
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3604
3974
|
*
|
|
3605
3975
|
* @returns
|
|
3606
|
-
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3976
|
+
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3977
|
+
* < 0: Failure.
|
|
3607
3978
|
*/
|
|
3608
3979
|
abstract getAudioMixingPublishVolume(): number;
|
|
3609
3980
|
|
|
3610
3981
|
/**
|
|
3611
3982
|
* Adjusts the volume of audio mixing for local playback.
|
|
3612
3983
|
*
|
|
3613
|
-
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3984
|
+
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3614
3985
|
*
|
|
3615
3986
|
* @param volume The volume of audio mixing for local playback. The value ranges between 0 and 100 (default). 100 represents the original volume.
|
|
3616
3987
|
*
|
|
3617
3988
|
* @returns
|
|
3618
|
-
* 0: Success.
|
|
3989
|
+
* 0: Success.
|
|
3990
|
+
* < 0: Failure.
|
|
3619
3991
|
*/
|
|
3620
3992
|
abstract adjustAudioMixingPlayoutVolume(volume: number): number;
|
|
3621
3993
|
|
|
3622
3994
|
/**
|
|
3623
3995
|
* Retrieves the audio mixing volume for local playback.
|
|
3624
3996
|
*
|
|
3625
|
-
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3997
|
+
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3626
3998
|
*
|
|
3627
3999
|
* @returns
|
|
3628
|
-
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
4000
|
+
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
4001
|
+
* < 0: Failure.
|
|
3629
4002
|
*/
|
|
3630
4003
|
abstract getAudioMixingPlayoutVolume(): number;
|
|
3631
4004
|
|
|
3632
4005
|
/**
|
|
3633
4006
|
* Retrieves the duration (ms) of the music file.
|
|
3634
4007
|
*
|
|
3635
|
-
* Retrieves the total duration (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
4008
|
+
* Retrieves the total duration (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3636
4009
|
*
|
|
3637
4010
|
* @returns
|
|
3638
|
-
* ≥ 0: The audio mixing duration, if this method call succeeds.
|
|
4011
|
+
* ≥ 0: The audio mixing duration, if this method call succeeds.
|
|
4012
|
+
* < 0: Failure.
|
|
3639
4013
|
*/
|
|
3640
4014
|
abstract getAudioMixingDuration(): number;
|
|
3641
4015
|
|
|
3642
4016
|
/**
|
|
3643
4017
|
* Retrieves the playback position (ms) of the music file.
|
|
3644
4018
|
*
|
|
3645
|
-
* Retrieves the playback position (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
4019
|
+
* Retrieves the playback position (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
4020
|
+
* If you need to call getAudioMixingCurrentPosition multiple times, ensure that the time interval between calling this method is more than 500 ms.
|
|
3646
4021
|
*
|
|
3647
4022
|
* @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.
|
|
4023
|
+
* ≥ 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.
|
|
4024
|
+
* < 0: Failure.
|
|
3649
4025
|
*/
|
|
3650
4026
|
abstract getAudioMixingCurrentPosition(): number;
|
|
3651
4027
|
|
|
3652
4028
|
/**
|
|
3653
4029
|
* Sets the audio mixing position.
|
|
3654
4030
|
*
|
|
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 (
|
|
4031
|
+
* 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
4032
|
*
|
|
3657
4033
|
* @param pos Integer. The playback position (ms).
|
|
3658
4034
|
*
|
|
3659
4035
|
* @returns
|
|
3660
|
-
* 0: Success.
|
|
4036
|
+
* 0: Success.
|
|
4037
|
+
* < 0: Failure.
|
|
3661
4038
|
*/
|
|
3662
4039
|
abstract setAudioMixingPosition(pos: number): number;
|
|
3663
4040
|
|
|
3664
4041
|
/**
|
|
3665
4042
|
* Sets the channel mode of the current audio file.
|
|
3666
4043
|
*
|
|
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.
|
|
4044
|
+
* 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.
|
|
4045
|
+
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
4046
|
+
* This method only applies to stereo audio files.
|
|
3668
4047
|
*
|
|
3669
4048
|
* @param mode The channel mode. See AudioMixingDualMonoMode.
|
|
3670
4049
|
*
|
|
3671
4050
|
* @returns
|
|
3672
|
-
* 0: Success.
|
|
4051
|
+
* 0: Success.
|
|
4052
|
+
* < 0: Failure.
|
|
3673
4053
|
*/
|
|
3674
4054
|
abstract setAudioMixingDualMonoMode(mode: AudioMixingDualMonoMode): number;
|
|
3675
4055
|
|
|
3676
4056
|
/**
|
|
3677
4057
|
* Sets the pitch of the local music file.
|
|
3678
4058
|
*
|
|
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 (
|
|
4059
|
+
* 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
4060
|
*
|
|
3681
4061
|
* @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
4062
|
*
|
|
3683
4063
|
* @returns
|
|
3684
|
-
* 0: Success.
|
|
4064
|
+
* 0: Success.
|
|
4065
|
+
* < 0: Failure.
|
|
3685
4066
|
*/
|
|
3686
4067
|
abstract setAudioMixingPitch(pitch: number): number;
|
|
3687
4068
|
|
|
3688
4069
|
/**
|
|
3689
4070
|
* Retrieves the volume of the audio effects.
|
|
3690
4071
|
*
|
|
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
|
|
4072
|
+
* 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
4073
|
*
|
|
3693
4074
|
* @returns
|
|
3694
|
-
* Volume of the audio effects, if this method call succeeds.
|
|
4075
|
+
* Volume of the audio effects, if this method call succeeds.
|
|
4076
|
+
* < 0: Failure.
|
|
3695
4077
|
*/
|
|
3696
4078
|
abstract getEffectsVolume(): number;
|
|
3697
4079
|
|
|
3698
4080
|
/**
|
|
3699
4081
|
* Sets the volume of the audio effects.
|
|
3700
4082
|
*
|
|
3701
|
-
* Call this method after playEffect
|
|
4083
|
+
* Call this method after playEffect.
|
|
3702
4084
|
*
|
|
3703
4085
|
* @param volume The playback volume. The value range is [0, 100]. The default value is 100, which represents the original volume.
|
|
3704
4086
|
*
|
|
3705
4087
|
* @returns
|
|
3706
|
-
* 0: Success.
|
|
4088
|
+
* 0: Success.
|
|
4089
|
+
* < 0: Failure.
|
|
3707
4090
|
*/
|
|
3708
4091
|
abstract setEffectsVolume(volume: number): number;
|
|
3709
4092
|
|
|
3710
4093
|
/**
|
|
3711
4094
|
* Preloads a specified audio effect file into the memory.
|
|
3712
4095
|
*
|
|
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
|
|
4096
|
+
* 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.
|
|
4097
|
+
* This method does not support online audio effect files.
|
|
4098
|
+
* For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
|
|
3714
4099
|
*
|
|
3715
4100
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3716
|
-
* @param filePath File path:
|
|
4101
|
+
* @param filePath File path:
|
|
4102
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
4103
|
+
* 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
4104
|
* @param startPos The playback position (ms) of the audio effect file.
|
|
3718
4105
|
*
|
|
3719
4106
|
* @returns
|
|
3720
|
-
* 0: Success.
|
|
4107
|
+
* 0: Success.
|
|
4108
|
+
* < 0: Failure.
|
|
3721
4109
|
*/
|
|
3722
4110
|
abstract preloadEffect(
|
|
3723
4111
|
soundId: number,
|
|
@@ -3728,19 +4116,25 @@ export abstract class IRtcEngine {
|
|
|
3728
4116
|
/**
|
|
3729
4117
|
* Plays the specified local or online audio effect file.
|
|
3730
4118
|
*
|
|
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
|
|
4119
|
+
* 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
4120
|
*
|
|
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
|
|
4121
|
+
* @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.
|
|
4122
|
+
* @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.
|
|
4123
|
+
* @param loopCount The number of times the audio effect loops.
|
|
4124
|
+
* ≥ 0: The number of playback times. For example, 1 means looping one time, which means playing the audio effect two times in total.
|
|
4125
|
+
* -1: Play the audio file in an infinite loop.
|
|
3736
4126
|
* @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
|
|
4127
|
+
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
|
4128
|
+
* -1.0: The audio effect is heard on the left of the user.
|
|
4129
|
+
* 0.0: The audio effect is heard in front of the user.
|
|
4130
|
+
* 1.0: The audio effect is heard on the right of the user.
|
|
3738
4131
|
* @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.
|
|
4132
|
+
* @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
4133
|
* @param startPos The playback position (ms) of the audio effect file.
|
|
3741
4134
|
*
|
|
3742
4135
|
* @returns
|
|
3743
|
-
* 0: Success.
|
|
4136
|
+
* 0: Success.
|
|
4137
|
+
* < 0: Failure.
|
|
3744
4138
|
*/
|
|
3745
4139
|
abstract playEffect(
|
|
3746
4140
|
soundId: number,
|
|
@@ -3758,14 +4152,21 @@ export abstract class IRtcEngine {
|
|
|
3758
4152
|
*
|
|
3759
4153
|
* 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
4154
|
*
|
|
3761
|
-
* @param loopCount The number of times the audio effect loops
|
|
4155
|
+
* @param loopCount The number of times the audio effect loops:
|
|
4156
|
+
* -1: Play the audio effect files in an indefinite loop until you call stopEffect or stopAllEffects.
|
|
4157
|
+
* 0: Play the audio effect once.
|
|
4158
|
+
* 1: Play the audio effect twice.
|
|
3762
4159
|
* @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
|
|
4160
|
+
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
|
4161
|
+
* -1.0: The audio effect shows on the left.
|
|
4162
|
+
* 0: The audio effect shows ahead.
|
|
4163
|
+
* 1.0: The audio effect shows on the right.
|
|
3764
4164
|
* @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.
|
|
4165
|
+
* @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
4166
|
*
|
|
3767
4167
|
* @returns
|
|
3768
|
-
* 0: Success.
|
|
4168
|
+
* 0: Success.
|
|
4169
|
+
* < 0: Failure.
|
|
3769
4170
|
*/
|
|
3770
4171
|
abstract playAllEffects(
|
|
3771
4172
|
loopCount: number,
|
|
@@ -3781,7 +4182,8 @@ export abstract class IRtcEngine {
|
|
|
3781
4182
|
* @param soundId The ID of the audio effect file.
|
|
3782
4183
|
*
|
|
3783
4184
|
* @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.
|
|
4185
|
+
* ≥ 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.
|
|
4186
|
+
* < 0: Failure.
|
|
3785
4187
|
*/
|
|
3786
4188
|
abstract getVolumeOfEffect(soundId: number): number;
|
|
3787
4189
|
|
|
@@ -3792,7 +4194,8 @@ export abstract class IRtcEngine {
|
|
|
3792
4194
|
* @param volume The playback volume. The value range is [0, 100]. The default value is 100, which represents the original volume.
|
|
3793
4195
|
*
|
|
3794
4196
|
* @returns
|
|
3795
|
-
* 0: Success.
|
|
4197
|
+
* 0: Success.
|
|
4198
|
+
* < 0: Failure.
|
|
3796
4199
|
*/
|
|
3797
4200
|
abstract setVolumeOfEffect(soundId: number, volume: number): number;
|
|
3798
4201
|
|
|
@@ -3802,7 +4205,8 @@ export abstract class IRtcEngine {
|
|
|
3802
4205
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3803
4206
|
*
|
|
3804
4207
|
* @returns
|
|
3805
|
-
* 0: Success.
|
|
4208
|
+
* 0: Success.
|
|
4209
|
+
* < 0: Failure.
|
|
3806
4210
|
*/
|
|
3807
4211
|
abstract pauseEffect(soundId: number): number;
|
|
3808
4212
|
|
|
@@ -3810,7 +4214,8 @@ export abstract class IRtcEngine {
|
|
|
3810
4214
|
* Pauses all audio effects.
|
|
3811
4215
|
*
|
|
3812
4216
|
* @returns
|
|
3813
|
-
* 0: Success.
|
|
4217
|
+
* 0: Success.
|
|
4218
|
+
* < 0: Failure.
|
|
3814
4219
|
*/
|
|
3815
4220
|
abstract pauseAllEffects(): number;
|
|
3816
4221
|
|
|
@@ -3820,7 +4225,8 @@ export abstract class IRtcEngine {
|
|
|
3820
4225
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3821
4226
|
*
|
|
3822
4227
|
* @returns
|
|
3823
|
-
* 0: Success.
|
|
4228
|
+
* 0: Success.
|
|
4229
|
+
* < 0: Failure.
|
|
3824
4230
|
*/
|
|
3825
4231
|
abstract resumeEffect(soundId: number): number;
|
|
3826
4232
|
|
|
@@ -3828,7 +4234,8 @@ export abstract class IRtcEngine {
|
|
|
3828
4234
|
* Resumes playing all audio effect files.
|
|
3829
4235
|
*
|
|
3830
4236
|
* @returns
|
|
3831
|
-
* 0: Success.
|
|
4237
|
+
* 0: Success.
|
|
4238
|
+
* < 0: Failure.
|
|
3832
4239
|
*/
|
|
3833
4240
|
abstract resumeAllEffects(): number;
|
|
3834
4241
|
|
|
@@ -3838,7 +4245,8 @@ export abstract class IRtcEngine {
|
|
|
3838
4245
|
* @param soundId The ID of the audio effect. Each audio effect has a unique ID.
|
|
3839
4246
|
*
|
|
3840
4247
|
* @returns
|
|
3841
|
-
* 0: Success.
|
|
4248
|
+
* 0: Success.
|
|
4249
|
+
* < 0: Failure.
|
|
3842
4250
|
*/
|
|
3843
4251
|
abstract stopEffect(soundId: number): number;
|
|
3844
4252
|
|
|
@@ -3846,7 +4254,8 @@ export abstract class IRtcEngine {
|
|
|
3846
4254
|
* Stops playing all audio effects.
|
|
3847
4255
|
*
|
|
3848
4256
|
* @returns
|
|
3849
|
-
* 0: Success.
|
|
4257
|
+
* 0: Success.
|
|
4258
|
+
* < 0: Failure.
|
|
3850
4259
|
*/
|
|
3851
4260
|
abstract stopAllEffects(): number;
|
|
3852
4261
|
|
|
@@ -3856,7 +4265,8 @@ export abstract class IRtcEngine {
|
|
|
3856
4265
|
* @param soundId The ID of the audio effect. Each audio effect has a unique ID.
|
|
3857
4266
|
*
|
|
3858
4267
|
* @returns
|
|
3859
|
-
* 0: Success.
|
|
4268
|
+
* 0: Success.
|
|
4269
|
+
* < 0: Failure.
|
|
3860
4270
|
*/
|
|
3861
4271
|
abstract unloadEffect(soundId: number): number;
|
|
3862
4272
|
|
|
@@ -3864,7 +4274,8 @@ export abstract class IRtcEngine {
|
|
|
3864
4274
|
* Releases a specified preloaded audio effect from the memory.
|
|
3865
4275
|
*
|
|
3866
4276
|
* @returns
|
|
3867
|
-
* 0: Success.
|
|
4277
|
+
* 0: Success.
|
|
4278
|
+
* < 0: Failure.
|
|
3868
4279
|
*/
|
|
3869
4280
|
abstract unloadAllEffects(): number;
|
|
3870
4281
|
|
|
@@ -3874,24 +4285,26 @@ export abstract class IRtcEngine {
|
|
|
3874
4285
|
* Call this method after joining a channel.
|
|
3875
4286
|
*
|
|
3876
4287
|
* @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.
|
|
4288
|
+
* 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
4289
|
* 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
4290
|
*
|
|
3880
4291
|
* @returns
|
|
3881
|
-
* The total duration (ms) of the specified audio effect file, if the method call succeeds.
|
|
4292
|
+
* The total duration (ms) of the specified audio effect file, if the method call succeeds.
|
|
4293
|
+
* < 0: Failure.
|
|
3882
4294
|
*/
|
|
3883
4295
|
abstract getEffectDuration(filePath: string): number;
|
|
3884
4296
|
|
|
3885
4297
|
/**
|
|
3886
4298
|
* Sets the playback position of an audio effect file.
|
|
3887
4299
|
*
|
|
3888
|
-
* After a successful setting, the local audio effect file starts playing at the specified position. Call this method after playEffect
|
|
4300
|
+
* After a successful setting, the local audio effect file starts playing at the specified position. Call this method after playEffect.
|
|
3889
4301
|
*
|
|
3890
4302
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3891
4303
|
* @param pos The playback position (ms) of the audio effect file.
|
|
3892
4304
|
*
|
|
3893
4305
|
* @returns
|
|
3894
|
-
* 0: Success.
|
|
4306
|
+
* 0: Success.
|
|
4307
|
+
* < 0: Failure.
|
|
3895
4308
|
*/
|
|
3896
4309
|
abstract setEffectPosition(soundId: number, pos: number): number;
|
|
3897
4310
|
|
|
@@ -3903,33 +4316,42 @@ export abstract class IRtcEngine {
|
|
|
3903
4316
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3904
4317
|
*
|
|
3905
4318
|
* @returns
|
|
3906
|
-
* The playback position (ms) of the specified audio effect file, if the method call succeeds.
|
|
4319
|
+
* The playback position (ms) of the specified audio effect file, if the method call succeeds.
|
|
4320
|
+
* < 0: Failure.
|
|
3907
4321
|
*/
|
|
3908
4322
|
abstract getEffectCurrentPosition(soundId: number): number;
|
|
3909
4323
|
|
|
3910
4324
|
/**
|
|
3911
4325
|
* Enables or disables stereo panning for remote users.
|
|
3912
4326
|
*
|
|
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
|
|
4327
|
+
* 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
4328
|
*
|
|
3915
|
-
* @param enabled Whether to enable stereo panning for remote users:true: Enable stereo panning.false: Disable stereo panning.
|
|
4329
|
+
* @param enabled Whether to enable stereo panning for remote users: true : Enable stereo panning. false : Disable stereo panning.
|
|
3916
4330
|
*
|
|
3917
4331
|
* @returns
|
|
3918
|
-
* 0: Success.
|
|
4332
|
+
* 0: Success.
|
|
4333
|
+
* < 0: Failure.
|
|
3919
4334
|
*/
|
|
3920
4335
|
abstract enableSoundPositionIndication(enabled: boolean): number;
|
|
3921
4336
|
|
|
3922
4337
|
/**
|
|
3923
4338
|
* Sets the 2D position (the position on the horizontal plane) of the remote user's voice.
|
|
3924
4339
|
*
|
|
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.
|
|
4340
|
+
* 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.
|
|
4341
|
+
* For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel.
|
|
4342
|
+
* For the best voice positioning, Agora recommends using a wired headset.
|
|
4343
|
+
* Call this method after joining a channel.
|
|
3926
4344
|
*
|
|
3927
4345
|
* @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:
|
|
4346
|
+
* @param pan The voice position of the remote user. The value ranges from -1.0 to 1.0:
|
|
4347
|
+
* 0.0: (Default) The remote voice comes from the front.
|
|
4348
|
+
* -1.0: The remote voice comes from the left.
|
|
4349
|
+
* 1.0: The remote voice comes from the right.
|
|
3929
4350
|
* @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
4351
|
*
|
|
3931
4352
|
* @returns
|
|
3932
|
-
* 0: Success.
|
|
4353
|
+
* 0: Success.
|
|
4354
|
+
* < 0: Failure.
|
|
3933
4355
|
*/
|
|
3934
4356
|
abstract setRemoteVoicePosition(
|
|
3935
4357
|
uid: number,
|
|
@@ -3940,24 +4362,26 @@ export abstract class IRtcEngine {
|
|
|
3940
4362
|
/**
|
|
3941
4363
|
* Enables or disables the spatial audio effect.
|
|
3942
4364
|
*
|
|
3943
|
-
* After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
|
|
4365
|
+
* After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
|
|
4366
|
+
* You can call this method either before or after joining a channel.
|
|
4367
|
+
* 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
4368
|
*
|
|
3945
|
-
* @param enabled Whether to enable the spatial audio effect:true: Enable the spatial audio effect.false: Disable the spatial audio effect.
|
|
4369
|
+
* @param enabled Whether to enable the spatial audio effect: true : Enable the spatial audio effect. false : Disable the spatial audio effect.
|
|
3946
4370
|
*
|
|
3947
4371
|
* @returns
|
|
3948
|
-
* 0: Success.
|
|
4372
|
+
* 0: Success.
|
|
4373
|
+
* < 0: Failure.
|
|
3949
4374
|
*/
|
|
3950
4375
|
abstract enableSpatialAudio(enabled: boolean): number;
|
|
3951
4376
|
|
|
3952
4377
|
/**
|
|
3953
4378
|
* Sets the spatial audio effect parameters of the remote user.
|
|
3954
4379
|
*
|
|
3955
|
-
* Call this method after enableSpatialAudio
|
|
3956
|
-
*
|
|
3957
|
-
* @param uid The user ID.
|
|
4380
|
+
* 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
4381
|
*
|
|
3959
4382
|
* @returns
|
|
3960
|
-
* 0: Success.
|
|
4383
|
+
* 0: Success.
|
|
4384
|
+
* < 0: Failure.
|
|
3961
4385
|
*/
|
|
3962
4386
|
abstract setRemoteUserSpatialAudioParams(
|
|
3963
4387
|
uid: number,
|
|
@@ -3967,50 +4391,81 @@ export abstract class IRtcEngine {
|
|
|
3967
4391
|
/**
|
|
3968
4392
|
* Sets a preset voice beautifier effect.
|
|
3969
4393
|
*
|
|
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.
|
|
4394
|
+
* 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.
|
|
4395
|
+
* You can call this method either before or after joining a channel.
|
|
4396
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
4397
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4398
|
+
* 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
|
|
4399
|
+
* 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
4400
|
*
|
|
3972
4401
|
* @param preset The preset voice beautifier effect options: VoiceBeautifierPreset.
|
|
3973
4402
|
*
|
|
3974
4403
|
* @returns
|
|
3975
|
-
* 0: Success.
|
|
4404
|
+
* 0: Success.
|
|
4405
|
+
* < 0: Failure.
|
|
3976
4406
|
*/
|
|
3977
4407
|
abstract setVoiceBeautifierPreset(preset: VoiceBeautifierPreset): number;
|
|
3978
4408
|
|
|
3979
4409
|
/**
|
|
3980
4410
|
* Sets an SDK preset audio effect.
|
|
3981
4411
|
*
|
|
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.
|
|
4412
|
+
* 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.
|
|
4413
|
+
* You can call this method either before or after joining a channel.
|
|
4414
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect.
|
|
4415
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4416
|
+
* If you call setAudioEffectPreset and set enumerators except for RoomAcoustics3dVoice or PitchCorrection, do not call setAudioEffectParameters; otherwise, setAudioEffectPreset is overridden.
|
|
4417
|
+
* 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
|
|
4418
|
+
* 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
4419
|
*
|
|
3984
4420
|
* @param preset The options for SDK preset audio effects. See AudioEffectPreset.
|
|
3985
4421
|
*
|
|
3986
4422
|
* @returns
|
|
3987
|
-
* 0: Success.
|
|
4423
|
+
* 0: Success.
|
|
4424
|
+
* < 0: Failure.
|
|
3988
4425
|
*/
|
|
3989
4426
|
abstract setAudioEffectPreset(preset: AudioEffectPreset): number;
|
|
3990
4427
|
|
|
3991
4428
|
/**
|
|
3992
4429
|
* Sets a preset voice beautifier effect.
|
|
3993
4430
|
*
|
|
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.
|
|
4431
|
+
* 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.
|
|
4432
|
+
* You can call this method either before or after joining a channel.
|
|
4433
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
4434
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4435
|
+
* 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
|
|
4436
|
+
* 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
4437
|
*
|
|
3996
4438
|
* @param preset The options for the preset voice beautifier effects: VoiceConversionPreset.
|
|
3997
4439
|
*
|
|
3998
4440
|
* @returns
|
|
3999
|
-
* 0: Success.
|
|
4441
|
+
* 0: Success.
|
|
4442
|
+
* < 0: Failure.
|
|
4000
4443
|
*/
|
|
4001
4444
|
abstract setVoiceConversionPreset(preset: VoiceConversionPreset): number;
|
|
4002
4445
|
|
|
4003
4446
|
/**
|
|
4004
4447
|
* Sets parameters for SDK preset audio effects.
|
|
4005
4448
|
*
|
|
4006
|
-
* Call this method to set the following parameters for the local user who sends an audio stream:
|
|
4449
|
+
* Call this method to set the following parameters for the local user who sends an audio stream:
|
|
4450
|
+
* 3D voice effect: Sets the cycle period of the 3D voice effect.
|
|
4451
|
+
* 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.
|
|
4452
|
+
* You can call this method either before or after joining a channel.
|
|
4453
|
+
* To get better audio effect quality, Agora recommends setting the scenario parameter of setAudioProfile as AudioScenarioGameStreaming (3) before calling this method.
|
|
4454
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect.
|
|
4455
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4456
|
+
* 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
4457
|
*
|
|
4008
|
-
* @param preset The options for SDK preset audio effects:RoomAcoustics3dVoice, 3D voice effect:
|
|
4009
|
-
*
|
|
4010
|
-
*
|
|
4458
|
+
* @param preset The options for SDK preset audio effects: RoomAcoustics3dVoice, 3D voice effect:
|
|
4459
|
+
* 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.
|
|
4460
|
+
* 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.
|
|
4461
|
+
* @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.
|
|
4462
|
+
* 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.
|
|
4463
|
+
* @param param2 If you set preset to RoomAcoustics3dVoice , you need to set param2 to 0.
|
|
4464
|
+
* 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
4465
|
*
|
|
4012
4466
|
* @returns
|
|
4013
|
-
* 0: Success.
|
|
4467
|
+
* 0: Success.
|
|
4468
|
+
* < 0: Failure.
|
|
4014
4469
|
*/
|
|
4015
4470
|
abstract setAudioEffectParameters(
|
|
4016
4471
|
preset: AudioEffectPreset,
|
|
@@ -4021,14 +4476,19 @@ export abstract class IRtcEngine {
|
|
|
4021
4476
|
/**
|
|
4022
4477
|
* Sets parameters for the preset voice beautifier effects.
|
|
4023
4478
|
*
|
|
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.
|
|
4479
|
+
* 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.
|
|
4480
|
+
* You can call this method either before or after joining a channel.
|
|
4481
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
4482
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
4483
|
+
* 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
4484
|
*
|
|
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.
|
|
4485
|
+
* @param preset The option for the preset audio effect: SINGING_BEAUTIFIER : The singing beautifier effect.
|
|
4486
|
+
* @param param1 The gender characteristics options for the singing voice: 1 : A male-sounding voice. 2 : A female-sounding voice.
|
|
4487
|
+
* @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
4488
|
*
|
|
4030
4489
|
* @returns
|
|
4031
|
-
* 0: Success.
|
|
4490
|
+
* 0: Success.
|
|
4491
|
+
* < 0: Failure.
|
|
4032
4492
|
*/
|
|
4033
4493
|
abstract setVoiceBeautifierParameters(
|
|
4034
4494
|
preset: VoiceBeautifierPreset,
|
|
@@ -4053,19 +4513,21 @@ export abstract class IRtcEngine {
|
|
|
4053
4513
|
* @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
4514
|
*
|
|
4055
4515
|
* @returns
|
|
4056
|
-
* 0: Success.
|
|
4516
|
+
* 0: Success.
|
|
4517
|
+
* < 0: Failure.
|
|
4057
4518
|
*/
|
|
4058
4519
|
abstract setLocalVoicePitch(pitch: number): number;
|
|
4059
4520
|
|
|
4060
4521
|
/**
|
|
4061
4522
|
* Set the formant ratio to change the timbre of human voice.
|
|
4062
4523
|
*
|
|
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
|
|
4524
|
+
* 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
4525
|
*
|
|
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.
|
|
4526
|
+
* @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
4527
|
*
|
|
4067
4528
|
* @returns
|
|
4068
|
-
* 0: Success.
|
|
4529
|
+
* 0: Success.
|
|
4530
|
+
* < 0: Failure.
|
|
4069
4531
|
*/
|
|
4070
4532
|
abstract setLocalVoiceFormant(formantRatio: number): number;
|
|
4071
4533
|
|
|
@@ -4078,7 +4540,8 @@ export abstract class IRtcEngine {
|
|
|
4078
4540
|
* @param bandGain The gain of each band in dB. The value ranges between -15 and 15. The default value is 0.
|
|
4079
4541
|
*
|
|
4080
4542
|
* @returns
|
|
4081
|
-
* 0: Success.
|
|
4543
|
+
* 0: Success.
|
|
4544
|
+
* < 0: Failure.
|
|
4082
4545
|
*/
|
|
4083
4546
|
abstract setLocalVoiceEqualization(
|
|
4084
4547
|
bandFrequency: AudioEqualizationBandFrequency,
|
|
@@ -4088,13 +4551,14 @@ export abstract class IRtcEngine {
|
|
|
4088
4551
|
/**
|
|
4089
4552
|
* Sets the local voice reverberation.
|
|
4090
4553
|
*
|
|
4091
|
-
* The SDK provides an easier-to-use method, setAudioEffectPreset
|
|
4554
|
+
* 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
4555
|
*
|
|
4093
4556
|
* @param reverbKey The reverberation key. Agora provides five reverberation keys, see AudioReverbType.
|
|
4094
4557
|
* @param value The value of the reverberation key.
|
|
4095
4558
|
*
|
|
4096
4559
|
* @returns
|
|
4097
|
-
* 0: Success.
|
|
4560
|
+
* 0: Success.
|
|
4561
|
+
* < 0: Failure.
|
|
4098
4562
|
*/
|
|
4099
4563
|
abstract setLocalVoiceReverb(
|
|
4100
4564
|
reverbKey: AudioReverbType,
|
|
@@ -4109,7 +4573,9 @@ export abstract class IRtcEngine {
|
|
|
4109
4573
|
* @param preset The preset headphone equalization effect. See HeadphoneEqualizerPreset.
|
|
4110
4574
|
*
|
|
4111
4575
|
* @returns
|
|
4112
|
-
* 0: Success.
|
|
4576
|
+
* 0: Success.
|
|
4577
|
+
* < 0: Failure.
|
|
4578
|
+
* -1: A general error occurs (no specified reason).
|
|
4113
4579
|
*/
|
|
4114
4580
|
abstract setHeadphoneEQPreset(preset: HeadphoneEqualizerPreset): number;
|
|
4115
4581
|
|
|
@@ -4122,7 +4588,9 @@ export abstract class IRtcEngine {
|
|
|
4122
4588
|
* @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
4589
|
*
|
|
4124
4590
|
* @returns
|
|
4125
|
-
* 0: Success.
|
|
4591
|
+
* 0: Success.
|
|
4592
|
+
* < 0: Failure.
|
|
4593
|
+
* -1: A general error occurs (no specified reason).
|
|
4126
4594
|
*/
|
|
4127
4595
|
abstract setHeadphoneEQParameters(lowGain: number, highGain: number): number;
|
|
4128
4596
|
|
|
@@ -4134,19 +4602,21 @@ export abstract class IRtcEngine {
|
|
|
4134
4602
|
* @param filePath The complete path of the log files. These log files are encoded in UTF-8.
|
|
4135
4603
|
*
|
|
4136
4604
|
* @returns
|
|
4137
|
-
* 0: Success.
|
|
4605
|
+
* 0: Success.
|
|
4606
|
+
* < 0: Failure.
|
|
4138
4607
|
*/
|
|
4139
4608
|
abstract setLogFile(filePath: string): number;
|
|
4140
4609
|
|
|
4141
4610
|
/**
|
|
4142
4611
|
* Sets the log output level of the SDK.
|
|
4143
4612
|
*
|
|
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
|
|
4613
|
+
* 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
4614
|
*
|
|
4146
4615
|
* @param filter The output log level of the SDK. See LogFilterType.
|
|
4147
4616
|
*
|
|
4148
4617
|
* @returns
|
|
4149
|
-
* 0: Success.
|
|
4618
|
+
* 0: Success.
|
|
4619
|
+
* < 0: Failure.
|
|
4150
4620
|
*/
|
|
4151
4621
|
abstract setLogFilter(filter: LogFilterType): number;
|
|
4152
4622
|
|
|
@@ -4158,19 +4628,32 @@ export abstract class IRtcEngine {
|
|
|
4158
4628
|
* @param level The log level: LogLevel.
|
|
4159
4629
|
*
|
|
4160
4630
|
* @returns
|
|
4161
|
-
* 0: Success.
|
|
4631
|
+
* 0: Success.
|
|
4632
|
+
* < 0: Failure.
|
|
4162
4633
|
*/
|
|
4163
4634
|
abstract setLogLevel(level: LogLevel): number;
|
|
4164
4635
|
|
|
4165
4636
|
/**
|
|
4166
4637
|
* Sets the log file size.
|
|
4167
4638
|
*
|
|
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:
|
|
4639
|
+
* 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:
|
|
4640
|
+
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
4641
|
+
* The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
|
|
4642
|
+
* 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.
|
|
4643
|
+
* The SDK writes the latest logs in agorasdk.log or agoraapi.log.
|
|
4644
|
+
* When agorasdk.log is full, the SDK processes the log files in the following order:
|
|
4645
|
+
* Delete the agorasdk.4.log file (if any).
|
|
4646
|
+
* Rename agorasdk.3.log to agorasdk.4.log.
|
|
4647
|
+
* Rename agorasdk.2.log to agorasdk.3.log.
|
|
4648
|
+
* Rename agorasdk.1.log to agorasdk.2.log.
|
|
4649
|
+
* Create a new agorasdk.log file.
|
|
4650
|
+
* 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
4651
|
*
|
|
4170
|
-
* @param fileSizeInKBytes The size (KB) of an agorasdk.log file. The value range is [128,20480]. The default value is
|
|
4652
|
+
* @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
4653
|
*
|
|
4172
4654
|
* @returns
|
|
4173
|
-
* 0: Success.
|
|
4655
|
+
* 0: Success.
|
|
4656
|
+
* < 0: Failure.
|
|
4174
4657
|
*/
|
|
4175
4658
|
abstract setLogFileSize(fileSizeInKBytes: number): number;
|
|
4176
4659
|
|
|
@@ -4182,13 +4665,16 @@ export abstract class IRtcEngine {
|
|
|
4182
4665
|
/**
|
|
4183
4666
|
* Updates the display mode of the local video view.
|
|
4184
4667
|
*
|
|
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.
|
|
4668
|
+
* 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.
|
|
4669
|
+
* Ensure that you have called the setupLocalVideo method to initialize the local video view before calling this method.
|
|
4670
|
+
* During a call, you can call this method as many times as necessary to update the display mode of the local video view.
|
|
4186
4671
|
*
|
|
4187
4672
|
* @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.
|
|
4673
|
+
* @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
4674
|
*
|
|
4190
4675
|
* @returns
|
|
4191
|
-
* 0: Success.
|
|
4676
|
+
* 0: Success.
|
|
4677
|
+
* < 0: Failure.
|
|
4192
4678
|
*/
|
|
4193
4679
|
abstract setLocalRenderMode(
|
|
4194
4680
|
renderMode: RenderModeType,
|
|
@@ -4198,14 +4684,17 @@ export abstract class IRtcEngine {
|
|
|
4198
4684
|
/**
|
|
4199
4685
|
* Updates the display mode of the video view of a remote user.
|
|
4200
4686
|
*
|
|
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.
|
|
4687
|
+
* 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.
|
|
4688
|
+
* Call this method after initializing the remote view by calling the setupRemoteVideo method.
|
|
4689
|
+
* 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
4690
|
*
|
|
4203
4691
|
* @param uid The user ID of the remote user.
|
|
4204
4692
|
* @param renderMode The rendering mode of the remote user view.
|
|
4205
4693
|
* @param mirrorMode The mirror mode of the remote user view. See VideoMirrorModeType.
|
|
4206
4694
|
*
|
|
4207
4695
|
* @returns
|
|
4208
|
-
* 0: Success.
|
|
4696
|
+
* 0: Success.
|
|
4697
|
+
* < 0: Failure.
|
|
4209
4698
|
*/
|
|
4210
4699
|
abstract setRemoteRenderMode(
|
|
4211
4700
|
uid: number,
|
|
@@ -4221,20 +4710,27 @@ export abstract class IRtcEngine {
|
|
|
4221
4710
|
* @param mirrorMode The local video mirror mode. See VideoMirrorModeType.
|
|
4222
4711
|
*
|
|
4223
4712
|
* @returns
|
|
4224
|
-
* 0: Success.
|
|
4713
|
+
* 0: Success.
|
|
4714
|
+
* < 0: Failure.
|
|
4225
4715
|
*/
|
|
4226
4716
|
abstract setLocalVideoMirrorMode(mirrorMode: VideoMirrorModeType): number;
|
|
4227
4717
|
|
|
4228
4718
|
/**
|
|
4229
4719
|
* Enables or disables the dual-stream mode on the sender and sets the low-quality video stream.
|
|
4230
4720
|
*
|
|
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:
|
|
4721
|
+
* 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:
|
|
4722
|
+
* High-quality video stream: High bitrate, high resolution.
|
|
4723
|
+
* 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.
|
|
4724
|
+
* 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.
|
|
4725
|
+
* If you need to enable dual video streams in a multi-channel scenario, you can call the enableDualStreamModeEx method.
|
|
4726
|
+
* You can call this method either before or after joining a channel.
|
|
4232
4727
|
*
|
|
4233
|
-
* @param enabled Whether to enable dual-stream mode:true: Enable dual-stream mode.false: (Default) Disable dual-stream mode.
|
|
4728
|
+
* @param enabled Whether to enable dual-stream mode: true : Enable dual-stream mode. false : (Default) Disable dual-stream mode.
|
|
4234
4729
|
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.
|
|
4235
4730
|
*
|
|
4236
4731
|
* @returns
|
|
4237
|
-
* 0: Success.
|
|
4732
|
+
* 0: Success.
|
|
4733
|
+
* < 0: Failure.
|
|
4238
4734
|
*/
|
|
4239
4735
|
abstract enableDualStreamMode(
|
|
4240
4736
|
enabled: boolean,
|
|
@@ -4244,13 +4740,17 @@ export abstract class IRtcEngine {
|
|
|
4244
4740
|
/**
|
|
4245
4741
|
* Sets dual-stream mode configuration on the sender, and sets the low-quality video stream.
|
|
4246
4742
|
*
|
|
4247
|
-
* The difference and connection between this method and is as follows:
|
|
4743
|
+
* The difference and connection between this method and is as follows:
|
|
4744
|
+
* When calling this method and setting mode to DisableSimulcastStream, it has the same effect as (false).
|
|
4745
|
+
* When calling this method and setting mode to EnableSimulcastStream, it has the same effect as (true).
|
|
4746
|
+
* 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. The SDK enables the low-quality video stream auto mode on the sender by default, which is equivalent to calling this method and setting the mode to AutoSimulcastStream. 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).
|
|
4248
4747
|
*
|
|
4249
4748
|
* @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.
|
|
4749
|
+
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
|
|
4251
4750
|
*
|
|
4252
4751
|
* @returns
|
|
4253
|
-
* 0: Success.
|
|
4752
|
+
* 0: Success.
|
|
4753
|
+
* < 0: Failure.
|
|
4254
4754
|
*/
|
|
4255
4755
|
abstract setDualStreamMode(
|
|
4256
4756
|
mode: SimulcastStreamMode,
|
|
@@ -4268,15 +4768,20 @@ export abstract class IRtcEngine {
|
|
|
4268
4768
|
/**
|
|
4269
4769
|
* Sets the format of the captured raw audio data.
|
|
4270
4770
|
*
|
|
4271
|
-
* Sets the audio format for the onRecordAudioFrame callback.
|
|
4771
|
+
* Sets the audio format for the onRecordAudioFrame callback.
|
|
4772
|
+
* Ensure that you call this method before joining a channel.
|
|
4773
|
+
* 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
4774
|
*
|
|
4273
4775
|
* @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:
|
|
4776
|
+
* @param channel The number of channels returned by the SDK. You can set the value as 1 or 2:
|
|
4777
|
+
* 1: Mono.
|
|
4778
|
+
* 2: Stereo.
|
|
4275
4779
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
4276
4780
|
* @param samplesPerCall The number of data samples returned in the SDK, such as 1024 for the Media Push.
|
|
4277
4781
|
*
|
|
4278
4782
|
* @returns
|
|
4279
|
-
* 0: Success.
|
|
4783
|
+
* 0: Success.
|
|
4784
|
+
* < 0: Failure.
|
|
4280
4785
|
*/
|
|
4281
4786
|
abstract setRecordingAudioFrameParameters(
|
|
4282
4787
|
sampleRate: number,
|
|
@@ -4288,15 +4793,20 @@ export abstract class IRtcEngine {
|
|
|
4288
4793
|
/**
|
|
4289
4794
|
* Sets the audio data format for playback.
|
|
4290
4795
|
*
|
|
4291
|
-
* Sets the data format for the onPlaybackAudioFrame callback.
|
|
4796
|
+
* Sets the data format for the onPlaybackAudioFrame callback.
|
|
4797
|
+
* Ensure that you call this method before joining a channel.
|
|
4798
|
+
* 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
4799
|
*
|
|
4293
4800
|
* @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:
|
|
4801
|
+
* @param channel The number of channels returned in the onPlaybackAudioFrame callback:
|
|
4802
|
+
* 1: Mono.
|
|
4803
|
+
* 2: Stereo.
|
|
4295
4804
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
4296
4805
|
* @param samplesPerCall The number of data samples returned in the onPlaybackAudioFrame callback, such as 1024 for the Media Push.
|
|
4297
4806
|
*
|
|
4298
4807
|
* @returns
|
|
4299
|
-
* 0: Success.
|
|
4808
|
+
* 0: Success.
|
|
4809
|
+
* < 0: Failure.
|
|
4300
4810
|
*/
|
|
4301
4811
|
abstract setPlaybackAudioFrameParameters(
|
|
4302
4812
|
sampleRate: number,
|
|
@@ -4313,7 +4823,8 @@ export abstract class IRtcEngine {
|
|
|
4313
4823
|
* @param samplesPerCall Sets the number of samples. In Media Push scenarios, set it as 1024.
|
|
4314
4824
|
*
|
|
4315
4825
|
* @returns
|
|
4316
|
-
* 0: Success.
|
|
4826
|
+
* 0: Success.
|
|
4827
|
+
* < 0: Failure.
|
|
4317
4828
|
*/
|
|
4318
4829
|
abstract setMixedAudioFrameParameters(
|
|
4319
4830
|
sampleRate: number,
|
|
@@ -4324,15 +4835,20 @@ export abstract class IRtcEngine {
|
|
|
4324
4835
|
/**
|
|
4325
4836
|
* Sets the format of the in-ear monitoring raw audio data.
|
|
4326
4837
|
*
|
|
4327
|
-
* This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
|
|
4838
|
+
* This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
|
|
4839
|
+
* Before calling this method, you need to call enableInEarMonitoring, and set includeAudioFilters to EarMonitoringFilterBuiltInAudioFilters or EarMonitoringFilterNoiseSuppression.
|
|
4840
|
+
* 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
4841
|
*
|
|
4329
4842
|
* @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.
|
|
4843
|
+
* @param channel The number of audio channels reported in the onEarMonitoringAudioFrame callback.
|
|
4844
|
+
* 1: Mono.
|
|
4845
|
+
* 2: Stereo.
|
|
4331
4846
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
4332
4847
|
* @param samplesPerCall The number of data samples reported in the onEarMonitoringAudioFrame callback, such as 1,024 for the Media Push.
|
|
4333
4848
|
*
|
|
4334
4849
|
* @returns
|
|
4335
|
-
* 0: Success.
|
|
4850
|
+
* 0: Success.
|
|
4851
|
+
* < 0: Failure.
|
|
4336
4852
|
*/
|
|
4337
4853
|
abstract setEarMonitoringAudioFrameParameters(
|
|
4338
4854
|
sampleRate: number,
|
|
@@ -4345,10 +4861,11 @@ export abstract class IRtcEngine {
|
|
|
4345
4861
|
* Sets the audio data format reported by onPlaybackAudioFrameBeforeMixing.
|
|
4346
4862
|
*
|
|
4347
4863
|
* @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).
|
|
4864
|
+
* @param channel The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
|
|
4349
4865
|
*
|
|
4350
4866
|
* @returns
|
|
4351
|
-
* 0: Success.
|
|
4867
|
+
* 0: Success.
|
|
4868
|
+
* < 0: Failure.
|
|
4352
4869
|
*/
|
|
4353
4870
|
abstract setPlaybackAudioFrameBeforeMixingParameters(
|
|
4354
4871
|
sampleRate: number,
|
|
@@ -4363,17 +4880,20 @@ export abstract class IRtcEngine {
|
|
|
4363
4880
|
* @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
4881
|
*
|
|
4365
4882
|
* @returns
|
|
4366
|
-
* 0: Success.
|
|
4883
|
+
* 0: Success.
|
|
4884
|
+
* < 0: Failure.
|
|
4885
|
+
* -2: Invalid parameters.
|
|
4367
4886
|
*/
|
|
4368
4887
|
abstract enableAudioSpectrumMonitor(intervalInMS?: number): number;
|
|
4369
4888
|
|
|
4370
4889
|
/**
|
|
4371
4890
|
* Disables audio spectrum monitoring.
|
|
4372
4891
|
*
|
|
4373
|
-
* After calling enableAudioSpectrumMonitor
|
|
4892
|
+
* 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
4893
|
*
|
|
4375
4894
|
* @returns
|
|
4376
|
-
* 0: Success.
|
|
4895
|
+
* 0: Success.
|
|
4896
|
+
* < 0: Failure.
|
|
4377
4897
|
*/
|
|
4378
4898
|
abstract disableAudioSpectrumMonitor(): number;
|
|
4379
4899
|
|
|
@@ -4394,10 +4914,11 @@ export abstract class IRtcEngine {
|
|
|
4394
4914
|
/**
|
|
4395
4915
|
* Unregisters the audio spectrum observer.
|
|
4396
4916
|
*
|
|
4397
|
-
* After calling registerAudioSpectrumObserver
|
|
4917
|
+
* 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
4918
|
*
|
|
4399
4919
|
* @returns
|
|
4400
|
-
* 0: Success.
|
|
4920
|
+
* 0: Success.
|
|
4921
|
+
* < 0: Failure.
|
|
4401
4922
|
*/
|
|
4402
4923
|
abstract unregisterAudioSpectrumObserver(
|
|
4403
4924
|
observer: IAudioSpectrumObserver
|
|
@@ -4408,48 +4929,58 @@ export abstract class IRtcEngine {
|
|
|
4408
4929
|
*
|
|
4409
4930
|
* You can call this method either before or after joining a channel.
|
|
4410
4931
|
*
|
|
4411
|
-
* @param volume The volume of the user. The value range is [0,400].
|
|
4932
|
+
* @param volume The volume of the user. The value range is [0,400].
|
|
4933
|
+
* 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4934
|
+
* 100: (Default) The original volume.
|
|
4935
|
+
* 400: Four times the original volume (amplifying the audio signals by four times).
|
|
4412
4936
|
*
|
|
4413
4937
|
* @returns
|
|
4414
|
-
* 0: Success.
|
|
4938
|
+
* 0: Success.
|
|
4939
|
+
* < 0: Failure.
|
|
4415
4940
|
*/
|
|
4416
4941
|
abstract adjustRecordingSignalVolume(volume: number): number;
|
|
4417
4942
|
|
|
4418
4943
|
/**
|
|
4419
4944
|
* Whether to mute the recording signal.
|
|
4420
4945
|
*
|
|
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.
|
|
4946
|
+
* @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
4947
|
*
|
|
4423
4948
|
* @returns
|
|
4424
|
-
* 0: Success.
|
|
4949
|
+
* 0: Success.
|
|
4950
|
+
* < 0: Failure.
|
|
4425
4951
|
*/
|
|
4426
4952
|
abstract muteRecordingSignal(mute: boolean): number;
|
|
4427
4953
|
|
|
4428
4954
|
/**
|
|
4429
4955
|
* Adjusts the playback signal volume of all remote users.
|
|
4430
4956
|
*
|
|
4431
|
-
* This method adjusts the playback volume that is the mixed volume of all remote users.
|
|
4957
|
+
* This method adjusts the playback volume that is the mixed volume of all remote users.
|
|
4958
|
+
* You can call this method either before or after joining a channel.
|
|
4432
4959
|
*
|
|
4433
4960
|
* @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.
|
|
4961
|
+
* 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4435
4962
|
* 100: (Default) The original volume.
|
|
4436
4963
|
* 400: Four times the original volume (amplifying the audio signals by four times).
|
|
4437
4964
|
*
|
|
4438
4965
|
* @returns
|
|
4439
|
-
* 0: Success.
|
|
4966
|
+
* 0: Success.
|
|
4967
|
+
* < 0: Failure.
|
|
4440
4968
|
*/
|
|
4441
4969
|
abstract adjustPlaybackSignalVolume(volume: number): number;
|
|
4442
4970
|
|
|
4443
4971
|
/**
|
|
4444
4972
|
* Adjusts the playback signal volume of a specified remote user.
|
|
4445
4973
|
*
|
|
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.
|
|
4974
|
+
* 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.
|
|
4975
|
+
* Call this method after joining a channel.
|
|
4976
|
+
* The playback volume here refers to the mixed volume of a specified remote user.
|
|
4447
4977
|
*
|
|
4448
4978
|
* @param uid The user ID of the remote user.
|
|
4449
4979
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
4450
4980
|
*
|
|
4451
4981
|
* @returns
|
|
4452
|
-
* 0: Success.
|
|
4982
|
+
* 0: Success.
|
|
4983
|
+
* < 0: Failure.
|
|
4453
4984
|
*/
|
|
4454
4985
|
abstract adjustUserPlaybackSignalVolume(uid: number, volume: number): number;
|
|
4455
4986
|
|
|
@@ -4477,13 +5008,17 @@ export abstract class IRtcEngine {
|
|
|
4477
5008
|
/**
|
|
4478
5009
|
* Enables loopback audio capturing.
|
|
4479
5010
|
*
|
|
4480
|
-
* If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
|
|
5011
|
+
* If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
|
|
5012
|
+
* 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.
|
|
5013
|
+
* You can call this method either before or after joining a channel.
|
|
4481
5014
|
*
|
|
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.
|
|
5015
|
+
* @param enabled Whether to enable loopback audio capturing. true : Enable loopback audio capturing. false : (Default) Disable loopback audio capturing.
|
|
5016
|
+
* @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.
|
|
5017
|
+
* 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
5018
|
*
|
|
4485
5019
|
* @returns
|
|
4486
|
-
* 0: Success.
|
|
5020
|
+
* 0: Success.
|
|
5021
|
+
* < 0: Failure.
|
|
4487
5022
|
*/
|
|
4488
5023
|
abstract enableLoopbackRecording(
|
|
4489
5024
|
enabled: boolean,
|
|
@@ -4498,7 +5033,8 @@ export abstract class IRtcEngine {
|
|
|
4498
5033
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
4499
5034
|
*
|
|
4500
5035
|
* @returns
|
|
4501
|
-
* 0: Success.
|
|
5036
|
+
* 0: Success.
|
|
5037
|
+
* < 0: Failure.
|
|
4502
5038
|
*/
|
|
4503
5039
|
abstract adjustLoopbackSignalVolume(volume: number): number;
|
|
4504
5040
|
|
|
@@ -4510,13 +5046,17 @@ export abstract class IRtcEngine {
|
|
|
4510
5046
|
/**
|
|
4511
5047
|
* Enables in-ear monitoring.
|
|
4512
5048
|
*
|
|
4513
|
-
* This method enables or disables in-ear monitoring.
|
|
5049
|
+
* This method enables or disables in-ear monitoring.
|
|
5050
|
+
* Users must use earphones (wired or Bluetooth) to hear the in-ear monitoring effect.
|
|
5051
|
+
* You can call this method either before or after joining a channel.
|
|
4514
5052
|
*
|
|
4515
|
-
* @param enabled Enables or disables in-ear monitoring.true: Enables in-ear monitoring.false: (Default) Disables in-ear monitoring.
|
|
5053
|
+
* @param enabled Enables or disables in-ear monitoring. true : Enables in-ear monitoring. false : (Default) Disables in-ear monitoring.
|
|
4516
5054
|
* @param includeAudioFilters The audio filter of in-ear monitoring: See EarMonitoringFilterType.
|
|
4517
5055
|
*
|
|
4518
5056
|
* @returns
|
|
4519
|
-
* 0: Success.
|
|
5057
|
+
* 0: Success.
|
|
5058
|
+
* < 0: Failure.
|
|
5059
|
+
* - 8: Make sure the current audio routing is Bluetooth or headset.
|
|
4520
5060
|
*/
|
|
4521
5061
|
abstract enableInEarMonitoring(
|
|
4522
5062
|
enabled: boolean,
|
|
@@ -4526,7 +5066,8 @@ export abstract class IRtcEngine {
|
|
|
4526
5066
|
/**
|
|
4527
5067
|
* Sets the volume of the in-ear monitor.
|
|
4528
5068
|
*
|
|
4529
|
-
* Users must use wired earphones to hear their own voices.
|
|
5069
|
+
* Users must use wired earphones to hear their own voices.
|
|
5070
|
+
* You can call this method either before or after joining a channel.
|
|
4530
5071
|
*
|
|
4531
5072
|
* @param volume The volume of the in-ear monitor. The value ranges between 0 and 100. The default value is 100.
|
|
4532
5073
|
*
|
|
@@ -4541,10 +5082,11 @@ export abstract class IRtcEngine {
|
|
|
4541
5082
|
* This method applies to Windows only.
|
|
4542
5083
|
*
|
|
4543
5084
|
* @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.
|
|
5085
|
+
* @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
5086
|
*
|
|
4546
5087
|
* @returns
|
|
4547
|
-
* 0: Success.
|
|
5088
|
+
* 0: Success.
|
|
5089
|
+
* < 0: Failure.
|
|
4548
5090
|
*/
|
|
4549
5091
|
abstract loadExtensionProvider(
|
|
4550
5092
|
path: string,
|
|
@@ -4554,14 +5096,15 @@ export abstract class IRtcEngine {
|
|
|
4554
5096
|
/**
|
|
4555
5097
|
* Sets the properties of the extension provider.
|
|
4556
5098
|
*
|
|
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
|
|
5099
|
+
* 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
5100
|
*
|
|
4559
5101
|
* @param provider The name of the extension provider.
|
|
4560
5102
|
* @param key The key of the extension.
|
|
4561
5103
|
* @param value The value of the extension key.
|
|
4562
5104
|
*
|
|
4563
5105
|
* @returns
|
|
4564
|
-
* 0: Success.
|
|
5106
|
+
* 0: Success.
|
|
5107
|
+
* < 0: Failure.
|
|
4565
5108
|
*/
|
|
4566
5109
|
abstract setExtensionProviderProperty(
|
|
4567
5110
|
provider: string,
|
|
@@ -4576,12 +5119,13 @@ export abstract class IRtcEngine {
|
|
|
4576
5119
|
*
|
|
4577
5120
|
* @param provider The name of the extension provider.
|
|
4578
5121
|
* @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:
|
|
5122
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
4580
5123
|
* The default value is UnknownMediaSource.
|
|
4581
5124
|
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
4582
5125
|
*
|
|
4583
5126
|
* @returns
|
|
4584
|
-
* 0: Success.
|
|
5127
|
+
* 0: Success.
|
|
5128
|
+
* < 0: Failure.
|
|
4585
5129
|
*/
|
|
4586
5130
|
abstract registerExtension(
|
|
4587
5131
|
provider: string,
|
|
@@ -4592,15 +5136,21 @@ export abstract class IRtcEngine {
|
|
|
4592
5136
|
/**
|
|
4593
5137
|
* Enables or disables extensions.
|
|
4594
5138
|
*
|
|
4595
|
-
* To call this method, call it immediately after initializing the IRtcEngine object.
|
|
5139
|
+
* To call this method, call it immediately after initializing the IRtcEngine object.
|
|
5140
|
+
* If you want to enable multiple extensions, you need to call this method multiple times.
|
|
5141
|
+
* 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
5142
|
*
|
|
4597
5143
|
* @param provider The name of the extension provider.
|
|
4598
5144
|
* @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:
|
|
5145
|
+
* @param enable Whether to enable the extension: true : Enable the extension. false : Disable the extension.
|
|
5146
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
5147
|
+
* The default value is UnknownMediaSource.
|
|
5148
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
4601
5149
|
*
|
|
4602
5150
|
* @returns
|
|
4603
|
-
* 0: Success.
|
|
5151
|
+
* 0: Success.
|
|
5152
|
+
* < 0: Failure.
|
|
5153
|
+
* -3: The extension library is not loaded. Agora recommends that you check the storage location or the name of the dynamic library.
|
|
4604
5154
|
*/
|
|
4605
5155
|
abstract enableExtension(
|
|
4606
5156
|
provider: string,
|
|
@@ -4621,7 +5171,8 @@ export abstract class IRtcEngine {
|
|
|
4621
5171
|
* @param type The type of the video source, see MediaSourceType.
|
|
4622
5172
|
*
|
|
4623
5173
|
* @returns
|
|
4624
|
-
* 0: Success.
|
|
5174
|
+
* 0: Success.
|
|
5175
|
+
* < 0: Failure.
|
|
4625
5176
|
*/
|
|
4626
5177
|
abstract setExtensionProperty(
|
|
4627
5178
|
provider: string,
|
|
@@ -4641,7 +5192,8 @@ export abstract class IRtcEngine {
|
|
|
4641
5192
|
* @param type Source type of the extension. See MediaSourceType.
|
|
4642
5193
|
*
|
|
4643
5194
|
* @returns
|
|
4644
|
-
* The extension information, if the method call succeeds.
|
|
5195
|
+
* The extension information, if the method call succeeds.
|
|
5196
|
+
* An empty string, if the method call fails.
|
|
4645
5197
|
*/
|
|
4646
5198
|
abstract getExtensionProperty(
|
|
4647
5199
|
provider: string,
|
|
@@ -4661,10 +5213,14 @@ export abstract class IRtcEngine {
|
|
|
4661
5213
|
/**
|
|
4662
5214
|
* Creates a customized video track.
|
|
4663
5215
|
*
|
|
4664
|
-
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
|
|
5216
|
+
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
|
|
5217
|
+
* Call this method to create a video track and get the video track ID.
|
|
5218
|
+
* 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.
|
|
5219
|
+
* 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
5220
|
*
|
|
4666
5221
|
* @returns
|
|
4667
|
-
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.
|
|
5222
|
+
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.
|
|
5223
|
+
* If the method call fails, a negative value is returned.
|
|
4668
5224
|
*/
|
|
4669
5225
|
abstract createCustomVideoTrack(): number;
|
|
4670
5226
|
|
|
@@ -4679,7 +5235,8 @@ export abstract class IRtcEngine {
|
|
|
4679
5235
|
* @param videoTrackId The video track ID returned by calling the createCustomVideoTrack method.
|
|
4680
5236
|
*
|
|
4681
5237
|
* @returns
|
|
4682
|
-
* 0: Success.
|
|
5238
|
+
* 0: Success.
|
|
5239
|
+
* < 0: Failure.
|
|
4683
5240
|
*/
|
|
4684
5241
|
abstract destroyCustomVideoTrack(videoTrackId: number): number;
|
|
4685
5242
|
|
|
@@ -4772,7 +5329,7 @@ export abstract class IRtcEngine {
|
|
|
4772
5329
|
/**
|
|
4773
5330
|
* @ignore
|
|
4774
5331
|
*/
|
|
4775
|
-
abstract setCameraExposureFactor(
|
|
5332
|
+
abstract setCameraExposureFactor(factor: number): number;
|
|
4776
5333
|
|
|
4777
5334
|
/**
|
|
4778
5335
|
* @ignore
|
|
@@ -4813,7 +5370,7 @@ export abstract class IRtcEngine {
|
|
|
4813
5370
|
*
|
|
4814
5371
|
* @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
5372
|
* @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.
|
|
5373
|
+
* @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
5374
|
*
|
|
4818
5375
|
* @returns
|
|
4819
5376
|
* The ScreenCaptureSourceInfo array.
|
|
@@ -4834,14 +5391,19 @@ export abstract class IRtcEngine {
|
|
|
4834
5391
|
/**
|
|
4835
5392
|
* Captures the screen by specifying the display ID.
|
|
4836
5393
|
*
|
|
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:
|
|
5394
|
+
* 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:
|
|
5395
|
+
* 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.
|
|
5396
|
+
* Call this method after joining a channel, and then call updateChannelMediaOptions and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing.
|
|
4838
5397
|
*
|
|
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.
|
|
5398
|
+
* @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
5399
|
* @param regionRect (Optional) Sets the relative location of the region to the screen. Pass in nil to share the entire screen.
|
|
4841
5400
|
* @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
5401
|
*
|
|
4843
5402
|
* @returns
|
|
4844
|
-
* 0: Success.
|
|
5403
|
+
* 0: Success.
|
|
5404
|
+
* < 0: Failure.
|
|
5405
|
+
* -2: The parameter is invalid.
|
|
5406
|
+
* -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
5407
|
*/
|
|
4846
5408
|
abstract startScreenCaptureByDisplayId(
|
|
4847
5409
|
displayId: number,
|
|
@@ -4852,14 +5414,19 @@ export abstract class IRtcEngine {
|
|
|
4852
5414
|
/**
|
|
4853
5415
|
* Captures the whole or part of a screen by specifying the screen rect.
|
|
4854
5416
|
*
|
|
4855
|
-
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5417
|
+
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5418
|
+
* 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.
|
|
5419
|
+
* 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
5420
|
*
|
|
4857
5421
|
* @param screenRect Sets the relative location of the screen to the virtual screen.
|
|
4858
5422
|
* @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.
|
|
4859
5423
|
* @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
5424
|
*
|
|
4861
5425
|
* @returns
|
|
4862
|
-
* 0: Success.
|
|
5426
|
+
* 0: Success.
|
|
5427
|
+
* < 0: Failure.
|
|
5428
|
+
* -2: The parameter is invalid.
|
|
5429
|
+
* -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
5430
|
*/
|
|
4864
5431
|
abstract startScreenCaptureByScreenRect(
|
|
4865
5432
|
screenRect: Rectangle,
|
|
@@ -4870,24 +5437,33 @@ export abstract class IRtcEngine {
|
|
|
4870
5437
|
/**
|
|
4871
5438
|
* Gets the audio device information.
|
|
4872
5439
|
*
|
|
4873
|
-
* After calling this method, you can get whether the audio device supports ultra-low-latency capture and playback.
|
|
5440
|
+
* After calling this method, you can get whether the audio device supports ultra-low-latency capture and playback.
|
|
5441
|
+
* You can call this method either before or after joining a channel.
|
|
4874
5442
|
*
|
|
4875
5443
|
* @returns
|
|
4876
|
-
* The DeviceInfo object that identifies the audio device information.
|
|
5444
|
+
* The DeviceInfo object that identifies the audio device information.
|
|
5445
|
+
* Not null: Success.
|
|
5446
|
+
* Null: Failure.
|
|
4877
5447
|
*/
|
|
4878
5448
|
abstract getAudioDeviceInfo(): DeviceInfo;
|
|
4879
5449
|
|
|
4880
5450
|
/**
|
|
4881
5451
|
* Captures the whole or part of a window by specifying the window ID.
|
|
4882
5452
|
*
|
|
4883
|
-
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5453
|
+
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
5454
|
+
* 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.
|
|
5455
|
+
* 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.
|
|
5456
|
+
* 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
5457
|
*
|
|
4885
5458
|
* @param windowId The ID of the window to be shared.
|
|
4886
5459
|
* @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
5460
|
* @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
5461
|
*
|
|
4889
5462
|
* @returns
|
|
4890
|
-
* 0: Success.
|
|
5463
|
+
* 0: Success.
|
|
5464
|
+
* < 0: Failure.
|
|
5465
|
+
* -2: The parameter is invalid.
|
|
5466
|
+
* -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
5467
|
*/
|
|
4892
5468
|
abstract startScreenCaptureByWindowId(
|
|
4893
5469
|
windowId: any,
|
|
@@ -4898,12 +5474,13 @@ export abstract class IRtcEngine {
|
|
|
4898
5474
|
/**
|
|
4899
5475
|
* Sets the content hint for screen sharing.
|
|
4900
5476
|
*
|
|
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
|
|
5477
|
+
* 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
5478
|
*
|
|
4903
5479
|
* @param contentHint The content hint for screen sharing. See VideoContentHint.
|
|
4904
5480
|
*
|
|
4905
5481
|
* @returns
|
|
4906
|
-
* 0: Success.
|
|
5482
|
+
* 0: Success.
|
|
5483
|
+
* < 0: Failure.
|
|
4907
5484
|
* -2: The parameter is invalid.
|
|
4908
5485
|
* -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
5486
|
*/
|
|
@@ -4917,7 +5494,10 @@ export abstract class IRtcEngine {
|
|
|
4917
5494
|
* @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
5495
|
*
|
|
4919
5496
|
* @returns
|
|
4920
|
-
* 0: Success.
|
|
5497
|
+
* 0: Success.
|
|
5498
|
+
* < 0: Failure.
|
|
5499
|
+
* -2: The parameter is invalid.
|
|
5500
|
+
* -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
5501
|
*/
|
|
4922
5502
|
abstract updateScreenCaptureRegion(regionRect: Rectangle): number;
|
|
4923
5503
|
|
|
@@ -4929,7 +5509,8 @@ export abstract class IRtcEngine {
|
|
|
4929
5509
|
* @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
5510
|
*
|
|
4931
5511
|
* @returns
|
|
4932
|
-
* 0: Success.
|
|
5512
|
+
* 0: Success.
|
|
5513
|
+
* < 0: Failure.
|
|
4933
5514
|
* -2: The parameter is invalid.
|
|
4934
5515
|
* -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
5516
|
*/
|
|
@@ -4945,9 +5526,12 @@ export abstract class IRtcEngine {
|
|
|
4945
5526
|
/**
|
|
4946
5527
|
* Starts screen capture.
|
|
4947
5528
|
*
|
|
4948
|
-
* This method, as well as startScreenCaptureByDisplayId and startScreenCaptureByWindowId
|
|
5529
|
+
* 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.
|
|
5530
|
+
* If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
|
|
4949
5531
|
*
|
|
4950
|
-
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5532
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5533
|
+
* Windows supports up to four screen capture video streams.
|
|
5534
|
+
* macOS supports only one screen capture video stream. You can only set this parameter to VideoSourceScreen (2).
|
|
4951
5535
|
* @param config The configuration of the captured screen. See ScreenCaptureConfiguration.
|
|
4952
5536
|
*/
|
|
4953
5537
|
abstract startScreenCaptureBySourceType(
|
|
@@ -4963,7 +5547,7 @@ export abstract class IRtcEngine {
|
|
|
4963
5547
|
/**
|
|
4964
5548
|
* @ignore
|
|
4965
5549
|
*/
|
|
4966
|
-
abstract queryScreenCaptureCapability():
|
|
5550
|
+
abstract queryScreenCaptureCapability(): number;
|
|
4967
5551
|
|
|
4968
5552
|
/**
|
|
4969
5553
|
* Sets the screen sharing scenario.
|
|
@@ -4973,7 +5557,8 @@ export abstract class IRtcEngine {
|
|
|
4973
5557
|
* @param screenScenario The screen sharing scenario. See ScreenScenarioType.
|
|
4974
5558
|
*
|
|
4975
5559
|
* @returns
|
|
4976
|
-
* 0: Success.
|
|
5560
|
+
* 0: Success.
|
|
5561
|
+
* < 0: Failure.
|
|
4977
5562
|
*/
|
|
4978
5563
|
abstract setScreenCaptureScenario(screenScenario: ScreenScenarioType): number;
|
|
4979
5564
|
|
|
@@ -4981,29 +5566,33 @@ export abstract class IRtcEngine {
|
|
|
4981
5566
|
* Stops screen capture.
|
|
4982
5567
|
*
|
|
4983
5568
|
* @returns
|
|
4984
|
-
* 0: Success.
|
|
5569
|
+
* 0: Success.
|
|
5570
|
+
* < 0: Failure.
|
|
4985
5571
|
*/
|
|
4986
5572
|
abstract stopScreenCapture(): number;
|
|
4987
5573
|
|
|
4988
5574
|
/**
|
|
4989
5575
|
* Stops screen capture.
|
|
4990
5576
|
*
|
|
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.
|
|
5577
|
+
* 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.
|
|
5578
|
+
* 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
5579
|
*
|
|
4993
5580
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4994
5581
|
*
|
|
4995
5582
|
* @returns
|
|
4996
|
-
* 0: Success.
|
|
5583
|
+
* 0: Success.
|
|
5584
|
+
* < 0: Failure.
|
|
4997
5585
|
*/
|
|
4998
5586
|
abstract stopScreenCaptureBySourceType(sourceType: VideoSourceType): number;
|
|
4999
5587
|
|
|
5000
5588
|
/**
|
|
5001
5589
|
* Retrieves the call ID.
|
|
5002
5590
|
*
|
|
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
|
|
5591
|
+
* 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
5592
|
*
|
|
5005
5593
|
* @returns
|
|
5006
|
-
* The current call ID, if the method succeeds.
|
|
5594
|
+
* The current call ID, if the method succeeds.
|
|
5595
|
+
* An empty string, if the method call fails.
|
|
5007
5596
|
*/
|
|
5008
5597
|
abstract getCallId(): string;
|
|
5009
5598
|
|
|
@@ -5017,7 +5606,10 @@ export abstract class IRtcEngine {
|
|
|
5017
5606
|
* @param description A description of the call. The string length should be less than 800 bytes.
|
|
5018
5607
|
*
|
|
5019
5608
|
* @returns
|
|
5020
|
-
* 0: Success.
|
|
5609
|
+
* 0: Success.
|
|
5610
|
+
* < 0: Failure.
|
|
5611
|
+
* -2 (ERR_INVALID_ARGUMENT).
|
|
5612
|
+
* -3 (ERR_NOT_READY).
|
|
5021
5613
|
*/
|
|
5022
5614
|
abstract rate(callId: string, rating: number, description: string): number;
|
|
5023
5615
|
|
|
@@ -5030,32 +5622,54 @@ export abstract class IRtcEngine {
|
|
|
5030
5622
|
* @param description A description of the call. The string length should be less than 800 bytes.
|
|
5031
5623
|
*
|
|
5032
5624
|
* @returns
|
|
5033
|
-
* 0: Success.
|
|
5625
|
+
* 0: Success.
|
|
5626
|
+
* < 0: Failure.
|
|
5627
|
+
* -2: The parameter is invalid.
|
|
5628
|
+
* - 3: The SDK is not ready. Possible reasons include the following:
|
|
5629
|
+
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
|
|
5630
|
+
* No user has joined the channel when the method is called. Please check your code logic.
|
|
5631
|
+
* The user has not left the channel when the rate or complain method is called. Please check your code logic.
|
|
5632
|
+
* The audio module is disabled. The program is not complete.
|
|
5034
5633
|
*/
|
|
5035
5634
|
abstract complain(callId: string, description: string): number;
|
|
5036
5635
|
|
|
5037
5636
|
/**
|
|
5038
5637
|
* Starts pushing media streams to a CDN without transcoding.
|
|
5039
5638
|
*
|
|
5040
|
-
* Ensure that you enable the Media Push service before using this function. See Enable Media Push
|
|
5639
|
+
* Ensure that you enable the Media Push service before using this function. See Enable Media Push.
|
|
5640
|
+
* Call this method after joining a channel.
|
|
5641
|
+
* Only hosts in the LIVE_BROADCASTING profile can call this method.
|
|
5642
|
+
* 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
5643
|
*
|
|
5042
5644
|
* @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
5645
|
*
|
|
5044
5646
|
* @returns
|
|
5045
|
-
* 0: Success.
|
|
5647
|
+
* 0: Success.
|
|
5648
|
+
* < 0: Failure.
|
|
5649
|
+
* -2: The URL is null or the string length is 0.
|
|
5650
|
+
* -7: The SDK is not initialized before calling this method.
|
|
5651
|
+
* -19: The Media Push URL is already in use, use another URL instead.
|
|
5046
5652
|
*/
|
|
5047
5653
|
abstract startRtmpStreamWithoutTranscoding(url: string): number;
|
|
5048
5654
|
|
|
5049
5655
|
/**
|
|
5050
5656
|
* Starts Media Push and sets the transcoding configuration.
|
|
5051
5657
|
*
|
|
5052
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
5658
|
+
* 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.
|
|
5659
|
+
* Ensure that you enable the Media Push service before using this function. See Enable Media Push.
|
|
5660
|
+
* Call this method after joining a channel.
|
|
5661
|
+
* Only hosts in the LIVE_BROADCASTING profile can call this method.
|
|
5662
|
+
* 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
5663
|
*
|
|
5054
5664
|
* @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
5665
|
* @param transcoding The transcoding configuration for Media Push. See LiveTranscoding.
|
|
5056
5666
|
*
|
|
5057
5667
|
* @returns
|
|
5058
|
-
* 0: Success.
|
|
5668
|
+
* 0: Success.
|
|
5669
|
+
* < 0: Failure.
|
|
5670
|
+
* -2: The URL is null or the string length is 0.
|
|
5671
|
+
* -7: The SDK is not initialized before calling this method.
|
|
5672
|
+
* -19: The Media Push URL is already in use, use another URL instead.
|
|
5059
5673
|
*/
|
|
5060
5674
|
abstract startRtmpStreamWithTranscoding(
|
|
5061
5675
|
url: string,
|
|
@@ -5065,36 +5679,47 @@ export abstract class IRtcEngine {
|
|
|
5065
5679
|
/**
|
|
5066
5680
|
* Updates the transcoding configuration.
|
|
5067
5681
|
*
|
|
5068
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
5682
|
+
* 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
5683
|
*
|
|
5070
5684
|
* @param transcoding The transcoding configuration for Media Push. See LiveTranscoding.
|
|
5071
5685
|
*
|
|
5072
5686
|
* @returns
|
|
5073
|
-
* 0: Success.
|
|
5687
|
+
* 0: Success.
|
|
5688
|
+
* < 0: Failure.
|
|
5074
5689
|
*/
|
|
5075
5690
|
abstract updateRtmpTranscoding(transcoding: LiveTranscoding): number;
|
|
5076
5691
|
|
|
5077
5692
|
/**
|
|
5078
5693
|
* Stops pushing media streams to a CDN.
|
|
5079
5694
|
*
|
|
5080
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
5695
|
+
* 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
5696
|
*
|
|
5082
5697
|
* @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
5698
|
*
|
|
5084
5699
|
* @returns
|
|
5085
|
-
* 0: Success.
|
|
5700
|
+
* 0: Success.
|
|
5701
|
+
* < 0: Failure.
|
|
5086
5702
|
*/
|
|
5087
5703
|
abstract stopRtmpStream(url: string): number;
|
|
5088
5704
|
|
|
5089
5705
|
/**
|
|
5090
5706
|
* Starts the local video mixing.
|
|
5091
5707
|
*
|
|
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.
|
|
5708
|
+
* 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.
|
|
5709
|
+
* Local video mixing requires more CPU resources. Therefore, Agora recommends enabling this function on devices with higher performance.
|
|
5710
|
+
* If you need to mix locally captured video streams, the SDK supports the following capture combinations:
|
|
5711
|
+
* On the Windows platform, it supports up to 4 video streams captured by cameras + 4 screen sharing streams.
|
|
5712
|
+
* On the macOS platform, it supports up to 4 video streams captured by cameras + 1 screen sharing stream.
|
|
5713
|
+
* If you need to mix the locally collected video streams, you need to call this method after startCameraCapture or startScreenCaptureBySourceType
|
|
5714
|
+
* 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
5715
|
*
|
|
5094
|
-
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
5716
|
+
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
5717
|
+
* 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.
|
|
5718
|
+
* The maximum resolution of the mixed video stream is 4096 × 2160.
|
|
5095
5719
|
*
|
|
5096
5720
|
* @returns
|
|
5097
|
-
* 0: Success.
|
|
5721
|
+
* 0: Success.
|
|
5722
|
+
* < 0: Failure.
|
|
5098
5723
|
*/
|
|
5099
5724
|
abstract startLocalVideoTranscoder(
|
|
5100
5725
|
config: LocalTranscoderConfiguration
|
|
@@ -5103,12 +5728,13 @@ export abstract class IRtcEngine {
|
|
|
5103
5728
|
/**
|
|
5104
5729
|
* Updates the local video mixing configuration.
|
|
5105
5730
|
*
|
|
5106
|
-
* After calling startLocalVideoTranscoder
|
|
5731
|
+
* 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
5732
|
*
|
|
5108
5733
|
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
5109
5734
|
*
|
|
5110
5735
|
* @returns
|
|
5111
|
-
* 0: Success.
|
|
5736
|
+
* 0: Success.
|
|
5737
|
+
* < 0: Failure.
|
|
5112
5738
|
*/
|
|
5113
5739
|
abstract updateLocalTranscoderConfiguration(
|
|
5114
5740
|
config: LocalTranscoderConfiguration
|
|
@@ -5117,16 +5743,17 @@ export abstract class IRtcEngine {
|
|
|
5117
5743
|
/**
|
|
5118
5744
|
* Stops the local video mixing.
|
|
5119
5745
|
*
|
|
5120
|
-
* After calling startLocalVideoTranscoder
|
|
5746
|
+
* After calling startLocalVideoTranscoder, call this method if you want to stop the local video mixing.
|
|
5121
5747
|
*/
|
|
5122
5748
|
abstract stopLocalVideoTranscoder(): number;
|
|
5123
5749
|
|
|
5124
5750
|
/**
|
|
5125
5751
|
* Starts camera capture.
|
|
5126
5752
|
*
|
|
5127
|
-
* You can call this method to start capturing video from one or more cameras by specifying sourceType
|
|
5753
|
+
* You can call this method to start capturing video from one or more cameras by specifying sourceType.
|
|
5128
5754
|
*
|
|
5129
|
-
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5755
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5756
|
+
* On the desktop platforms, you can capture video from up to 4 cameras.
|
|
5130
5757
|
* @param config The configuration of the video capture. See CameraCapturerConfiguration.
|
|
5131
5758
|
*/
|
|
5132
5759
|
abstract startCameraCapture(
|
|
@@ -5142,20 +5769,23 @@ export abstract class IRtcEngine {
|
|
|
5142
5769
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5143
5770
|
*
|
|
5144
5771
|
* @returns
|
|
5145
|
-
* 0: Success.
|
|
5772
|
+
* 0: Success.
|
|
5773
|
+
* < 0: Failure.
|
|
5146
5774
|
*/
|
|
5147
5775
|
abstract stopCameraCapture(sourceType: VideoSourceType): number;
|
|
5148
5776
|
|
|
5149
5777
|
/**
|
|
5150
5778
|
* Sets the rotation angle of the captured video.
|
|
5151
5779
|
*
|
|
5152
|
-
* This method applies to Windows only.
|
|
5780
|
+
* This method applies to Windows only.
|
|
5781
|
+
* 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
5782
|
*
|
|
5154
5783
|
* @param type The video source type. See VideoSourceType.
|
|
5155
5784
|
* @param orientation The clockwise rotation angle. See VideoOrientation.
|
|
5156
5785
|
*
|
|
5157
5786
|
* @returns
|
|
5158
|
-
* 0: Success.
|
|
5787
|
+
* 0: Success.
|
|
5788
|
+
* < 0: Failure.
|
|
5159
5789
|
*/
|
|
5160
5790
|
abstract setCameraDeviceOrientation(
|
|
5161
5791
|
type: VideoSourceType,
|
|
@@ -5176,7 +5806,7 @@ export abstract class IRtcEngine {
|
|
|
5176
5806
|
* You can call this method either before or after joining a channel.
|
|
5177
5807
|
*
|
|
5178
5808
|
* @returns
|
|
5179
|
-
* The current connection state. See ConnectionStateType
|
|
5809
|
+
* The current connection state. See ConnectionStateType.
|
|
5180
5810
|
*/
|
|
5181
5811
|
abstract getConnectionState(): ConnectionStateType;
|
|
5182
5812
|
|
|
@@ -5218,24 +5848,35 @@ export abstract class IRtcEngine {
|
|
|
5218
5848
|
/**
|
|
5219
5849
|
* Sets the built-in encryption mode.
|
|
5220
5850
|
*
|
|
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
|
|
5851
|
+
* 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
5852
|
*
|
|
5223
|
-
* @param encryptionMode The following encryption modes:
|
|
5853
|
+
* @param encryptionMode The following encryption modes:
|
|
5854
|
+
* " aes-128-xts ": 128-bit AES encryption, XTS mode.
|
|
5855
|
+
* " aes-128-ecb ": 128-bit AES encryption, ECB mode.
|
|
5856
|
+
* " aes-256-xts ": 256-bit AES encryption, XTS mode.
|
|
5857
|
+
* " sm4-128-ecb ": 128-bit SM4 encryption, ECB mode.
|
|
5858
|
+
* " aes-128-gcm ": 128-bit AES encryption, GCM mode.
|
|
5859
|
+
* " aes-256-gcm ": 256-bit AES encryption, GCM mode.
|
|
5860
|
+
* "": When this parameter is set as null, the encryption mode is set as " aes-128-gcm " by default.
|
|
5224
5861
|
*
|
|
5225
5862
|
* @returns
|
|
5226
|
-
* 0: Success.
|
|
5863
|
+
* 0: Success.
|
|
5864
|
+
* < 0: Failure.
|
|
5227
5865
|
*/
|
|
5228
5866
|
abstract setEncryptionMode(encryptionMode: string): number;
|
|
5229
5867
|
|
|
5230
5868
|
/**
|
|
5231
5869
|
* Enables built-in encryption with an encryption password before users join a channel.
|
|
5232
5870
|
*
|
|
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
|
|
5871
|
+
* 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.
|
|
5872
|
+
* Do not use this method for Media Push.
|
|
5873
|
+
* 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
5874
|
*
|
|
5235
5875
|
* @param secret The encryption password.
|
|
5236
5876
|
*
|
|
5237
5877
|
* @returns
|
|
5238
|
-
* 0: Success.
|
|
5878
|
+
* 0: Success.
|
|
5879
|
+
* < 0: Failure.
|
|
5239
5880
|
*/
|
|
5240
5881
|
abstract setEncryptionSecret(secret: string): number;
|
|
5241
5882
|
|
|
@@ -5244,11 +5885,15 @@ export abstract class IRtcEngine {
|
|
|
5244
5885
|
*
|
|
5245
5886
|
* 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
5887
|
*
|
|
5247
|
-
* @param enabled Whether to enable built-in encryption:true: Enable the built-in encryption.false: Disable the built-in encryption.
|
|
5888
|
+
* @param enabled Whether to enable built-in encryption: true : Enable the built-in encryption. false : Disable the built-in encryption.
|
|
5248
5889
|
* @param config Built-in encryption configurations. See EncryptionConfig.
|
|
5249
5890
|
*
|
|
5250
5891
|
* @returns
|
|
5251
|
-
* 0: Success.
|
|
5892
|
+
* 0: Success.
|
|
5893
|
+
* < 0: Failure.
|
|
5894
|
+
* -2: An invalid parameter is used. Set the parameter with a valid value.
|
|
5895
|
+
* -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.
|
|
5896
|
+
* -7: The SDK is not initialized. Initialize the IRtcEngine instance before calling this method.
|
|
5252
5897
|
*/
|
|
5253
5898
|
abstract enableEncryption(enabled: boolean, config: EncryptionConfig): number;
|
|
5254
5899
|
|
|
@@ -5260,22 +5905,29 @@ export abstract class IRtcEngine {
|
|
|
5260
5905
|
* @param config The configurations for the data stream. See DataStreamConfig.
|
|
5261
5906
|
*
|
|
5262
5907
|
* @returns
|
|
5263
|
-
* ID of the created data stream, if the method call succeeds.
|
|
5908
|
+
* ID of the created data stream, if the method call succeeds.
|
|
5909
|
+
* < 0: Failure.
|
|
5264
5910
|
*/
|
|
5265
5911
|
abstract createDataStream(config: DataStreamConfig): number;
|
|
5266
5912
|
|
|
5267
5913
|
/**
|
|
5268
5914
|
* Sends data stream messages.
|
|
5269
5915
|
*
|
|
5270
|
-
* Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
|
|
5271
|
-
*
|
|
5916
|
+
* Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
|
|
5917
|
+
* Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 KB.
|
|
5918
|
+
* Each client can send up to 6 KB of data per second.
|
|
5919
|
+
* 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.
|
|
5920
|
+
* A failed method call triggers the onStreamMessageError callback on the remote client.
|
|
5921
|
+
* Ensure that you call createDataStream to create a data channel before calling this method.
|
|
5922
|
+
* In live streaming scenarios, this method only applies to hosts.
|
|
5272
5923
|
*
|
|
5273
5924
|
* @param streamId The data stream ID. You can get the data stream ID by calling createDataStream.
|
|
5274
5925
|
* @param data The message to be sent.
|
|
5275
5926
|
* @param length The length of the data.
|
|
5276
5927
|
*
|
|
5277
5928
|
* @returns
|
|
5278
|
-
* 0: Success.
|
|
5929
|
+
* 0: Success.
|
|
5930
|
+
* < 0: Failure.
|
|
5279
5931
|
*/
|
|
5280
5932
|
abstract sendStreamMessage(
|
|
5281
5933
|
streamId: number,
|
|
@@ -5286,13 +5938,23 @@ export abstract class IRtcEngine {
|
|
|
5286
5938
|
/**
|
|
5287
5939
|
* Adds a watermark image to the local video.
|
|
5288
5940
|
*
|
|
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:
|
|
5941
|
+
* 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:
|
|
5942
|
+
* If the orientation mode of the encoding video (OrientationMode) is fixed landscape mode or the adaptive landscape mode, the watermark uses the landscape orientation.
|
|
5943
|
+
* If the orientation mode of the encoding video (OrientationMode) is fixed portrait mode or the adaptive portrait mode, the watermark uses the portrait orientation.
|
|
5944
|
+
* 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.
|
|
5945
|
+
* Ensure that calling this method after enableVideo.
|
|
5946
|
+
* If you only want to add a watermark to the media push, you can call this method or the method.
|
|
5947
|
+
* 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.
|
|
5948
|
+
* 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.
|
|
5949
|
+
* 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.
|
|
5950
|
+
* 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
5951
|
*
|
|
5291
5952
|
* @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
5953
|
* @param options The options of the watermark image to be added. See WatermarkOptions.
|
|
5293
5954
|
*
|
|
5294
5955
|
* @returns
|
|
5295
|
-
* 0: Success.
|
|
5956
|
+
* 0: Success.
|
|
5957
|
+
* < 0: Failure.
|
|
5296
5958
|
*/
|
|
5297
5959
|
abstract addVideoWatermark(
|
|
5298
5960
|
watermarkUrl: string,
|
|
@@ -5303,7 +5965,8 @@ export abstract class IRtcEngine {
|
|
|
5303
5965
|
* Removes the watermark image from the video stream.
|
|
5304
5966
|
*
|
|
5305
5967
|
* @returns
|
|
5306
|
-
* 0: Success.
|
|
5968
|
+
* 0: Success.
|
|
5969
|
+
* < 0: Failure.
|
|
5307
5970
|
*/
|
|
5308
5971
|
abstract clearVideoWatermarks(): number;
|
|
5309
5972
|
|
|
@@ -5322,10 +5985,11 @@ export abstract class IRtcEngine {
|
|
|
5322
5985
|
*
|
|
5323
5986
|
* 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
5987
|
*
|
|
5325
|
-
* @param enabled Whether to enable interoperability:true: Enable interoperability.false: (Default) Disable interoperability.
|
|
5988
|
+
* @param enabled Whether to enable interoperability: true : Enable interoperability. false : (Default) Disable interoperability.
|
|
5326
5989
|
*
|
|
5327
5990
|
* @returns
|
|
5328
|
-
* 0: Success.
|
|
5991
|
+
* 0: Success.
|
|
5992
|
+
* < 0: Failure.
|
|
5329
5993
|
*/
|
|
5330
5994
|
abstract enableWebSdkInteroperability(enabled: boolean): number;
|
|
5331
5995
|
|
|
@@ -5346,13 +6010,14 @@ export abstract class IRtcEngine {
|
|
|
5346
6010
|
* Registers the metadata observer.
|
|
5347
6011
|
*
|
|
5348
6012
|
* 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
|
|
6013
|
+
* live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. Call this method before joinChannel.
|
|
5350
6014
|
*
|
|
5351
6015
|
* @param observer The metadata observer. See IMetadataObserver.
|
|
5352
6016
|
* @param type The metadata type. The SDK currently only supports VideoMetadata. See MetadataType.
|
|
5353
6017
|
*
|
|
5354
6018
|
* @returns
|
|
5355
|
-
* 0: Success.
|
|
6019
|
+
* 0: Success.
|
|
6020
|
+
* < 0: Failure.
|
|
5356
6021
|
*/
|
|
5357
6022
|
abstract registerMediaMetadataObserver(
|
|
5358
6023
|
observer: IMetadataObserver,
|
|
@@ -5366,7 +6031,8 @@ export abstract class IRtcEngine {
|
|
|
5366
6031
|
* @param type The metadata type. The SDK currently only supports VideoMetadata. See MetadataType.
|
|
5367
6032
|
*
|
|
5368
6033
|
* @returns
|
|
5369
|
-
* 0: Success.
|
|
6034
|
+
* 0: Success.
|
|
6035
|
+
* < 0: Failure.
|
|
5370
6036
|
*/
|
|
5371
6037
|
abstract unregisterMediaMetadataObserver(
|
|
5372
6038
|
observer: IMetadataObserver,
|
|
@@ -5398,41 +6064,79 @@ export abstract class IRtcEngine {
|
|
|
5398
6064
|
/**
|
|
5399
6065
|
* Sets whether to enable the AI noise suppression function and set the noise suppression mode.
|
|
5400
6066
|
*
|
|
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:
|
|
6067
|
+
* 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:
|
|
6068
|
+
* Television;
|
|
6069
|
+
* Air conditioner;
|
|
6070
|
+
* 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:
|
|
6071
|
+
* Thunder;
|
|
6072
|
+
* Explosion;
|
|
6073
|
+
* Cracking, etc.
|
|
5402
6074
|
*
|
|
5403
|
-
* @param enabled Whether to enable the AI noise suppression function:true: Enable the AI noise suppression.false: (Default) Disable the AI noise suppression.
|
|
6075
|
+
* @param enabled Whether to enable the AI noise suppression function: true : Enable the AI noise suppression. false : (Default) Disable the AI noise suppression.
|
|
5404
6076
|
* @param mode The AI noise suppression modes. See AudioAinsMode.
|
|
5405
6077
|
*
|
|
5406
6078
|
* @returns
|
|
5407
|
-
* 0: Success.
|
|
6079
|
+
* 0: Success.
|
|
6080
|
+
* < 0: Failure.
|
|
5408
6081
|
*/
|
|
5409
6082
|
abstract setAINSMode(enabled: boolean, mode: AudioAinsMode): number;
|
|
5410
6083
|
|
|
5411
6084
|
/**
|
|
5412
6085
|
* Registers a user account.
|
|
5413
6086
|
*
|
|
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:
|
|
6087
|
+
* 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:
|
|
6088
|
+
* Call registerLocalUserAccount to create a user account, and then call joinChannelWithUserAccount to join the channel.
|
|
6089
|
+
* 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.
|
|
6090
|
+
* Ensure that you set the userAccount parameter; otherwise, this method does not take effect.
|
|
6091
|
+
* Ensure that the userAccount is unique in the channel.
|
|
6092
|
+
* 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
6093
|
*
|
|
5416
6094
|
* @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):
|
|
6095
|
+
* @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):
|
|
6096
|
+
* The 26 lowercase English letters: a to z.
|
|
6097
|
+
* The 26 uppercase English letters: A to Z.
|
|
6098
|
+
* All numeric characters: 0 to 9.
|
|
6099
|
+
* Space
|
|
6100
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5418
6101
|
*
|
|
5419
6102
|
* @returns
|
|
5420
|
-
* 0: Success.
|
|
6103
|
+
* 0: Success.
|
|
6104
|
+
* < 0: Failure.
|
|
5421
6105
|
*/
|
|
5422
6106
|
abstract registerLocalUserAccount(appId: string, userAccount: string): number;
|
|
5423
6107
|
|
|
5424
6108
|
/**
|
|
5425
6109
|
* Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
|
|
5426
6110
|
*
|
|
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:
|
|
6111
|
+
* 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:
|
|
6112
|
+
* The local client: onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
6113
|
+
* 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
6114
|
*
|
|
5429
6115
|
* @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
|
-
*
|
|
6116
|
+
* @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:
|
|
6117
|
+
* All lowercase English letters: a to z.
|
|
6118
|
+
* All uppercase English letters: A to Z.
|
|
6119
|
+
* All numeric characters: 0 to 9.
|
|
6120
|
+
* Space
|
|
6121
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
6122
|
+
* @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):
|
|
6123
|
+
* The 26 lowercase English letters: a to z.
|
|
6124
|
+
* The 26 uppercase English letters: A to Z.
|
|
6125
|
+
* All numeric characters: 0 to 9.
|
|
6126
|
+
* Space
|
|
6127
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5432
6128
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
5433
6129
|
*
|
|
5434
6130
|
* @returns
|
|
5435
|
-
* 0: Success.
|
|
6131
|
+
* 0: Success.
|
|
6132
|
+
* < 0: Failure.
|
|
6133
|
+
* -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.
|
|
6134
|
+
* -3: Failes to initialize the IRtcEngine object. You need to reinitialize the IRtcEngine object.
|
|
6135
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
6136
|
+
* -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.
|
|
6137
|
+
* -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.
|
|
6138
|
+
* -102: The channel name is invalid. You need to pass in a valid channelname in channelId to rejoin the channel.
|
|
6139
|
+
* -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel.
|
|
5436
6140
|
*/
|
|
5437
6141
|
abstract joinChannelWithUserAccount(
|
|
5438
6142
|
token: string,
|
|
@@ -5444,20 +6148,28 @@ export abstract class IRtcEngine {
|
|
|
5444
6148
|
/**
|
|
5445
6149
|
* Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
|
|
5446
6150
|
*
|
|
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:
|
|
6151
|
+
* 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:
|
|
6152
|
+
* The local client: onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
6153
|
+
* 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
6154
|
*
|
|
5449
6155
|
* @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:
|
|
6156
|
+
* @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:
|
|
6157
|
+
* All lowercase English letters: a to z.
|
|
6158
|
+
* All uppercase English letters: A to Z.
|
|
6159
|
+
* All numeric characters: 0 to 9.
|
|
6160
|
+
* Space
|
|
6161
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5451
6162
|
* @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
6163
|
* The 26 lowercase English letters: a to z.
|
|
5453
6164
|
* The 26 uppercase English letters: A to Z.
|
|
5454
6165
|
* All numeric characters: 0 to 9.
|
|
5455
6166
|
* Space
|
|
5456
|
-
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=
|
|
6167
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5457
6168
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
5458
6169
|
*
|
|
5459
6170
|
* @returns
|
|
5460
|
-
* 0: Success.
|
|
6171
|
+
* 0: Success.
|
|
6172
|
+
* < 0: Failure.
|
|
5461
6173
|
*/
|
|
5462
6174
|
abstract joinChannelWithUserAccountEx(
|
|
5463
6175
|
token: string,
|
|
@@ -5474,7 +6186,8 @@ export abstract class IRtcEngine {
|
|
|
5474
6186
|
* @param userAccount The user account.
|
|
5475
6187
|
*
|
|
5476
6188
|
* @returns
|
|
5477
|
-
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6189
|
+
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6190
|
+
* If the call fails, returns NULL.
|
|
5478
6191
|
*/
|
|
5479
6192
|
abstract getUserInfoByUserAccount(userAccount: string): UserInfo;
|
|
5480
6193
|
|
|
@@ -5486,19 +6199,31 @@ export abstract class IRtcEngine {
|
|
|
5486
6199
|
* @param uid The user ID.
|
|
5487
6200
|
*
|
|
5488
6201
|
* @returns
|
|
5489
|
-
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6202
|
+
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
6203
|
+
* If the call fails, returns NULL.
|
|
5490
6204
|
*/
|
|
5491
6205
|
abstract getUserInfoByUid(uid: number): UserInfo;
|
|
5492
6206
|
|
|
5493
6207
|
/**
|
|
5494
6208
|
* Starts relaying media streams across channels or updates channels for media relay.
|
|
5495
6209
|
*
|
|
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:
|
|
6210
|
+
* 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:
|
|
6211
|
+
* 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.
|
|
6212
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
|
|
6213
|
+
* Call this method after joining the channel.
|
|
6214
|
+
* This method takes effect only when you are a host in a live streaming channel.
|
|
6215
|
+
* The relaying media streams across channels function needs to be enabled by contacting.
|
|
6216
|
+
* Agora does not support string user accounts in this API.
|
|
5497
6217
|
*
|
|
5498
6218
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
5499
6219
|
*
|
|
5500
6220
|
* @returns
|
|
5501
|
-
* 0: Success.
|
|
6221
|
+
* 0: Success.
|
|
6222
|
+
* < 0: Failure.
|
|
6223
|
+
* -1: A general error occurs (no specified reason).
|
|
6224
|
+
* -2: The parameter is invalid.
|
|
6225
|
+
* -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.
|
|
6226
|
+
* -8: Internal state error. Probably because the user is not a broadcaster.
|
|
5502
6227
|
*/
|
|
5503
6228
|
abstract startOrUpdateChannelMediaRelay(
|
|
5504
6229
|
configuration: ChannelMediaRelayConfiguration
|
|
@@ -5507,12 +6232,24 @@ export abstract class IRtcEngine {
|
|
|
5507
6232
|
/**
|
|
5508
6233
|
* Starts relaying media streams across channels. This method can be used to implement scenarios such as co-host across channels.
|
|
5509
6234
|
*
|
|
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.
|
|
6235
|
+
* 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.
|
|
6236
|
+
* 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.
|
|
6237
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
|
|
6238
|
+
* Call this method after joining the channel.
|
|
6239
|
+
* This method takes effect only when you are a host in a live streaming channel.
|
|
6240
|
+
* 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.
|
|
6241
|
+
* The relaying media streams across channels function needs to be enabled by contacting.
|
|
6242
|
+
* Agora does not support string user accounts in this API.
|
|
5511
6243
|
*
|
|
5512
6244
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
5513
6245
|
*
|
|
5514
6246
|
* @returns
|
|
5515
|
-
* 0: Success.
|
|
6247
|
+
* 0: Success.
|
|
6248
|
+
* < 0: Failure.
|
|
6249
|
+
* -1: A general error occurs (no specified reason).
|
|
6250
|
+
* -2: The parameter is invalid.
|
|
6251
|
+
* -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.
|
|
6252
|
+
* -8: Internal state error. Probably because the user is not a broadcaster.
|
|
5516
6253
|
*/
|
|
5517
6254
|
abstract startChannelMediaRelay(
|
|
5518
6255
|
configuration: ChannelMediaRelayConfiguration
|
|
@@ -5521,12 +6258,13 @@ export abstract class IRtcEngine {
|
|
|
5521
6258
|
/**
|
|
5522
6259
|
* Updates the channels for media stream relay.
|
|
5523
6260
|
*
|
|
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 (
|
|
6261
|
+
* 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
6262
|
*
|
|
5526
6263
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
5527
6264
|
*
|
|
5528
6265
|
* @returns
|
|
5529
|
-
* 0: Success.
|
|
6266
|
+
* 0: Success.
|
|
6267
|
+
* < 0: Failure.
|
|
5530
6268
|
*/
|
|
5531
6269
|
abstract updateChannelMediaRelay(
|
|
5532
6270
|
configuration: ChannelMediaRelayConfiguration
|
|
@@ -5538,27 +6276,30 @@ export abstract class IRtcEngine {
|
|
|
5538
6276
|
* 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
6277
|
*
|
|
5540
6278
|
* @returns
|
|
5541
|
-
* 0: Success.
|
|
6279
|
+
* 0: Success.
|
|
6280
|
+
* < 0: Failure.
|
|
5542
6281
|
*/
|
|
5543
6282
|
abstract stopChannelMediaRelay(): number;
|
|
5544
6283
|
|
|
5545
6284
|
/**
|
|
5546
6285
|
* Pauses the media stream relay to all target channels.
|
|
5547
6286
|
*
|
|
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
|
|
6287
|
+
* 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
6288
|
*
|
|
5550
6289
|
* @returns
|
|
5551
|
-
* 0: Success.
|
|
6290
|
+
* 0: Success.
|
|
6291
|
+
* < 0: Failure.
|
|
5552
6292
|
*/
|
|
5553
6293
|
abstract pauseAllChannelMediaRelay(): number;
|
|
5554
6294
|
|
|
5555
6295
|
/**
|
|
5556
6296
|
* Resumes the media stream relay to all target channels.
|
|
5557
6297
|
*
|
|
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
|
|
6298
|
+
* 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
6299
|
*
|
|
5560
6300
|
* @returns
|
|
5561
|
-
* 0: Success.
|
|
6301
|
+
* 0: Success.
|
|
6302
|
+
* < 0: Failure.
|
|
5562
6303
|
*/
|
|
5563
6304
|
abstract resumeAllChannelMediaRelay(): number;
|
|
5564
6305
|
|
|
@@ -5579,10 +6320,11 @@ export abstract class IRtcEngine {
|
|
|
5579
6320
|
*
|
|
5580
6321
|
* 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
6322
|
*
|
|
5582
|
-
* @param config Video profile. See VideoEncoderConfiguration.During CDN live streaming, Agora only supports setting OrientationMode as OrientationFixedLandscape or OrientationFixedPortrait.
|
|
6323
|
+
* @param config Video profile. See VideoEncoderConfiguration. During CDN live streaming, Agora only supports setting OrientationMode as OrientationFixedLandscape or OrientationFixedPortrait.
|
|
5583
6324
|
*
|
|
5584
6325
|
* @returns
|
|
5585
|
-
* 0: Success.
|
|
6326
|
+
* 0: Success.
|
|
6327
|
+
* < 0: Failure.
|
|
5586
6328
|
*/
|
|
5587
6329
|
abstract setDirectCdnStreamingVideoConfiguration(
|
|
5588
6330
|
config: VideoEncoderConfiguration
|
|
@@ -5591,14 +6333,15 @@ export abstract class IRtcEngine {
|
|
|
5591
6333
|
/**
|
|
5592
6334
|
* Starts pushing media streams to the CDN directly.
|
|
5593
6335
|
*
|
|
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
|
|
6336
|
+
* 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
6337
|
*
|
|
5596
6338
|
* @param eventHandler See onDirectCdnStreamingStateChanged and onDirectCdnStreamingStats.
|
|
5597
6339
|
* @param publishUrl The CDN live streaming URL.
|
|
5598
6340
|
* @param options The media setting options for the host. See DirectCdnStreamingMediaOptions.
|
|
5599
6341
|
*
|
|
5600
6342
|
* @returns
|
|
5601
|
-
* 0: Success.
|
|
6343
|
+
* 0: Success.
|
|
6344
|
+
* < 0: Failure.
|
|
5602
6345
|
*/
|
|
5603
6346
|
abstract startDirectCdnStreaming(
|
|
5604
6347
|
eventHandler: IDirectCdnStreamingEventHandler,
|
|
@@ -5610,7 +6353,8 @@ export abstract class IRtcEngine {
|
|
|
5610
6353
|
* Stops pushing media streams to the CDN directly.
|
|
5611
6354
|
*
|
|
5612
6355
|
* @returns
|
|
5613
|
-
* 0: Success.
|
|
6356
|
+
* 0: Success.
|
|
6357
|
+
* < 0: Failure.
|
|
5614
6358
|
*/
|
|
5615
6359
|
abstract stopDirectCdnStreaming(): number;
|
|
5616
6360
|
|
|
@@ -5643,26 +6387,34 @@ export abstract class IRtcEngine {
|
|
|
5643
6387
|
/**
|
|
5644
6388
|
* Takes a snapshot of a video stream.
|
|
5645
6389
|
*
|
|
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.
|
|
6390
|
+
* 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.
|
|
6391
|
+
* Call this method after joining a channel.
|
|
6392
|
+
* This method takes a snapshot of the published video stream specified in ChannelMediaOptions.
|
|
6393
|
+
* If the user's video has been preprocessed, for example, watermarked or beautified, the resulting snapshot includes the pre-processing effect.
|
|
5647
6394
|
*
|
|
5648
6395
|
* @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:
|
|
6396
|
+
* @param filePath The local path (including filename extensions) of the snapshot. For example:
|
|
6397
|
+
* Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
|
|
6398
|
+
* macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable.
|
|
5650
6399
|
*
|
|
5651
6400
|
* @returns
|
|
5652
|
-
* 0: Success.
|
|
6401
|
+
* 0: Success.
|
|
6402
|
+
* < 0: Failure.
|
|
5653
6403
|
*/
|
|
5654
6404
|
abstract takeSnapshot(uid: number, filePath: string): number;
|
|
5655
6405
|
|
|
5656
6406
|
/**
|
|
5657
6407
|
* Enables or disables video screenshot and upload.
|
|
5658
6408
|
*
|
|
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
|
|
6409
|
+
* 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.
|
|
6410
|
+
* 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
6411
|
*
|
|
5661
|
-
* @param enabled Whether to enable video screenshot and
|
|
6412
|
+
* @param enabled Whether to enable video screenshot and upload true : Enables video screenshot and upload. false : Disables video screenshot and upload.
|
|
5662
6413
|
* @param config Configuration of video screenshot and upload. See ContentInspectConfig.
|
|
5663
6414
|
*
|
|
5664
6415
|
* @returns
|
|
5665
|
-
* 0: Success.
|
|
6416
|
+
* 0: Success.
|
|
6417
|
+
* < 0: Failure.
|
|
5666
6418
|
*/
|
|
5667
6419
|
abstract enableContentInspect(
|
|
5668
6420
|
enabled: boolean,
|
|
@@ -5678,7 +6430,8 @@ export abstract class IRtcEngine {
|
|
|
5678
6430
|
* @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
6431
|
*
|
|
5680
6432
|
* @returns
|
|
5681
|
-
* 0: Success.
|
|
6433
|
+
* 0: Success.
|
|
6434
|
+
* < 0: Failure.
|
|
5682
6435
|
*/
|
|
5683
6436
|
abstract adjustCustomAudioPublishVolume(
|
|
5684
6437
|
trackId: number,
|
|
@@ -5696,12 +6449,18 @@ export abstract class IRtcEngine {
|
|
|
5696
6449
|
/**
|
|
5697
6450
|
* Sets up cloud proxy service.
|
|
5698
6451
|
*
|
|
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 (
|
|
6452
|
+
* 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.
|
|
6453
|
+
* Agora recommends that you call this method after joining a channel.
|
|
6454
|
+
* 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.
|
|
6455
|
+
* 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
6456
|
*
|
|
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.
|
|
6457
|
+
* @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
6458
|
*
|
|
5703
6459
|
* @returns
|
|
5704
|
-
* 0: Success.
|
|
6460
|
+
* 0: Success.
|
|
6461
|
+
* < 0: Failure.
|
|
6462
|
+
* -2: The parameter is invalid.
|
|
6463
|
+
* -7: The SDK is not initialized.
|
|
5705
6464
|
*/
|
|
5706
6465
|
abstract setCloudProxy(proxyType: CloudProxyType): number;
|
|
5707
6466
|
|
|
@@ -5713,12 +6472,13 @@ export abstract class IRtcEngine {
|
|
|
5713
6472
|
/**
|
|
5714
6473
|
* Sets audio advanced options.
|
|
5715
6474
|
*
|
|
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
|
|
6475
|
+
* 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
6476
|
*
|
|
5718
6477
|
* @param options The advanced options for audio. See AdvancedAudioOptions.
|
|
5719
6478
|
*
|
|
5720
6479
|
* @returns
|
|
5721
|
-
* 0: Success.
|
|
6480
|
+
* 0: Success.
|
|
6481
|
+
* < 0: Failure.
|
|
5722
6482
|
*/
|
|
5723
6483
|
abstract setAdvancedAudioOptions(
|
|
5724
6484
|
options: AdvancedAudioOptions,
|
|
@@ -5735,11 +6495,12 @@ export abstract class IRtcEngine {
|
|
|
5735
6495
|
*
|
|
5736
6496
|
* 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
6497
|
*
|
|
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.
|
|
6498
|
+
* @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
6499
|
* @param options Image configurations. See ImageTrackOptions.
|
|
5740
6500
|
*
|
|
5741
6501
|
* @returns
|
|
5742
|
-
* 0: Success.
|
|
6502
|
+
* 0: Success.
|
|
6503
|
+
* < 0: Failure.
|
|
5743
6504
|
*/
|
|
5744
6505
|
abstract enableVideoImageSource(
|
|
5745
6506
|
enable: boolean,
|
|
@@ -5749,10 +6510,11 @@ export abstract class IRtcEngine {
|
|
|
5749
6510
|
/**
|
|
5750
6511
|
* Gets the current Monotonic Time of the SDK.
|
|
5751
6512
|
*
|
|
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 (
|
|
6513
|
+
* 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
6514
|
*
|
|
5754
6515
|
* @returns
|
|
5755
|
-
* ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
|
|
6516
|
+
* ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
|
|
6517
|
+
* < 0: Failure.
|
|
5756
6518
|
*/
|
|
5757
6519
|
abstract getCurrentMonotonicTimeInMs(): number;
|
|
5758
6520
|
|
|
@@ -5767,9 +6529,18 @@ export abstract class IRtcEngine {
|
|
|
5767
6529
|
* 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
6530
|
*
|
|
5769
6531
|
* @returns
|
|
5770
|
-
* ≥ 0: The method call is successful, and the local network connection type is returned.
|
|
6532
|
+
* ≥ 0: The method call is successful, and the local network connection type is returned.
|
|
6533
|
+
* 0: The SDK disconnects from the network.
|
|
6534
|
+
* 1: The network type is LAN.
|
|
6535
|
+
* 2: The network type is Wi-Fi (including hotspots).
|
|
6536
|
+
* 3: The network type is mobile 2G.
|
|
6537
|
+
* 4: The network type is mobile 3G.
|
|
6538
|
+
* 5: The network type is mobile 4G.
|
|
6539
|
+
* 6: The network type is mobile 5G.
|
|
6540
|
+
* < 0: The method call failed with an error code.
|
|
6541
|
+
* -1: The network type is unknown.
|
|
5771
6542
|
*/
|
|
5772
|
-
abstract getNetworkType():
|
|
6543
|
+
abstract getNetworkType(): number;
|
|
5773
6544
|
|
|
5774
6545
|
/**
|
|
5775
6546
|
* Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
|
|
@@ -5777,27 +6548,36 @@ export abstract class IRtcEngine {
|
|
|
5777
6548
|
* @param parameters Pointer to the set parameters in a JSON string.
|
|
5778
6549
|
*
|
|
5779
6550
|
* @returns
|
|
5780
|
-
* 0: Success.
|
|
6551
|
+
* 0: Success.
|
|
6552
|
+
* < 0: Failure.
|
|
5781
6553
|
*/
|
|
5782
6554
|
abstract setParameters(parameters: string): number;
|
|
5783
6555
|
|
|
5784
6556
|
/**
|
|
5785
6557
|
* Enables tracing the video frame rendering process.
|
|
5786
6558
|
*
|
|
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.
|
|
6559
|
+
* 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.
|
|
6560
|
+
* 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.
|
|
6561
|
+
* 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
6562
|
*
|
|
5789
6563
|
* @returns
|
|
5790
|
-
* 0: Success.
|
|
6564
|
+
* 0: Success.
|
|
6565
|
+
* < 0: Failure.
|
|
6566
|
+
* -7: The method is called before IRtcEngine is initialized.
|
|
5791
6567
|
*/
|
|
5792
6568
|
abstract startMediaRenderingTracing(): number;
|
|
5793
6569
|
|
|
5794
6570
|
/**
|
|
5795
6571
|
* Enables audio and video frame instant rendering.
|
|
5796
6572
|
*
|
|
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.
|
|
6573
|
+
* 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.
|
|
6574
|
+
* Once the instant rendering function is enabled, it can only be canceled by calling the release method to destroy the IRtcEngine object.
|
|
6575
|
+
* 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
6576
|
*
|
|
5799
6577
|
* @returns
|
|
5800
|
-
* 0: Success.
|
|
6578
|
+
* 0: Success.
|
|
6579
|
+
* < 0: Failure.
|
|
6580
|
+
* -7: The method is called before IRtcEngine is initialized.
|
|
5801
6581
|
*/
|
|
5802
6582
|
abstract enableInstantMediaRendering(): number;
|
|
5803
6583
|
|
|
@@ -5864,7 +6644,8 @@ export abstract class IRtcEngine {
|
|
|
5864
6644
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
5865
6645
|
*
|
|
5866
6646
|
* @returns
|
|
5867
|
-
* 0: Success.
|
|
6647
|
+
* 0: Success.
|
|
6648
|
+
* < 0: Failure.
|
|
5868
6649
|
*/
|
|
5869
6650
|
abstract sendMetaData(
|
|
5870
6651
|
metadata: Metadata,
|
|
@@ -5874,12 +6655,13 @@ export abstract class IRtcEngine {
|
|
|
5874
6655
|
/**
|
|
5875
6656
|
* Sets the maximum size of the media metadata.
|
|
5876
6657
|
*
|
|
5877
|
-
* After calling registerMediaMetadataObserver
|
|
6658
|
+
* After calling registerMediaMetadataObserver, you can call this method to set the maximum size of the media metadata.
|
|
5878
6659
|
*
|
|
5879
6660
|
* @param size The maximum size of media metadata.
|
|
5880
6661
|
*
|
|
5881
6662
|
* @returns
|
|
5882
|
-
* 0: Success.
|
|
6663
|
+
* 0: Success.
|
|
6664
|
+
* < 0: Failure.
|
|
5883
6665
|
*/
|
|
5884
6666
|
abstract setMaxMetadataSize(size: number): number;
|
|
5885
6667
|
|
|
@@ -5894,7 +6676,12 @@ export abstract class IRtcEngine {
|
|
|
5894
6676
|
* Destroys multiple video renderer objects at one time.
|
|
5895
6677
|
*
|
|
5896
6678
|
* @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:
|
|
6679
|
+
* @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:
|
|
6680
|
+
* All lowercase English letters: a to z.
|
|
6681
|
+
* All uppercase English letters: A to Z.
|
|
6682
|
+
* All numeric characters: 0 to 9.
|
|
6683
|
+
* Space
|
|
6684
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5898
6685
|
* @param uid The user ID of the remote user.
|
|
5899
6686
|
*/
|
|
5900
6687
|
abstract destroyRendererByConfig(
|
|
@@ -5909,7 +6696,8 @@ export abstract class IRtcEngine {
|
|
|
5909
6696
|
* @param observer The encoded audio observer. See IAudioEncodedFrameObserver.
|
|
5910
6697
|
*
|
|
5911
6698
|
* @returns
|
|
5912
|
-
* 0: Success.
|
|
6699
|
+
* 0: Success.
|
|
6700
|
+
* < 0: Failure.
|
|
5913
6701
|
*/
|
|
5914
6702
|
abstract unregisterAudioEncodedFrameObserver(
|
|
5915
6703
|
observer: IAudioEncodedFrameObserver
|
|
@@ -6027,15 +6815,15 @@ export enum VideoProfileType {
|
|
|
6027
6815
|
*/
|
|
6028
6816
|
VideoProfileLandscape360p8 = 37,
|
|
6029
6817
|
/**
|
|
6030
|
-
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6818
|
+
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6031
6819
|
*/
|
|
6032
6820
|
VideoProfileLandscape360p9 = 38,
|
|
6033
6821
|
/**
|
|
6034
|
-
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6822
|
+
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6035
6823
|
*/
|
|
6036
6824
|
VideoProfileLandscape360p10 = 39,
|
|
6037
6825
|
/**
|
|
6038
|
-
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
6826
|
+
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
6039
6827
|
*/
|
|
6040
6828
|
VideoProfileLandscape360p11 = 100,
|
|
6041
6829
|
/**
|
|
@@ -6167,15 +6955,15 @@ export enum VideoProfileType {
|
|
|
6167
6955
|
*/
|
|
6168
6956
|
VideoProfilePortrait360p8 = 1037,
|
|
6169
6957
|
/**
|
|
6170
|
-
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6958
|
+
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6171
6959
|
*/
|
|
6172
6960
|
VideoProfilePortrait360p9 = 1038,
|
|
6173
6961
|
/**
|
|
6174
|
-
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
6962
|
+
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
6175
6963
|
*/
|
|
6176
6964
|
VideoProfilePortrait360p10 = 1039,
|
|
6177
6965
|
/**
|
|
6178
|
-
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
6966
|
+
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
6179
6967
|
*/
|
|
6180
6968
|
VideoProfilePortrait360p11 = 1100,
|
|
6181
6969
|
/**
|