agora-electron-sdk 4.2.2-dev.4 → 4.2.2-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/js/Private/AgoraBase.js +139 -53
- package/js/Private/AgoraMediaBase.js +13 -7
- package/js/Private/IAgoraRtcEngine.js +11 -11
- package/js/Private/IAgoraRtcEngineEx.js +1 -1
- package/js/Private/IAgoraSpatialAudio.js +2 -2
- package/js/Private/impl/IAgoraMediaEngineImpl.js +12 -6
- package/js/Private/impl/IAgoraRtcEngineImpl.js +7 -7
- package/js/Private/internal/IrisApiEngine.js +13 -0
- package/js/Private/internal/MusicContentCenterInternal.js +3 -0
- package/js/Private/internal/RtcEngineExInternal.js +24 -7
- package/js/Private/ti/IAgoraRtcEngine-ti.js +2 -2
- package/js/Renderer/WebGLRenderer/index.js +19 -19
- package/js/Renderer/YUVCanvasRenderer/index.js +1 -1
- package/package.json +3 -3
- package/scripts/zipBuild.js +3 -1
- package/ts/Private/AgoraBase.ts +296 -133
- package/ts/Private/AgoraMediaBase.ts +68 -34
- package/ts/Private/AgoraMediaPlayerTypes.ts +8 -5
- package/ts/Private/IAgoraLog.ts +7 -3
- package/ts/Private/IAgoraMediaEngine.ts +76 -35
- package/ts/Private/IAgoraMediaPlayer.ts +126 -64
- package/ts/Private/IAgoraMediaPlayerSource.ts +3 -1
- package/ts/Private/IAgoraRtcEngine.ts +1325 -530
- package/ts/Private/IAgoraRtcEngineEx.ts +227 -94
- package/ts/Private/IAgoraSpatialAudio.ts +71 -36
- package/ts/Private/IAudioDeviceManager.ts +61 -31
- package/ts/Private/impl/IAgoraMediaEngineImpl.ts +12 -6
- package/ts/Private/impl/IAgoraRtcEngineImpl.ts +9 -11
- package/ts/Private/internal/IrisApiEngine.ts +14 -0
- package/ts/Private/internal/MusicContentCenterInternal.ts +4 -0
- package/ts/Private/internal/RtcEngineExInternal.ts +36 -14
- package/ts/Private/ti/IAgoraRtcEngine-ti.ts +2 -2
- package/ts/Renderer/WebGLRenderer/index.ts +26 -21
- package/ts/Renderer/YUVCanvasRenderer/index.ts +1 -1
- package/types/Private/AgoraBase.d.ts +298 -135
- package/types/Private/AgoraBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaBase.d.ts +69 -35
- package/types/Private/AgoraMediaBase.d.ts.map +1 -1
- package/types/Private/AgoraMediaPlayerTypes.d.ts +8 -5
- package/types/Private/AgoraMediaPlayerTypes.d.ts.map +1 -1
- package/types/Private/IAgoraLog.d.ts +7 -3
- package/types/Private/IAgoraLog.d.ts.map +1 -1
- package/types/Private/IAgoraMediaEngine.d.ts +76 -35
- package/types/Private/IAgoraMediaEngine.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayer.d.ts +126 -64
- package/types/Private/IAgoraMediaPlayer.d.ts.map +1 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts +3 -1
- package/types/Private/IAgoraMediaPlayerSource.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngine.d.ts +1326 -530
- package/types/Private/IAgoraRtcEngine.d.ts.map +1 -1
- package/types/Private/IAgoraRtcEngineEx.d.ts +227 -94
- package/types/Private/IAgoraRtcEngineEx.d.ts.map +1 -1
- package/types/Private/IAgoraSpatialAudio.d.ts +71 -36
- package/types/Private/IAgoraSpatialAudio.d.ts.map +1 -1
- package/types/Private/IAudioDeviceManager.d.ts +61 -31
- package/types/Private/IAudioDeviceManager.d.ts.map +1 -1
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts +2 -2
- package/types/Private/impl/IAgoraMediaEngineImpl.d.ts.map +1 -1
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts +5 -5
- package/types/Private/impl/IAgoraRtcEngineImpl.d.ts.map +1 -1
- package/types/Private/internal/IrisApiEngine.d.ts.map +1 -1
- package/types/Private/internal/MusicContentCenterInternal.d.ts +1 -0
- package/types/Private/internal/MusicContentCenterInternal.d.ts.map +1 -1
- package/types/Private/internal/RtcEngineExInternal.d.ts.map +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts +1 -1
- package/types/Renderer/WebGLRenderer/index.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './extension/IAgoraRtcEngineExtension';
|
|
2
|
-
import { AudienceLatencyLevelType, AudioAinsMode, AudioEffectPreset, AudioEncodedFrameObserverConfig, AudioProfileType, AudioRecordingConfiguration, AudioSampleRateType, AudioScenarioType, AudioSessionOperationRestriction, AudioVolumeInfo, BeautyOptions, CaptureBrightnessLevelType, ChannelMediaRelayConfiguration, ChannelMediaRelayError, ChannelMediaRelayEvent, ChannelMediaRelayState, ChannelProfileType, ClientRoleChangeFailedReason, ClientRoleOptions, ClientRoleType, CodecCapInfo, ColorEnhanceOptions, ConnectionChangedReasonType, ConnectionStateType, DataStreamConfig, DeviceInfo, DownlinkNetworkInfo, EarMonitoringFilterType, EchoTestConfiguration, EncryptionConfig, EncryptionErrorType, ErrorCodeType, HeadphoneEqualizerPreset, IAudioEncodedFrameObserver, LastmileProbeConfig, LastmileProbeResult, LicenseErrorType, LiveTranscoding, LocalAccessPointConfiguration, LocalAudioStats, LocalAudioStreamError, LocalAudioStreamState, LocalTranscoderConfiguration, LocalVideoStreamError, LocalVideoStreamState, LowlightEnhanceOptions, MediaTraceEvent, NetworkType, PermissionType, QualityAdaptIndication, QualityType, RecorderStreamInfo, Rectangle, RemoteAudioState, RemoteAudioStateReason, RemoteVideoState, RemoteVideoStateReason, RtcStats, RtmpStreamPublishErrorType, RtmpStreamPublishState, RtmpStreamingEvent,
|
|
2
|
+
import { AudienceLatencyLevelType, AudioAinsMode, AudioEffectPreset, AudioEncodedFrameObserverConfig, AudioProfileType, AudioRecordingConfiguration, AudioSampleRateType, AudioScenarioType, AudioSessionOperationRestriction, AudioVolumeInfo, BeautyOptions, CaptureBrightnessLevelType, ChannelMediaRelayConfiguration, ChannelMediaRelayError, ChannelMediaRelayEvent, ChannelMediaRelayState, ChannelProfileType, ClientRoleChangeFailedReason, ClientRoleOptions, ClientRoleType, CodecCapInfo, ColorEnhanceOptions, ConnectionChangedReasonType, ConnectionStateType, DataStreamConfig, DeviceInfo, DownlinkNetworkInfo, EarMonitoringFilterType, EchoTestConfiguration, EncryptionConfig, EncryptionErrorType, ErrorCodeType, HeadphoneEqualizerPreset, IAudioEncodedFrameObserver, LastmileProbeConfig, LastmileProbeResult, LicenseErrorType, LiveTranscoding, LocalAccessPointConfiguration, LocalAudioStats, LocalAudioStreamError, LocalAudioStreamState, LocalTranscoderConfiguration, LocalVideoStreamError, LocalVideoStreamState, LowlightEnhanceOptions, MediaTraceEvent, NetworkType, PermissionType, QualityAdaptIndication, QualityType, RecorderStreamInfo, Rectangle, RemoteAudioState, RemoteAudioStateReason, RemoteVideoState, RemoteVideoStateReason, RtcStats, RtmpStreamPublishErrorType, RtmpStreamPublishState, RtmpStreamingEvent, ScreenCaptureParameters, ScreenCaptureParameters2, ScreenScenarioType, SegmentationProperty, SenderOptions, SimulcastStreamConfig, SimulcastStreamMode, SpatialAudioParams, StreamPublishState, StreamSubscribeState, ThreadPriorityType, TranscodingVideoStream, UplinkNetworkInfo, UploadErrorReason, UserInfo, UserOfflineReasonType, VideoApplicationScenarioType, VideoCanvas, VideoCodecType, VideoContentHint, VideoDenoiserOptions, VideoEncoderConfiguration, VideoFormat, VideoMirrorModeType, VideoOrientation, VideoRenderingTracingInfo, VideoStreamType, VideoSubscriptionOptions, VideoTranscoderError, VirtualBackgroundSource, VoiceBeautifierPreset, VoiceConversionPreset, WatermarkOptions, WlAccStats, WlaccMessageReason, WlaccSuggestAction } from './AgoraBase';
|
|
3
3
|
import { ContentInspectConfig, ContentInspectResult, IAudioSpectrumObserver, MediaSourceType, RawAudioFrameOpModeType, RenderModeType, VideoSourceType } from './AgoraMediaBase';
|
|
4
4
|
import { LogConfig, LogFilterType, LogLevel } from './IAgoraLog';
|
|
5
5
|
import { AudioMixingDualMonoMode, IMediaEngine } from './IAgoraMediaEngine';
|
|
@@ -39,11 +39,11 @@ export declare enum MediaDeviceType {
|
|
|
39
39
|
*/
|
|
40
40
|
AudioApplicationPlayoutDevice = 4,
|
|
41
41
|
/**
|
|
42
|
-
* (For macOS only)5: Virtual audio playback device (virtual sound card).
|
|
42
|
+
* (For macOS only) 5: Virtual audio playback device (virtual sound card).
|
|
43
43
|
*/
|
|
44
44
|
AudioVirtualPlayoutDevice = 5,
|
|
45
45
|
/**
|
|
46
|
-
* (For macOS only)6: Virtual audio capturing device (virtual sound card).
|
|
46
|
+
* (For macOS only) 6: Virtual audio capturing device (virtual sound card).
|
|
47
47
|
*/
|
|
48
48
|
AudioVirtualRecordingDevice = 6
|
|
49
49
|
}
|
|
@@ -60,11 +60,11 @@ export declare enum AudioMixingStateType {
|
|
|
60
60
|
*/
|
|
61
61
|
AudioMixingStatePaused = 711,
|
|
62
62
|
/**
|
|
63
|
-
* 713: The music file stops playing.The possible reasons include:AudioMixingReasonAllLoopsCompleted(723)AudioMixingReasonStoppedByUser(724)
|
|
63
|
+
* 713: The music file stops playing. The possible reasons include: AudioMixingReasonAllLoopsCompleted (723) AudioMixingReasonStoppedByUser (724)
|
|
64
64
|
*/
|
|
65
65
|
AudioMixingStateStopped = 713,
|
|
66
66
|
/**
|
|
67
|
-
* 714: An error occurs during the playback of the audio mixing file.The possible reasons include:AudioMixingReasonCanNotOpen(701)AudioMixingReasonTooFrequentCall(702)AudioMixingReasonInterruptedEof(703)
|
|
67
|
+
* 714: An error occurs during the playback of the audio mixing file. The possible reasons include: AudioMixingReasonCanNotOpen (701) AudioMixingReasonTooFrequentCall (702) AudioMixingReasonInterruptedEof (703)
|
|
68
68
|
*/
|
|
69
69
|
AudioMixingStateFailed = 714
|
|
70
70
|
}
|
|
@@ -259,11 +259,11 @@ export declare class LocalVideoStats {
|
|
|
259
259
|
*/
|
|
260
260
|
uid?: number;
|
|
261
261
|
/**
|
|
262
|
-
* The actual bitrate (Kbps) while sending the local video stream.This value does not include the bitrate for resending the video after packet loss.
|
|
262
|
+
* The actual bitrate (Kbps) while sending the local video stream. This value does not include the bitrate for resending the video after packet loss.
|
|
263
263
|
*/
|
|
264
264
|
sentBitrate?: number;
|
|
265
265
|
/**
|
|
266
|
-
* 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.
|
|
266
|
+
* 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.
|
|
267
267
|
*/
|
|
268
268
|
sentFrameRate?: number;
|
|
269
269
|
/**
|
|
@@ -319,7 +319,7 @@ export declare class LocalVideoStats {
|
|
|
319
319
|
*/
|
|
320
320
|
qualityAdaptIndication?: QualityAdaptIndication;
|
|
321
321
|
/**
|
|
322
|
-
* The bitrate (Kbps) while encoding the local video stream.This value does not include the bitrate for resending the video after packet loss.
|
|
322
|
+
* The bitrate (Kbps) while encoding the local video stream. This value does not include the bitrate for resending the video after packet loss.
|
|
323
323
|
*/
|
|
324
324
|
encodedBitrate?: number;
|
|
325
325
|
/**
|
|
@@ -343,7 +343,9 @@ export declare class LocalVideoStats {
|
|
|
343
343
|
*/
|
|
344
344
|
dualStreamEnabled?: boolean;
|
|
345
345
|
/**
|
|
346
|
-
* The local video encoding acceleration type.
|
|
346
|
+
* The local video encoding acceleration type.
|
|
347
|
+
* 0: Software encoding is applied without acceleration.
|
|
348
|
+
* 1: Hardware encoding is applied for acceleration.
|
|
347
349
|
*/
|
|
348
350
|
hwEncoderAccelerating?: number;
|
|
349
351
|
}
|
|
@@ -364,7 +366,7 @@ export declare class RemoteAudioStats {
|
|
|
364
366
|
*/
|
|
365
367
|
networkTransportDelay?: number;
|
|
366
368
|
/**
|
|
367
|
-
* 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.
|
|
369
|
+
* 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.
|
|
368
370
|
*/
|
|
369
371
|
jitterBufferDelay?: number;
|
|
370
372
|
/**
|
|
@@ -392,7 +394,7 @@ export declare class RemoteAudioStats {
|
|
|
392
394
|
*/
|
|
393
395
|
frozenRate?: number;
|
|
394
396
|
/**
|
|
395
|
-
* 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
|
|
397
|
+
* 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.
|
|
396
398
|
*/
|
|
397
399
|
mosValue?: number;
|
|
398
400
|
/**
|
|
@@ -404,7 +406,7 @@ export declare class RemoteAudioStats {
|
|
|
404
406
|
*/
|
|
405
407
|
plcCount?: number;
|
|
406
408
|
/**
|
|
407
|
-
* 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.
|
|
409
|
+
* 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.
|
|
408
410
|
*/
|
|
409
411
|
totalActiveTime?: number;
|
|
410
412
|
/**
|
|
@@ -433,7 +435,7 @@ export declare class RemoteVideoStats {
|
|
|
433
435
|
*/
|
|
434
436
|
uid?: number;
|
|
435
437
|
/**
|
|
436
|
-
* 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).
|
|
438
|
+
* 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).
|
|
437
439
|
*/
|
|
438
440
|
delay?: number;
|
|
439
441
|
/**
|
|
@@ -481,11 +483,11 @@ export declare class RemoteVideoStats {
|
|
|
481
483
|
*/
|
|
482
484
|
frozenRate?: number;
|
|
483
485
|
/**
|
|
484
|
-
* 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.
|
|
486
|
+
* 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.
|
|
485
487
|
*/
|
|
486
488
|
avSyncTimeMs?: number;
|
|
487
489
|
/**
|
|
488
|
-
* 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.
|
|
490
|
+
* 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.
|
|
489
491
|
*/
|
|
490
492
|
totalActiveTime?: number;
|
|
491
493
|
/**
|
|
@@ -719,7 +721,7 @@ export declare class CameraCapturerConfiguration {
|
|
|
719
721
|
*/
|
|
720
722
|
cameraDirection?: CameraDirection;
|
|
721
723
|
/**
|
|
722
|
-
* This method applies to Windows only.The ID of the camera. The maximum length is MaxDeviceIdLengthType.
|
|
724
|
+
* This method applies to Windows only. The ID of the camera. The maximum length is MaxDeviceIdLengthType.
|
|
723
725
|
*/
|
|
724
726
|
deviceId?: string;
|
|
725
727
|
/**
|
|
@@ -727,7 +729,7 @@ export declare class CameraCapturerConfiguration {
|
|
|
727
729
|
*/
|
|
728
730
|
format?: VideoFormat;
|
|
729
731
|
/**
|
|
730
|
-
* 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.
|
|
732
|
+
* 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.
|
|
731
733
|
*/
|
|
732
734
|
followEncodeDimensionRatio?: boolean;
|
|
733
735
|
}
|
|
@@ -736,19 +738,19 @@ export declare class CameraCapturerConfiguration {
|
|
|
736
738
|
*/
|
|
737
739
|
export declare class ScreenCaptureConfiguration {
|
|
738
740
|
/**
|
|
739
|
-
* Whether to capture the window on the screen:true: Capture the window.false: (Default) Capture the screen, not the window.
|
|
741
|
+
* Whether to capture the window on the screen: true : Capture the window. false : (Default) Capture the screen, not the window.
|
|
740
742
|
*/
|
|
741
743
|
isCaptureWindow?: boolean;
|
|
742
744
|
/**
|
|
743
|
-
* (macOS only) The display ID of the screen.This parameter takes effect only when you want to capture the screen on macOS.
|
|
745
|
+
* (macOS only) The display ID of the screen. This parameter takes effect only when you want to capture the screen on macOS.
|
|
744
746
|
*/
|
|
745
747
|
displayId?: number;
|
|
746
748
|
/**
|
|
747
|
-
* (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.
|
|
749
|
+
* (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.
|
|
748
750
|
*/
|
|
749
751
|
screenRect?: Rectangle;
|
|
750
752
|
/**
|
|
751
|
-
* Window ID.This parameter takes effect only when you want to capture the window.
|
|
753
|
+
* Window ID. This parameter takes effect only when you want to capture the window.
|
|
752
754
|
*/
|
|
753
755
|
windowId?: any;
|
|
754
756
|
/**
|
|
@@ -756,7 +758,7 @@ export declare class ScreenCaptureConfiguration {
|
|
|
756
758
|
*/
|
|
757
759
|
params?: ScreenCaptureParameters;
|
|
758
760
|
/**
|
|
759
|
-
* Rectangle. If you do not set this parameter, the SDK shares the whole screen. If the region you set exceeds the boundary of the screen, only the region within in the screen is shared. If you set width or height in Rectangle as 0, the whole screen is shared.
|
|
761
|
+
* The relative position of the shared region to the whole screen. See Rectangle. If you do not set this parameter, the SDK shares the whole screen. If the region you set exceeds the boundary of the screen, only the region within in the screen is shared. If you set width or height in Rectangle as 0, the whole screen is shared.
|
|
760
762
|
*/
|
|
761
763
|
regionRect?: Rectangle;
|
|
762
764
|
}
|
|
@@ -834,11 +836,11 @@ export declare class ScreenCaptureSourceInfo {
|
|
|
834
836
|
*/
|
|
835
837
|
sourceName?: string;
|
|
836
838
|
/**
|
|
837
|
-
* The image content of the thumbnail. See ThumbImageBuffer
|
|
839
|
+
* The image content of the thumbnail. See ThumbImageBuffer.
|
|
838
840
|
*/
|
|
839
841
|
thumbImage?: ThumbImageBuffer;
|
|
840
842
|
/**
|
|
841
|
-
* The image content of the icon. See ThumbImageBuffer
|
|
843
|
+
* The image content of the icon. See ThumbImageBuffer.
|
|
842
844
|
*/
|
|
843
845
|
iconImage?: ThumbImageBuffer;
|
|
844
846
|
/**
|
|
@@ -850,7 +852,7 @@ export declare class ScreenCaptureSourceInfo {
|
|
|
850
852
|
*/
|
|
851
853
|
sourceTitle?: string;
|
|
852
854
|
/**
|
|
853
|
-
* Determines whether the screen is the primary display:true: The screen is the primary display.false: The screen is not the primary display.
|
|
855
|
+
* Determines whether the screen is the primary display: true : The screen is the primary display. false : The screen is not the primary display.
|
|
854
856
|
*/
|
|
855
857
|
primaryMonitor?: boolean;
|
|
856
858
|
/**
|
|
@@ -862,7 +864,7 @@ export declare class ScreenCaptureSourceInfo {
|
|
|
862
864
|
*/
|
|
863
865
|
position?: Rectangle;
|
|
864
866
|
/**
|
|
865
|
-
* (For Windows only) Whether the window is minimized:true: The window is minimized.false: The window is not minimized.
|
|
867
|
+
* (For Windows only) Whether the window is minimized: true : The window is minimized. false : The window is not minimized.
|
|
866
868
|
*/
|
|
867
869
|
minimizeWindow?: boolean;
|
|
868
870
|
/**
|
|
@@ -899,91 +901,91 @@ export declare class ImageTrackOptions {
|
|
|
899
901
|
/**
|
|
900
902
|
* The channel media options.
|
|
901
903
|
*
|
|
902
|
-
* Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection
|
|
904
|
+
* Agora supports publishing multiple audio streams and one video stream at the same time and in the same RtcConnection. For example, publishMicrophoneTrack, publishCustomAudioTrack, and publishMediaPlayerAudioTrack can be set as true at the same time, but only one of publishCameraTrack, publishScreenTrack, publishCustomVideoTrack, or publishEncodedVideoTrack can be set as true. Agora recommends that you set member parameter values yourself according to your business scenario, otherwise the SDK will automatically assign values to member parameters.
|
|
903
905
|
*/
|
|
904
906
|
export declare class ChannelMediaOptions {
|
|
905
907
|
/**
|
|
906
|
-
* 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.
|
|
908
|
+
* 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.
|
|
907
909
|
*/
|
|
908
910
|
publishCameraTrack?: boolean;
|
|
909
911
|
/**
|
|
910
|
-
* 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.
|
|
912
|
+
* 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.
|
|
911
913
|
*/
|
|
912
914
|
publishSecondaryCameraTrack?: boolean;
|
|
913
915
|
/**
|
|
914
|
-
*
|
|
916
|
+
* 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.
|
|
915
917
|
*/
|
|
916
918
|
publishThirdCameraTrack?: boolean;
|
|
917
919
|
/**
|
|
918
|
-
*
|
|
920
|
+
* 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.
|
|
919
921
|
*/
|
|
920
922
|
publishFourthCameraTrack?: boolean;
|
|
921
923
|
/**
|
|
922
|
-
* 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.
|
|
924
|
+
* 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.
|
|
923
925
|
*/
|
|
924
926
|
publishMicrophoneTrack?: boolean;
|
|
925
927
|
/**
|
|
926
|
-
*
|
|
928
|
+
* @ignore
|
|
927
929
|
*/
|
|
928
930
|
publishScreenCaptureVideo?: boolean;
|
|
929
931
|
/**
|
|
930
|
-
*
|
|
932
|
+
* @ignore
|
|
931
933
|
*/
|
|
932
934
|
publishScreenCaptureAudio?: boolean;
|
|
933
935
|
/**
|
|
934
|
-
* Whether to publish the video captured from the screen:true: Publish the video captured from the screen.false:
|
|
936
|
+
* 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.
|
|
935
937
|
*/
|
|
936
938
|
publishScreenTrack?: boolean;
|
|
937
939
|
/**
|
|
938
|
-
* 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.
|
|
940
|
+
* 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.
|
|
939
941
|
*/
|
|
940
942
|
publishSecondaryScreenTrack?: boolean;
|
|
941
943
|
/**
|
|
942
|
-
*
|
|
944
|
+
* 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.
|
|
943
945
|
*/
|
|
944
946
|
publishThirdScreenTrack?: boolean;
|
|
945
947
|
/**
|
|
946
|
-
*
|
|
948
|
+
* 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.
|
|
947
949
|
*/
|
|
948
950
|
publishFourthScreenTrack?: boolean;
|
|
949
951
|
/**
|
|
950
|
-
* 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.
|
|
952
|
+
* 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.
|
|
951
953
|
*/
|
|
952
954
|
publishCustomAudioTrack?: boolean;
|
|
953
955
|
/**
|
|
954
|
-
* 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.
|
|
956
|
+
* 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.
|
|
955
957
|
*/
|
|
956
958
|
publishCustomAudioTrackId?: number;
|
|
957
959
|
/**
|
|
958
|
-
* 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.
|
|
960
|
+
* 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.
|
|
959
961
|
*/
|
|
960
962
|
publishCustomVideoTrack?: boolean;
|
|
961
963
|
/**
|
|
962
|
-
* Whether to publish the encoded video:true: Publish the encoded video.false: Do not publish the encoded video.
|
|
964
|
+
* Whether to publish the encoded video: true : Publish the encoded video. false : Do not publish the encoded video.
|
|
963
965
|
*/
|
|
964
966
|
publishEncodedVideoTrack?: boolean;
|
|
965
967
|
/**
|
|
966
|
-
* 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.
|
|
968
|
+
* 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.
|
|
967
969
|
*/
|
|
968
970
|
publishMediaPlayerAudioTrack?: boolean;
|
|
969
971
|
/**
|
|
970
|
-
* 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.
|
|
972
|
+
* 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.
|
|
971
973
|
*/
|
|
972
974
|
publishMediaPlayerVideoTrack?: boolean;
|
|
973
975
|
/**
|
|
974
|
-
* Whether to publish the local transcoded video:true: Publish the local transcoded video.false: Do not publish the local transcoded video.
|
|
976
|
+
* Whether to publish the local transcoded video: true : Publish the local transcoded video. false : Do not publish the local transcoded video.
|
|
975
977
|
*/
|
|
976
978
|
publishTranscodedVideoTrack?: boolean;
|
|
977
979
|
/**
|
|
978
|
-
* 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.
|
|
980
|
+
* 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.
|
|
979
981
|
*/
|
|
980
982
|
autoSubscribeAudio?: boolean;
|
|
981
983
|
/**
|
|
982
|
-
* 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.
|
|
984
|
+
* 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.
|
|
983
985
|
*/
|
|
984
986
|
autoSubscribeVideo?: boolean;
|
|
985
987
|
/**
|
|
986
|
-
* Whether to enable audio capturing or playback:true:
|
|
988
|
+
* 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.
|
|
987
989
|
*/
|
|
988
990
|
enableAudioRecordingOrPlayout?: boolean;
|
|
989
991
|
/**
|
|
@@ -1015,7 +1017,9 @@ export declare class ChannelMediaOptions {
|
|
|
1015
1017
|
*/
|
|
1016
1018
|
mediaPlayerAudioDelayMs?: number;
|
|
1017
1019
|
/**
|
|
1018
|
-
* (Optional) The token generated on your server for authentication.
|
|
1020
|
+
* (Optional) The token generated on your server for authentication.
|
|
1021
|
+
* This parameter takes effect only when calling updateChannelMediaOptions or updateChannelMediaOptionsEx.
|
|
1022
|
+
* 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.
|
|
1019
1023
|
*/
|
|
1020
1024
|
token?: string;
|
|
1021
1025
|
/**
|
|
@@ -1023,11 +1027,13 @@ export declare class ChannelMediaOptions {
|
|
|
1023
1027
|
*/
|
|
1024
1028
|
enableBuiltInMediaEncryption?: boolean;
|
|
1025
1029
|
/**
|
|
1026
|
-
* 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.
|
|
1030
|
+
* 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.
|
|
1027
1031
|
*/
|
|
1028
1032
|
publishRhythmPlayerTrack?: boolean;
|
|
1029
1033
|
/**
|
|
1030
|
-
* 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.
|
|
1034
|
+
* 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.
|
|
1035
|
+
* 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.
|
|
1036
|
+
* This parameter takes effect only when the user role is ClientRoleAudience.
|
|
1031
1037
|
*/
|
|
1032
1038
|
isInteractiveAudience?: boolean;
|
|
1033
1039
|
/**
|
|
@@ -1035,7 +1041,7 @@ export declare class ChannelMediaOptions {
|
|
|
1035
1041
|
*/
|
|
1036
1042
|
customVideoTrackId?: number;
|
|
1037
1043
|
/**
|
|
1038
|
-
* 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
|
|
1044
|
+
* 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.
|
|
1039
1045
|
*/
|
|
1040
1046
|
isAudioFilterable?: boolean;
|
|
1041
1047
|
}
|
|
@@ -1077,20 +1083,20 @@ export declare enum ProxyType {
|
|
|
1077
1083
|
*/
|
|
1078
1084
|
export declare class LeaveChannelOptions {
|
|
1079
1085
|
/**
|
|
1080
|
-
* 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.
|
|
1086
|
+
* 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.
|
|
1081
1087
|
*/
|
|
1082
1088
|
stopAudioMixing?: boolean;
|
|
1083
1089
|
/**
|
|
1084
|
-
* 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.
|
|
1090
|
+
* 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.
|
|
1085
1091
|
*/
|
|
1086
1092
|
stopAllEffect?: boolean;
|
|
1087
1093
|
/**
|
|
1088
|
-
* Whether to stop microphone recording when a user leaves the channel. true: (Default) Stop microphone recording.false: Do not stop microphone recording.
|
|
1094
|
+
* Whether to stop microphone recording when a user leaves the channel. true : (Default) Stop microphone recording. false : Do not stop microphone recording.
|
|
1089
1095
|
*/
|
|
1090
1096
|
stopMicrophoneRecording?: boolean;
|
|
1091
1097
|
}
|
|
1092
1098
|
/**
|
|
1093
|
-
*
|
|
1099
|
+
* 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.
|
|
1094
1100
|
*/
|
|
1095
1101
|
export interface IRtcEngineEventHandler {
|
|
1096
1102
|
/**
|
|
@@ -1148,7 +1154,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1148
1154
|
/**
|
|
1149
1155
|
* Reports the last mile network probe result.
|
|
1150
1156
|
*
|
|
1151
|
-
* The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest
|
|
1157
|
+
* The SDK triggers this callback within 30 seconds after the app calls startLastmileProbeTest.
|
|
1152
1158
|
*
|
|
1153
1159
|
* @param result The uplink and downlink last-mile network probe test result. See LastmileProbeResult.
|
|
1154
1160
|
*/
|
|
@@ -1156,18 +1162,21 @@ export interface IRtcEngineEventHandler {
|
|
|
1156
1162
|
/**
|
|
1157
1163
|
* Reports the volume information of users.
|
|
1158
1164
|
*
|
|
1159
|
-
* By default, this callback is disabled. You can enable it by calling enableAudioVolumeIndication
|
|
1165
|
+
* 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.
|
|
1160
1166
|
*
|
|
1161
1167
|
* @param connection The connection information. See RtcConnection.
|
|
1162
1168
|
* @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.
|
|
1163
|
-
* @param speakerNumber The total number of users.
|
|
1164
|
-
*
|
|
1169
|
+
* @param speakerNumber The total number of users.
|
|
1170
|
+
* In the callback for the local user, if the local user is sending streams, the value of speakerNumber is 1.
|
|
1171
|
+
* 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.
|
|
1172
|
+
* @param totalVolume The volume of the speaker. The value range is [0,255].
|
|
1173
|
+
* 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.
|
|
1165
1174
|
*/
|
|
1166
1175
|
onAudioVolumeIndication?(connection: RtcConnection, speakers: AudioVolumeInfo[], speakerNumber: number, totalVolume: number): void;
|
|
1167
1176
|
/**
|
|
1168
1177
|
* Occurs when a user leaves a channel.
|
|
1169
1178
|
*
|
|
1170
|
-
* This callback notifies the app that the user leaves the channel by calling leaveChannel
|
|
1179
|
+
* 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.
|
|
1171
1180
|
*
|
|
1172
1181
|
* @param connection The connection information. See RtcConnection.
|
|
1173
1182
|
* @param stats The statistics of the call. See RtcStats.
|
|
@@ -1200,7 +1209,8 @@ export interface IRtcEngineEventHandler {
|
|
|
1200
1209
|
* @param position The playback progress (ms).
|
|
1201
1210
|
*
|
|
1202
1211
|
* @returns
|
|
1203
|
-
* 0: Success.
|
|
1212
|
+
* 0: Success.
|
|
1213
|
+
* < 0: Failure.
|
|
1204
1214
|
*/
|
|
1205
1215
|
onAudioMixingPositionChanged?(position: number): void;
|
|
1206
1216
|
/**
|
|
@@ -1259,7 +1269,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1259
1269
|
*
|
|
1260
1270
|
* 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.
|
|
1261
1271
|
*
|
|
1262
|
-
* @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.
|
|
1272
|
+
* @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.
|
|
1263
1273
|
*/
|
|
1264
1274
|
onLastmileQuality?(quality: QualityType): void;
|
|
1265
1275
|
/**
|
|
@@ -1276,16 +1286,25 @@ export interface IRtcEngineEventHandler {
|
|
|
1276
1286
|
/**
|
|
1277
1287
|
* Occurs when the first video frame is published.
|
|
1278
1288
|
*
|
|
1279
|
-
* The SDK triggers this callback under one of the following circumstances:
|
|
1289
|
+
* The SDK triggers this callback under one of the following circumstances:
|
|
1290
|
+
* The local client enables the video module and calls joinChannel successfully.
|
|
1291
|
+
* The local client calls muteLocalVideoStream (true) and muteLocalVideoStream (false) in sequence.
|
|
1292
|
+
* The local client calls disableVideo and enableVideo in sequence.
|
|
1280
1293
|
*
|
|
1281
1294
|
* @param connection The connection information. See RtcConnection.
|
|
1282
1295
|
* @param elapsed Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.
|
|
1283
1296
|
*/
|
|
1284
|
-
onFirstLocalVideoFramePublished?(
|
|
1297
|
+
onFirstLocalVideoFramePublished?(source: VideoSourceType, elapsed: number): void;
|
|
1285
1298
|
/**
|
|
1286
1299
|
* Occurs when the first remote video frame is received and decoded.
|
|
1287
1300
|
*
|
|
1288
|
-
* The SDK triggers this callback under one of the following circumstances:
|
|
1301
|
+
* The SDK triggers this callback under one of the following circumstances:
|
|
1302
|
+
* The remote user joins the channel and sends the video stream.
|
|
1303
|
+
* The remote user stops sending the video stream and re-sends it after 15 seconds. Reasons for such an interruption include:
|
|
1304
|
+
* The remote user leaves the channel.
|
|
1305
|
+
* The remote user drops offline.
|
|
1306
|
+
* The remote user calls muteLocalVideoStream to stop sending the video stream.
|
|
1307
|
+
* The remote user calls disableVideo to disable video.
|
|
1289
1308
|
*
|
|
1290
1309
|
* @param connection The connection information. See RtcConnection.
|
|
1291
1310
|
* @param remoteUid The user ID of the remote user sending the video stream.
|
|
@@ -1308,7 +1327,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1308
1327
|
/**
|
|
1309
1328
|
* Occurs when the local video stream state changes.
|
|
1310
1329
|
*
|
|
1311
|
-
* 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:
|
|
1330
|
+
* 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:
|
|
1331
|
+
* The app switches to the background, and the system gets the camera resource.
|
|
1332
|
+
* 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.
|
|
1312
1333
|
*
|
|
1313
1334
|
* @param source The type of the video source. See VideoSourceType.
|
|
1314
1335
|
* @param state The state of the local video, see LocalVideoStreamState.
|
|
@@ -1338,9 +1359,13 @@ export interface IRtcEngineEventHandler {
|
|
|
1338
1359
|
*/
|
|
1339
1360
|
onFirstRemoteVideoFrame?(connection: RtcConnection, remoteUid: number, width: number, height: number, elapsed: number): void;
|
|
1340
1361
|
/**
|
|
1341
|
-
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile)
|
|
1362
|
+
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) joins the channel.
|
|
1342
1363
|
*
|
|
1343
|
-
* 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.
|
|
1364
|
+
* 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.
|
|
1365
|
+
* 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:
|
|
1366
|
+
* A remote user/host joins the channel.
|
|
1367
|
+
* A remote user switches the user role to the host after joining the channel.
|
|
1368
|
+
* A remote user/host rejoins the channel after a network interruption.
|
|
1344
1369
|
*
|
|
1345
1370
|
* @param connection The connection information. See RtcConnection.
|
|
1346
1371
|
* @param remoteUid The ID of the user or host who joins the channel.
|
|
@@ -1350,7 +1375,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1350
1375
|
/**
|
|
1351
1376
|
* Occurs when a remote user (in the communication profile)/ host (in the live streaming profile) leaves the channel.
|
|
1352
1377
|
*
|
|
1353
|
-
* There are two reasons for users to become offline:
|
|
1378
|
+
* There are two reasons for users to become offline:
|
|
1379
|
+
* 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.
|
|
1380
|
+
* 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.
|
|
1354
1381
|
*
|
|
1355
1382
|
* @param connection The connection information. See RtcConnection.
|
|
1356
1383
|
* @param remoteUid The ID of the user who leaves the channel or goes offline.
|
|
@@ -1364,7 +1391,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1364
1391
|
*
|
|
1365
1392
|
* @param connection The connection information. See RtcConnection.
|
|
1366
1393
|
* @param remoteUid The user ID.
|
|
1367
|
-
* @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.
|
|
1394
|
+
* @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.
|
|
1368
1395
|
*/
|
|
1369
1396
|
onUserMuteAudio?(connection: RtcConnection, remoteUid: number, muted: boolean): void;
|
|
1370
1397
|
/**
|
|
@@ -1374,7 +1401,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1374
1401
|
*
|
|
1375
1402
|
* @param connection The connection information. See RtcConnection.
|
|
1376
1403
|
* @param remoteUid The user ID of the remote user.
|
|
1377
|
-
* @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.
|
|
1404
|
+
* @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.
|
|
1378
1405
|
*/
|
|
1379
1406
|
onUserMuteVideo?(connection: RtcConnection, remoteUid: number, muted: boolean): void;
|
|
1380
1407
|
/**
|
|
@@ -1384,7 +1411,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1384
1411
|
*
|
|
1385
1412
|
* @param connection The connection information. See RtcConnection.
|
|
1386
1413
|
* @param remoteUid The user ID of the remote user.
|
|
1387
|
-
* @param enabled true: The video module is enabled.false: The video module is disabled.
|
|
1414
|
+
* @param enabled true : The video module is enabled. false : The video module is disabled.
|
|
1388
1415
|
*/
|
|
1389
1416
|
onUserEnableVideo?(connection: RtcConnection, remoteUid: number, enabled: boolean): void;
|
|
1390
1417
|
/**
|
|
@@ -1398,7 +1425,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1398
1425
|
*
|
|
1399
1426
|
* @param connection The connection information. See RtcConnection.
|
|
1400
1427
|
* @param remoteUid The user ID of the remote user.
|
|
1401
|
-
* @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.
|
|
1428
|
+
* @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.
|
|
1402
1429
|
*/
|
|
1403
1430
|
onUserEnableLocalVideo?(connection: RtcConnection, remoteUid: number, enabled: boolean): void;
|
|
1404
1431
|
/**
|
|
@@ -1427,7 +1454,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1427
1454
|
* @param connection The connection information. See RtcConnection.
|
|
1428
1455
|
* @param stats The statistics of the local video stream. See LocalVideoStats.
|
|
1429
1456
|
*/
|
|
1430
|
-
onLocalVideoStats?(
|
|
1457
|
+
onLocalVideoStats?(source: VideoSourceType, stats: LocalVideoStats): void;
|
|
1431
1458
|
/**
|
|
1432
1459
|
* Reports the statistics of the video stream sent by each remote users.
|
|
1433
1460
|
*
|
|
@@ -1485,7 +1512,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1485
1512
|
/**
|
|
1486
1513
|
* Occurs when the connection between the SDK and the server is interrupted.
|
|
1487
1514
|
*
|
|
1488
|
-
* 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:
|
|
1515
|
+
* 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:
|
|
1516
|
+
* The SDK triggers the onConnectionInterrupted callback when it loses connection with the server for more than four seconds after it successfully joins the channel.
|
|
1517
|
+
* 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.
|
|
1489
1518
|
*
|
|
1490
1519
|
* @param connection The connection information. See RtcConnection.
|
|
1491
1520
|
*/
|
|
@@ -1527,7 +1556,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1527
1556
|
/**
|
|
1528
1557
|
* Occurs when the token expires.
|
|
1529
1558
|
*
|
|
1530
|
-
* 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:
|
|
1559
|
+
* 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:
|
|
1560
|
+
* Call renewToken to pass in the new token.
|
|
1561
|
+
* Call leaveChannel to leave the current channel and then pass in the new token when you call joinChannel to join a channel.
|
|
1531
1562
|
*
|
|
1532
1563
|
* @param connection The connection information. See RtcConnection.
|
|
1533
1564
|
*/
|
|
@@ -1535,7 +1566,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1535
1566
|
/**
|
|
1536
1567
|
* Occurs when the token expires in 30 seconds.
|
|
1537
1568
|
*
|
|
1538
|
-
* 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.
|
|
1569
|
+
* 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.
|
|
1539
1570
|
*
|
|
1540
1571
|
* @param connection The connection information. See RtcConnection.
|
|
1541
1572
|
* @param token The token that expires in 30 seconds.
|
|
@@ -1548,7 +1579,10 @@ export interface IRtcEngineEventHandler {
|
|
|
1548
1579
|
/**
|
|
1549
1580
|
* Occurs when the first audio frame is published.
|
|
1550
1581
|
*
|
|
1551
|
-
* The SDK triggers this callback under one of the following circumstances:
|
|
1582
|
+
* The SDK triggers this callback under one of the following circumstances:
|
|
1583
|
+
* The local client enables the audio module and calls joinChannel successfully.
|
|
1584
|
+
* The local client calls muteLocalAudioStream (true) and muteLocalAudioStream (false) in sequence.
|
|
1585
|
+
* The local client calls disableAudio and enableAudio in sequence.
|
|
1552
1586
|
*
|
|
1553
1587
|
* @param connection The connection information. See RtcConnection.
|
|
1554
1588
|
* @param elapsed Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback.
|
|
@@ -1567,7 +1601,13 @@ export interface IRtcEngineEventHandler {
|
|
|
1567
1601
|
/**
|
|
1568
1602
|
* Occurs when the SDK decodes the first remote audio frame for playback.
|
|
1569
1603
|
*
|
|
1570
|
-
* Deprecated: Use onRemoteAudioStateChanged instead. The SDK triggers this callback under one of the following circumstances:
|
|
1604
|
+
* Deprecated: Use onRemoteAudioStateChanged instead. The SDK triggers this callback under one of the following circumstances:
|
|
1605
|
+
* The remote user joins the channel and sends the audio stream for the first time.
|
|
1606
|
+
* 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:
|
|
1607
|
+
* The remote user leaves channel.
|
|
1608
|
+
* The remote user drops offline.
|
|
1609
|
+
* The remote user calls muteLocalAudioStream to stop sending the audio stream.
|
|
1610
|
+
* The remote user calls disableAudio to disable audio.
|
|
1571
1611
|
*
|
|
1572
1612
|
* @param connection The connection information. See RtcConnection.
|
|
1573
1613
|
* @param uid The user ID of the remote user.
|
|
@@ -1599,7 +1639,9 @@ export interface IRtcEngineEventHandler {
|
|
|
1599
1639
|
/**
|
|
1600
1640
|
* Occurs when the most active remote speaker is detected.
|
|
1601
1641
|
*
|
|
1602
|
-
* After a successful call of enableAudioVolumeIndication
|
|
1642
|
+
* 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.
|
|
1643
|
+
* If the most active remote speaker is always the same user, the SDK triggers the onActiveSpeaker callback only once.
|
|
1644
|
+
* 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.
|
|
1603
1645
|
*
|
|
1604
1646
|
* @param connection The connection information. See RtcConnection.
|
|
1605
1647
|
* @param uid The user ID of the most active speaker.
|
|
@@ -1619,7 +1661,12 @@ export interface IRtcEngineEventHandler {
|
|
|
1619
1661
|
* @param filePath The local path of the snapshot.
|
|
1620
1662
|
* @param width The width (px) of the snapshot.
|
|
1621
1663
|
* @param height The height (px) of the snapshot.
|
|
1622
|
-
* @param errCode The message that confirms success or gives the reason why the snapshot is not successfully taken:
|
|
1664
|
+
* @param errCode The message that confirms success or gives the reason why the snapshot is not successfully taken:
|
|
1665
|
+
* 0: Success.
|
|
1666
|
+
* < 0: Failure:
|
|
1667
|
+
* -1: The SDK fails to write data to a file or encode a JPEG image.
|
|
1668
|
+
* -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.
|
|
1669
|
+
* -3: Calling the takeSnapshot method too frequently.
|
|
1623
1670
|
*/
|
|
1624
1671
|
onSnapshotTaken?(connection: RtcConnection, uid: number, filePath: string, width: number, height: number, errCode: number): void;
|
|
1625
1672
|
/**
|
|
@@ -1636,7 +1683,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1636
1683
|
/**
|
|
1637
1684
|
* Occurs when the user role switching fails in the interactive live streaming.
|
|
1638
1685
|
*
|
|
1639
|
-
* In the live broadcasting channel profile, when the local user calls to switch the user role after joining the channel but the switch fails, the SDK triggers this callback to report the reason for the failure and the current user role.
|
|
1686
|
+
* In the live broadcasting channel profile, when the local user calls setClientRole to switch the user role after joining the channel but the switch fails, the SDK triggers this callback to report the reason for the failure and the current user role.
|
|
1640
1687
|
*
|
|
1641
1688
|
* @param connection The connection information. See RtcConnection.
|
|
1642
1689
|
* @param reason The reason for a user role switch failure. See ClientRoleChangeFailedReason.
|
|
@@ -1650,7 +1697,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1650
1697
|
*
|
|
1651
1698
|
* @param deviceType The device type. See MediaDeviceType.
|
|
1652
1699
|
* @param volume The volume value. The range is [0, 255].
|
|
1653
|
-
* @param muted Whether the audio device is muted:true: The audio device is muted.false: The audio device is not muted.
|
|
1700
|
+
* @param muted Whether the audio device is muted: true : The audio device is muted. false : The audio device is not muted.
|
|
1654
1701
|
*/
|
|
1655
1702
|
onAudioDeviceVolumeChanged?(deviceType: MediaDeviceType, volume: number, muted: boolean): void;
|
|
1656
1703
|
/**
|
|
@@ -1681,7 +1728,14 @@ export interface IRtcEngineEventHandler {
|
|
|
1681
1728
|
*
|
|
1682
1729
|
* This callback applies to macOS only.
|
|
1683
1730
|
*
|
|
1684
|
-
* @param routing The current audio routing
|
|
1731
|
+
* @param routing The current audio routing.
|
|
1732
|
+
* -1: The default audio route.
|
|
1733
|
+
* 0: The audio route is a headset with a microphone.
|
|
1734
|
+
* 1: The audio route is an earpiece.
|
|
1735
|
+
* 2: The audio route is a headset without a microphone.
|
|
1736
|
+
* 3: The audio route is the speaker that comes with the device.
|
|
1737
|
+
* 4: The audio route is an external speaker. (For iOS and macOS only)
|
|
1738
|
+
* (5): The audio route is a Bluetooth headset.
|
|
1685
1739
|
*/
|
|
1686
1740
|
onAudioRoutingChanged?(routing: number): void;
|
|
1687
1741
|
/**
|
|
@@ -1763,7 +1817,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1763
1817
|
/**
|
|
1764
1818
|
* Reports the built-in encryption errors.
|
|
1765
1819
|
*
|
|
1766
|
-
* When encryption is enabled by calling enableEncryption
|
|
1820
|
+
* 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.
|
|
1767
1821
|
*
|
|
1768
1822
|
* @param connection The connection information. See RtcConnection.
|
|
1769
1823
|
* @param errorType Details about the error type. See EncryptionErrorType.
|
|
@@ -1852,7 +1906,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1852
1906
|
/**
|
|
1853
1907
|
* Occurs when the extension is enabled.
|
|
1854
1908
|
*
|
|
1855
|
-
* After a successful call of enableExtension (
|
|
1909
|
+
* After a successful call of enableExtension (true), the extension triggers this callback.
|
|
1856
1910
|
*
|
|
1857
1911
|
* @param provider The name of the extension provider.
|
|
1858
1912
|
* @param extension The name of the extension.
|
|
@@ -1861,7 +1915,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1861
1915
|
/**
|
|
1862
1916
|
* Occurs when the extension is disabled.
|
|
1863
1917
|
*
|
|
1864
|
-
* After a successful call of enableExtension (
|
|
1918
|
+
* After a successful call of enableExtension (false), this callback is triggered.
|
|
1865
1919
|
*
|
|
1866
1920
|
* @param provider The name of the extension provider.
|
|
1867
1921
|
* @param extension The name of the extension.
|
|
@@ -1870,7 +1924,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1870
1924
|
/**
|
|
1871
1925
|
* Occurs when the extension runs incorrectly.
|
|
1872
1926
|
*
|
|
1873
|
-
* When calling enableExtension (
|
|
1927
|
+
* When calling enableExtension (true) fails or the extension runs in error, the extension triggers this callback and reports the error code and reason.
|
|
1874
1928
|
*
|
|
1875
1929
|
* @param provider The name of the extension provider.
|
|
1876
1930
|
* @param extension The name of the extension.
|
|
@@ -1885,7 +1939,7 @@ export interface IRtcEngineEventHandler {
|
|
|
1885
1939
|
/**
|
|
1886
1940
|
* Occurs when there's an error during the local video mixing.
|
|
1887
1941
|
*
|
|
1888
|
-
* When you fail to call startLocalVideoTranscoder or updateLocalTranscoderConfiguration
|
|
1942
|
+
* When you fail to call startLocalVideoTranscoder or updateLocalTranscoderConfiguration, the SDK triggers this callback to report the reason.
|
|
1889
1943
|
*
|
|
1890
1944
|
* @param stream The video streams that cannot be mixed during video mixing. See TranscodingVideoStream.
|
|
1891
1945
|
* @param error The reason for local video mixing error. See VideoTranscoderError.
|
|
@@ -1911,7 +1965,8 @@ export declare abstract class IVideoDeviceManager {
|
|
|
1911
1965
|
* Enumerates the video devices.
|
|
1912
1966
|
*
|
|
1913
1967
|
* @returns
|
|
1914
|
-
* Success: A VideoDeviceInfo array including all video devices in the system.
|
|
1968
|
+
* Success: A VideoDeviceInfo array including all video devices in the system.
|
|
1969
|
+
* Failure: An empty array.
|
|
1915
1970
|
*/
|
|
1916
1971
|
abstract enumerateVideoDevices(): VideoDeviceInfo[];
|
|
1917
1972
|
/**
|
|
@@ -1919,10 +1974,11 @@ export declare abstract class IVideoDeviceManager {
|
|
|
1919
1974
|
*
|
|
1920
1975
|
* Plugging or unplugging a device does not change its device ID.
|
|
1921
1976
|
*
|
|
1922
|
-
* @param deviceIdUTF8 The device ID. You can get the device ID by calling enumerateVideoDevices.The maximum length is MaxDeviceIdLengthType.
|
|
1977
|
+
* @param deviceIdUTF8 The device ID. You can get the device ID by calling enumerateVideoDevices. The maximum length is MaxDeviceIdLengthType.
|
|
1923
1978
|
*
|
|
1924
1979
|
* @returns
|
|
1925
|
-
* 0: Success.
|
|
1980
|
+
* 0: Success.
|
|
1981
|
+
* < 0: Failure.
|
|
1926
1982
|
*/
|
|
1927
1983
|
abstract setDevice(deviceIdUTF8: string): number;
|
|
1928
1984
|
/**
|
|
@@ -1940,7 +1996,8 @@ export declare abstract class IVideoDeviceManager {
|
|
|
1940
1996
|
* @param deviceIdUTF8 The ID of the video capture device.
|
|
1941
1997
|
*
|
|
1942
1998
|
* @returns
|
|
1943
|
-
* > 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.
|
|
1999
|
+
* > 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.
|
|
2000
|
+
* ≤ 0: Failure.
|
|
1944
2001
|
*/
|
|
1945
2002
|
abstract numberOfCapabilities(deviceIdUTF8: string): number;
|
|
1946
2003
|
/**
|
|
@@ -1952,7 +2009,7 @@ export declare abstract class IVideoDeviceManager {
|
|
|
1952
2009
|
* @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).
|
|
1953
2010
|
*
|
|
1954
2011
|
* @returns
|
|
1955
|
-
* The specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat
|
|
2012
|
+
* The specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat.
|
|
1956
2013
|
*/
|
|
1957
2014
|
abstract getCapability(deviceIdUTF8: string, deviceCapabilityNumber: number): VideoFormat;
|
|
1958
2015
|
/**
|
|
@@ -1989,11 +2046,21 @@ export declare class RtcEngineContext {
|
|
|
1989
2046
|
*/
|
|
1990
2047
|
audioScenario?: AudioScenarioType;
|
|
1991
2048
|
/**
|
|
1992
|
-
* The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions.
|
|
2049
|
+
* The region for connection. This is an advanced feature and applies to scenarios that have regional restrictions. The area codes support bitwise operation.
|
|
1993
2050
|
*/
|
|
1994
2051
|
areaCode?: number;
|
|
1995
2052
|
/**
|
|
1996
|
-
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
2053
|
+
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
2054
|
+
* The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
|
|
2055
|
+
* 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.
|
|
2056
|
+
* The SDK writes the latest logs in agorasdk.log or agoraapi.log.
|
|
2057
|
+
* When agorasdk.log is full, the SDK processes the log files in the following order:
|
|
2058
|
+
* Delete the agorasdk.4.log file (if any).
|
|
2059
|
+
* Rename agorasdk.3.log to agorasdk.4.log.
|
|
2060
|
+
* Rename agorasdk.2.log to agorasdk.3.log.
|
|
2061
|
+
* Rename agorasdk.1.log to agorasdk.2.log.
|
|
2062
|
+
* Create a new agorasdk.log file.
|
|
2063
|
+
* 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:
|
|
1997
2064
|
*/
|
|
1998
2065
|
logConfig?: LogConfig;
|
|
1999
2066
|
/**
|
|
@@ -2005,11 +2072,11 @@ export declare class RtcEngineContext {
|
|
|
2005
2072
|
*/
|
|
2006
2073
|
useExternalEglContext?: boolean;
|
|
2007
2074
|
/**
|
|
2008
|
-
* 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.
|
|
2075
|
+
* 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.
|
|
2009
2076
|
*/
|
|
2010
2077
|
domainLimit?: boolean;
|
|
2011
2078
|
/**
|
|
2012
|
-
* 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.
|
|
2079
|
+
* 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.
|
|
2013
2080
|
*/
|
|
2014
2081
|
autoRegisterAgoraExtensions?: boolean;
|
|
2015
2082
|
}
|
|
@@ -2048,7 +2115,9 @@ export declare enum MaxMetadataSizeType {
|
|
|
2048
2115
|
*/
|
|
2049
2116
|
export declare class Metadata {
|
|
2050
2117
|
/**
|
|
2051
|
-
* The user ID.
|
|
2118
|
+
* The user ID.
|
|
2119
|
+
* For the recipient:the ID of the remote user who sent the Metadata.
|
|
2120
|
+
* Ignore it for sender.
|
|
2052
2121
|
*/
|
|
2053
2122
|
uid?: number;
|
|
2054
2123
|
/**
|
|
@@ -2182,19 +2251,19 @@ export interface IDirectCdnStreamingEventHandler {
|
|
|
2182
2251
|
*/
|
|
2183
2252
|
export declare class DirectCdnStreamingMediaOptions {
|
|
2184
2253
|
/**
|
|
2185
|
-
* 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.
|
|
2254
|
+
* 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.
|
|
2186
2255
|
*/
|
|
2187
2256
|
publishCameraTrack?: boolean;
|
|
2188
2257
|
/**
|
|
2189
|
-
* 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.
|
|
2258
|
+
* 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.
|
|
2190
2259
|
*/
|
|
2191
2260
|
publishMicrophoneTrack?: boolean;
|
|
2192
2261
|
/**
|
|
2193
|
-
* 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.
|
|
2262
|
+
* 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.
|
|
2194
2263
|
*/
|
|
2195
2264
|
publishCustomAudioTrack?: boolean;
|
|
2196
2265
|
/**
|
|
2197
|
-
* 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.
|
|
2266
|
+
* 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.
|
|
2198
2267
|
*/
|
|
2199
2268
|
publishCustomVideoTrack?: boolean;
|
|
2200
2269
|
/**
|
|
@@ -2240,20 +2309,30 @@ export declare abstract class IRtcEngine {
|
|
|
2240
2309
|
/**
|
|
2241
2310
|
* Releases the IRtcEngine instance.
|
|
2242
2311
|
*
|
|
2243
|
-
* 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.
|
|
2312
|
+
* 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.
|
|
2313
|
+
* 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.
|
|
2314
|
+
* 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.
|
|
2244
2315
|
*
|
|
2245
|
-
* @param sync Whether the method is called synchronously:true: Synchronous call.
|
|
2316
|
+
* @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.
|
|
2246
2317
|
*/
|
|
2247
2318
|
abstract release(sync?: boolean): void;
|
|
2248
2319
|
/**
|
|
2249
2320
|
* Creates and initializes IRtcEngine.
|
|
2250
2321
|
*
|
|
2251
|
-
* All called methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
|
|
2322
|
+
* All called methods provided by the IRtcEngine class are executed asynchronously. Agora recommends calling these methods in the same thread.
|
|
2323
|
+
* Before calling other APIs, you must call createAgoraRtcEngine and initialize to create and initialize the IRtcEngine object.
|
|
2324
|
+
* The SDK supports creating only one IRtcEngine instance for an app.
|
|
2252
2325
|
*
|
|
2253
2326
|
* @param context Configurations for the IRtcEngine instance. See RtcEngineContext.
|
|
2254
2327
|
*
|
|
2255
2328
|
* @returns
|
|
2256
|
-
* 0: Success.
|
|
2329
|
+
* 0: Success.
|
|
2330
|
+
* < 0: Failure.
|
|
2331
|
+
* -1: A general error occurs (no specified reason).
|
|
2332
|
+
* -2: The parameter is invalid.
|
|
2333
|
+
* -7: The SDK is not initialized.
|
|
2334
|
+
* -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.
|
|
2335
|
+
* -101: The App ID is invalid.
|
|
2257
2336
|
*/
|
|
2258
2337
|
abstract initialize(context: RtcEngineContext): number;
|
|
2259
2338
|
/**
|
|
@@ -2276,36 +2355,120 @@ export declare abstract class IRtcEngine {
|
|
|
2276
2355
|
* Queries the current device's supported video codec capabilities.
|
|
2277
2356
|
*
|
|
2278
2357
|
* @returns
|
|
2279
|
-
* 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.
|
|
2358
|
+
* 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.
|
|
2359
|
+
* If the call timeouts, please modify the call logic and do not invoke the method in the main thread.
|
|
2280
2360
|
*/
|
|
2281
2361
|
abstract queryCodecCapability(): {
|
|
2282
2362
|
codecInfo: CodecCapInfo[];
|
|
2283
2363
|
size: number;
|
|
2284
2364
|
};
|
|
2285
2365
|
/**
|
|
2286
|
-
*
|
|
2366
|
+
* Preloads a channel with token, channelId, and uid.
|
|
2367
|
+
*
|
|
2368
|
+
* 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.
|
|
2369
|
+
* 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.
|
|
2370
|
+
* 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.
|
|
2371
|
+
* One IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect.
|
|
2372
|
+
* 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.
|
|
2373
|
+
*
|
|
2374
|
+
* @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.
|
|
2375
|
+
* When preloading one channel, calling this method to pass in the new token.
|
|
2376
|
+
* When preloading more than one channels:
|
|
2377
|
+
* If you use a wildcard token for all preloaded channels, call updatePreloadChannelToken to update the token.
|
|
2378
|
+
* If you use different tokens to preload different channels, call this method to pass in your user ID, channel name and the new token.
|
|
2379
|
+
* @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):
|
|
2380
|
+
* All lowercase English letters: a to z.
|
|
2381
|
+
* All uppercase English letters: A to Z.
|
|
2382
|
+
* All numeric characters: 0 to 9.
|
|
2383
|
+
* Space
|
|
2384
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2385
|
+
* @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.
|
|
2386
|
+
*
|
|
2387
|
+
* @returns
|
|
2388
|
+
* 0: Success.
|
|
2389
|
+
* < 0: Failure.
|
|
2390
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2391
|
+
* -102: The channel name is invalid. You need to pass in a valid channel name and join the channel again.
|
|
2287
2392
|
*/
|
|
2288
2393
|
abstract preloadChannel(token: string, channelId: string, uid: number): number;
|
|
2289
2394
|
/**
|
|
2290
|
-
*
|
|
2395
|
+
* Preloads a channel with token, channelId, and userAccount.
|
|
2396
|
+
*
|
|
2397
|
+
* 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.
|
|
2398
|
+
* 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.
|
|
2399
|
+
* One IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect.
|
|
2400
|
+
* 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.
|
|
2401
|
+
* 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.
|
|
2402
|
+
*
|
|
2403
|
+
* @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.
|
|
2404
|
+
* When preloading one channel, calling this method to pass in the new token.
|
|
2405
|
+
* When preloading more than one channels:
|
|
2406
|
+
* If you use a wildcard token for all preloaded channels, call updatePreloadChannelToken to update the token.
|
|
2407
|
+
* If you use different tokens to preload different channels, call this method to pass in your user ID, channel name and the new token.
|
|
2408
|
+
* @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):
|
|
2409
|
+
* All lowercase English letters: a to z.
|
|
2410
|
+
* All uppercase English letters: A to Z.
|
|
2411
|
+
* All numeric characters: 0 to 9.
|
|
2412
|
+
* Space
|
|
2413
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2414
|
+
* @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):
|
|
2415
|
+
* The 26 lowercase English letters: a to z.
|
|
2416
|
+
* The 26 uppercase English letters: A to Z.
|
|
2417
|
+
* All numeric characters: 0 to 9.
|
|
2418
|
+
* Space
|
|
2419
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2420
|
+
*
|
|
2421
|
+
* @returns
|
|
2422
|
+
* 0: Success.
|
|
2423
|
+
* < 0: Failure.
|
|
2424
|
+
* -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.
|
|
2425
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2426
|
+
* -102: The channel name is invalid. You need to pass in a valid channel name and join the channel again.
|
|
2291
2427
|
*/
|
|
2292
2428
|
abstract preloadChannelWithUserAccount(token: string, channelId: string, userAccount: string): number;
|
|
2293
2429
|
/**
|
|
2294
|
-
*
|
|
2430
|
+
* Updates the wildcard token for preloading channels.
|
|
2431
|
+
*
|
|
2432
|
+
* 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.
|
|
2433
|
+
*
|
|
2434
|
+
* @param token The new token.
|
|
2435
|
+
*
|
|
2436
|
+
* @returns
|
|
2437
|
+
* 0: Success.
|
|
2438
|
+
* < 0: Failure.
|
|
2439
|
+
* -2: The parameter is invalid. For example, the token is invalid. You need to pass in a valid parameter and join the channel again.
|
|
2440
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2295
2441
|
*/
|
|
2296
2442
|
abstract updatePreloadChannelToken(token: string): number;
|
|
2297
2443
|
/**
|
|
2298
2444
|
* Joins a channel with media options.
|
|
2299
2445
|
*
|
|
2300
|
-
* 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:
|
|
2446
|
+
* 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:
|
|
2447
|
+
* The local client: The onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
2448
|
+
* 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.
|
|
2449
|
+
* This method allows users to join only one channel at a time.
|
|
2450
|
+
* 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.
|
|
2301
2451
|
*
|
|
2302
2452
|
* @param token The token generated on your server for authentication.
|
|
2303
|
-
* @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:
|
|
2304
|
-
*
|
|
2453
|
+
* @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:
|
|
2454
|
+
* All lowercase English letters: a to z.
|
|
2455
|
+
* All uppercase English letters: A to Z.
|
|
2456
|
+
* All numeric characters: 0 to 9.
|
|
2457
|
+
* Space
|
|
2458
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
2459
|
+
* @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.
|
|
2305
2460
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
2306
2461
|
*
|
|
2307
2462
|
* @returns
|
|
2308
|
-
* 0: Success.
|
|
2463
|
+
* 0: Success.
|
|
2464
|
+
* < 0: Failure.
|
|
2465
|
+
* -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.
|
|
2466
|
+
* -3: Failes to initialize the IRtcEngine object. You need to reinitialize the IRtcEngine object.
|
|
2467
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2468
|
+
* -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.
|
|
2469
|
+
* -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.
|
|
2470
|
+
* -102: The channel name is invalid. You need to pass in a valid channelname in channelId to rejoin the channel.
|
|
2471
|
+
* -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel.
|
|
2309
2472
|
*/
|
|
2310
2473
|
abstract joinChannel(token: string, channelId: string, uid: number, options: ChannelMediaOptions): number;
|
|
2311
2474
|
/**
|
|
@@ -2314,63 +2477,91 @@ export declare abstract class IRtcEngine {
|
|
|
2314
2477
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
2315
2478
|
*
|
|
2316
2479
|
* @returns
|
|
2317
|
-
* 0: Success.
|
|
2480
|
+
* 0: Success.
|
|
2481
|
+
* < 0: Failure.
|
|
2482
|
+
* -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.
|
|
2483
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2484
|
+
* -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.
|
|
2318
2485
|
*/
|
|
2319
2486
|
abstract updateChannelMediaOptions(options: ChannelMediaOptions): number;
|
|
2320
2487
|
/**
|
|
2321
2488
|
* Sets channel options and leaves the channel.
|
|
2322
2489
|
*
|
|
2323
|
-
* If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
|
|
2490
|
+
* If you call release immediately after calling this method, the SDK does not trigger the onLeaveChannel callback.
|
|
2491
|
+
* 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.
|
|
2324
2492
|
*
|
|
2325
2493
|
* @param options The options for leaving the channel. See LeaveChannelOptions.
|
|
2326
2494
|
*
|
|
2327
2495
|
* @returns
|
|
2328
|
-
* 0: Success.
|
|
2496
|
+
* 0: Success.
|
|
2497
|
+
* < 0: Failure.
|
|
2329
2498
|
*/
|
|
2330
2499
|
abstract leaveChannel(options?: LeaveChannelOptions): number;
|
|
2331
2500
|
/**
|
|
2332
2501
|
* Renews the token.
|
|
2333
2502
|
*
|
|
2334
|
-
* The SDK triggers the onTokenPrivilegeWillExpire callback.
|
|
2503
|
+
* The SDK triggers the onTokenPrivilegeWillExpire callback.
|
|
2504
|
+
* The onConnectionStateChanged callback reports ConnectionChangedTokenExpired (9).
|
|
2335
2505
|
*
|
|
2336
2506
|
* @param token The new token.
|
|
2337
2507
|
*
|
|
2338
2508
|
* @returns
|
|
2339
|
-
* 0: Success.
|
|
2509
|
+
* 0: Success.
|
|
2510
|
+
* < 0: Failure.
|
|
2511
|
+
* -2: The parameter is invalid. For example, the token is invalid. You need to fill in a valid parameter.
|
|
2512
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
2340
2513
|
*/
|
|
2341
2514
|
abstract renewToken(token: string): number;
|
|
2342
2515
|
/**
|
|
2343
2516
|
* Sets the channel profile.
|
|
2344
2517
|
*
|
|
2345
|
-
* 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.
|
|
2518
|
+
* 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.
|
|
2519
|
+
* To ensure the quality of real-time communication, Agora recommends that all users in a channel use the same channel profile.
|
|
2520
|
+
* This method must be called and set before joinChannel, and cannot be set again after joining the channel.
|
|
2521
|
+
* The default video encoding bitrate are different in different channel profiles. See setVideoEncoderConfiguration.
|
|
2346
2522
|
*
|
|
2347
2523
|
* @param profile The channel profile. See ChannelProfileType.
|
|
2348
2524
|
*
|
|
2349
2525
|
* @returns
|
|
2350
|
-
* 0(ERR_OK): Success.
|
|
2526
|
+
* 0(ERR_OK): Success.
|
|
2527
|
+
* < 0: Failure.
|
|
2528
|
+
* -2: The parameter is invalid.
|
|
2529
|
+
* -7: The SDK is not initialized.
|
|
2351
2530
|
*/
|
|
2352
2531
|
abstract setChannelProfile(profile: ChannelProfileType): number;
|
|
2353
2532
|
/**
|
|
2354
2533
|
* Sets the user role and level in an interactive live streaming channel.
|
|
2355
2534
|
*
|
|
2356
|
-
* 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:
|
|
2535
|
+
* 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:
|
|
2536
|
+
* Calls muteLocalAudioStream and muteLocalVideoStream to change the publishing state.
|
|
2537
|
+
* Triggers onClientRoleChanged on the local client.
|
|
2538
|
+
* 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.
|
|
2357
2539
|
*
|
|
2358
2540
|
* @param role The user role in the interactive live streaming. See ClientRoleType.
|
|
2359
2541
|
* @param options The detailed options of a user, including the user level. See ClientRoleOptions.
|
|
2360
2542
|
*
|
|
2361
2543
|
* @returns
|
|
2362
|
-
* 0: Success.
|
|
2544
|
+
* 0: Success.
|
|
2545
|
+
* < 0: Failure.
|
|
2546
|
+
* -1: A general error occurs (no specified reason).
|
|
2547
|
+
* -2: The parameter is invalid.
|
|
2548
|
+
* -5: The request is rejected.
|
|
2549
|
+
* -7: The SDK is not initialized.
|
|
2363
2550
|
*/
|
|
2364
2551
|
abstract setClientRole(role: ClientRoleType, options?: ClientRoleOptions): number;
|
|
2365
2552
|
/**
|
|
2366
2553
|
* Starts an audio device loopback test.
|
|
2367
2554
|
*
|
|
2368
|
-
* 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.
|
|
2555
|
+
* 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.
|
|
2556
|
+
* 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.
|
|
2557
|
+
* 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.
|
|
2558
|
+
* In live streaming scenarios, this method only applies to hosts.
|
|
2369
2559
|
*
|
|
2370
2560
|
* @param config The configuration of the audio and video call loop test. See EchoTestConfiguration.
|
|
2371
2561
|
*
|
|
2372
2562
|
* @returns
|
|
2373
|
-
* 0: Success.
|
|
2563
|
+
* 0: Success.
|
|
2564
|
+
* < 0: Failure.
|
|
2374
2565
|
*/
|
|
2375
2566
|
abstract startEchoTest(config: EchoTestConfiguration): number;
|
|
2376
2567
|
/**
|
|
@@ -2378,48 +2569,75 @@ export declare abstract class IRtcEngine {
|
|
|
2378
2569
|
*
|
|
2379
2570
|
* @returns
|
|
2380
2571
|
* 0: Success.
|
|
2381
|
-
* < 0: Failure.
|
|
2572
|
+
* < 0: Failure.
|
|
2573
|
+
* -5(ERR_REFUSED): Failed to stop the echo test. The echo test may not be running.
|
|
2382
2574
|
*/
|
|
2383
2575
|
abstract stopEchoTest(): number;
|
|
2384
2576
|
/**
|
|
2385
2577
|
* Enables or disables multi-camera capture.
|
|
2386
2578
|
*
|
|
2387
|
-
* 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:
|
|
2388
|
-
*
|
|
2389
|
-
*
|
|
2579
|
+
* 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:
|
|
2580
|
+
* Call this method to enable multi-channel camera capture.
|
|
2581
|
+
* Call startPreview to start the local video preview.
|
|
2582
|
+
* Call startCameraCapture, and set sourceType to start video capture with the second camera.
|
|
2583
|
+
* 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:
|
|
2584
|
+
* Call stopCameraCapture.
|
|
2585
|
+
* Call this method with enabled set to false. You can call this method before and after startPreview to enable multi-camera capture:
|
|
2586
|
+
* If it is enabled before startPreview, the local video preview shows the image captured by the two cameras at the same time.
|
|
2587
|
+
* If it is enabled after startPreview, the SDK stops the current camera capture first, and then enables the primary camera and the second camera. The local video preview appears black for a short time, and then automatically returns to normal. When using this function, ensure that the system version is 13.0 or later. The minimum iOS device types that support multi-camera capture are as follows:
|
|
2588
|
+
* iPhone XR
|
|
2589
|
+
* iPhone XS
|
|
2590
|
+
* iPhone XS Max
|
|
2591
|
+
* iPad Pro 3rd generation and later
|
|
2592
|
+
*
|
|
2593
|
+
* @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.
|
|
2390
2594
|
* @param config Capture configuration for the second camera. See CameraCapturerConfiguration.
|
|
2391
2595
|
*
|
|
2392
2596
|
* @returns
|
|
2393
|
-
* 0: Success.
|
|
2597
|
+
* 0: Success.
|
|
2598
|
+
* < 0: Failure.
|
|
2394
2599
|
*/
|
|
2395
2600
|
abstract enableMultiCamera(enabled: boolean, config: CameraCapturerConfiguration): number;
|
|
2396
2601
|
/**
|
|
2397
2602
|
* Enables the video module.
|
|
2398
2603
|
*
|
|
2399
|
-
* 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.
|
|
2604
|
+
* 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.
|
|
2605
|
+
* This method enables the internal engine and is valid after leaving the channel.
|
|
2606
|
+
* 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.
|
|
2607
|
+
* A successful call of this method resets enableLocalVideo, muteRemoteVideoStream, and muteAllRemoteVideoStreams. Proceed it with caution.
|
|
2400
2608
|
*
|
|
2401
2609
|
* @returns
|
|
2402
|
-
* 0: Success.
|
|
2610
|
+
* 0: Success.
|
|
2611
|
+
* < 0: Failure.
|
|
2403
2612
|
*/
|
|
2404
2613
|
abstract enableVideo(): number;
|
|
2405
2614
|
/**
|
|
2406
2615
|
* Disables the video module.
|
|
2407
2616
|
*
|
|
2408
|
-
* 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 (
|
|
2617
|
+
* 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.
|
|
2618
|
+
* This method affects the internal engine and can be called after leaving the channel.
|
|
2619
|
+
* 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.
|
|
2409
2620
|
*
|
|
2410
2621
|
* @returns
|
|
2411
|
-
* 0: Success.
|
|
2622
|
+
* 0: Success.
|
|
2623
|
+
* < 0: Failure.
|
|
2412
2624
|
*/
|
|
2413
2625
|
abstract disableVideo(): number;
|
|
2414
2626
|
/**
|
|
2415
2627
|
* Enables the local video preview and specifies the video source for the preview.
|
|
2416
2628
|
*
|
|
2417
|
-
* You can call this method to enable local video preview.
|
|
2629
|
+
* You can call this method to enable local video preview. Call this method after the following:
|
|
2630
|
+
* Call setView to initialize the local preview.
|
|
2631
|
+
* Call enableVideo to enable the video module.
|
|
2632
|
+
* The local preview enables the mirror mode by default.
|
|
2633
|
+
* 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.
|
|
2634
|
+
* The video source type set in this method needs to be consistent with the video source type of VideoCanvas you set in setupLocalVideo.
|
|
2418
2635
|
*
|
|
2419
2636
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
2420
2637
|
*
|
|
2421
2638
|
* @returns
|
|
2422
|
-
* 0: Success.
|
|
2639
|
+
* 0: Success.
|
|
2640
|
+
* < 0: Failure.
|
|
2423
2641
|
*/
|
|
2424
2642
|
abstract startPreview(sourceType?: VideoSourceType): number;
|
|
2425
2643
|
/**
|
|
@@ -2430,25 +2648,32 @@ export declare abstract class IRtcEngine {
|
|
|
2430
2648
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
2431
2649
|
*
|
|
2432
2650
|
* @returns
|
|
2433
|
-
*
|
|
2651
|
+
* 0: Success.
|
|
2652
|
+
* < 0: Failure.
|
|
2434
2653
|
*/
|
|
2435
2654
|
abstract stopPreview(sourceType?: VideoSourceType): number;
|
|
2436
2655
|
/**
|
|
2437
2656
|
* Starts the last mile network probe test.
|
|
2438
2657
|
*
|
|
2439
|
-
* 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:
|
|
2658
|
+
* 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:
|
|
2659
|
+
* Before a user joins a channel, call this method to check the uplink network quality.
|
|
2660
|
+
* In a live streaming channel, call this method to check the uplink network quality before an audience member switches to a host.
|
|
2661
|
+
* Do not call other methods before receiving the onLastmileQuality and onLastmileProbeResult callbacks. Otherwise, the callbacks may be interrupted.
|
|
2662
|
+
* A host should not call this method after joining a channel (when in a call).
|
|
2440
2663
|
*
|
|
2441
2664
|
* @param config The configurations of the last-mile network probe test. See LastmileProbeConfig.
|
|
2442
2665
|
*
|
|
2443
2666
|
* @returns
|
|
2444
|
-
* 0: Success.
|
|
2667
|
+
* 0: Success.
|
|
2668
|
+
* < 0: Failure.
|
|
2445
2669
|
*/
|
|
2446
2670
|
abstract startLastmileProbeTest(config: LastmileProbeConfig): number;
|
|
2447
2671
|
/**
|
|
2448
2672
|
* Stops the last mile network probe test.
|
|
2449
2673
|
*
|
|
2450
2674
|
* @returns
|
|
2451
|
-
* 0: Success.
|
|
2675
|
+
* 0: Success.
|
|
2676
|
+
* < 0: Failure.
|
|
2452
2677
|
*/
|
|
2453
2678
|
abstract stopLastmileProbeTest(): number;
|
|
2454
2679
|
/**
|
|
@@ -2459,95 +2684,138 @@ export declare abstract class IRtcEngine {
|
|
|
2459
2684
|
* @param config Video profile. See VideoEncoderConfiguration.
|
|
2460
2685
|
*
|
|
2461
2686
|
* @returns
|
|
2462
|
-
* 0: Success.
|
|
2687
|
+
* 0: Success.
|
|
2688
|
+
* < 0: Failure.
|
|
2463
2689
|
*/
|
|
2464
2690
|
abstract setVideoEncoderConfiguration(config: VideoEncoderConfiguration): number;
|
|
2465
2691
|
/**
|
|
2466
2692
|
* Sets the image enhancement options.
|
|
2467
2693
|
*
|
|
2468
|
-
* Enables or disables image enhancement, and sets the options.
|
|
2694
|
+
* Enables or disables image enhancement, and sets the options.
|
|
2695
|
+
* Call this method before calling enableVideo or startPreview.
|
|
2696
|
+
* 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.
|
|
2469
2697
|
*
|
|
2470
|
-
* @param enabled Whether to enable the image enhancement function:true: Enable the image enhancement function.false: (Default) Disable the image enhancement function.
|
|
2698
|
+
* @param enabled Whether to enable the image enhancement function: true : Enable the image enhancement function. false : (Default) Disable the image enhancement function.
|
|
2471
2699
|
* @param options The image enhancement options. See BeautyOptions.
|
|
2472
|
-
* @param type
|
|
2700
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
2701
|
+
* The default value is UnknownMediaSource.
|
|
2702
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
2473
2703
|
*
|
|
2474
2704
|
* @returns
|
|
2475
|
-
* 0: Success.
|
|
2705
|
+
* 0: Success.
|
|
2706
|
+
* < 0: Failure.
|
|
2476
2707
|
*/
|
|
2477
2708
|
abstract setBeautyEffectOptions(enabled: boolean, options: BeautyOptions, type?: MediaSourceType): number;
|
|
2478
2709
|
/**
|
|
2479
2710
|
* Sets low-light enhancement.
|
|
2480
2711
|
*
|
|
2481
|
-
* 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.
|
|
2712
|
+
* 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.
|
|
2713
|
+
* Call this method after calling enableVideo.
|
|
2714
|
+
* 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.
|
|
2715
|
+
* Both this method and setExtensionProperty can turn on low-light enhancement:
|
|
2716
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
2717
|
+
* 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.
|
|
2718
|
+
* 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.
|
|
2482
2719
|
*
|
|
2483
|
-
* @param enabled Whether to enable low-light enhancement function:true: Enable low-light enhancement function.false: (Default) Disable low-light enhancement function.
|
|
2720
|
+
* @param enabled Whether to enable low-light enhancement function: true : Enable low-light enhancement function. false : (Default) Disable low-light enhancement function.
|
|
2484
2721
|
* @param options The low-light enhancement options. See LowlightEnhanceOptions.
|
|
2485
2722
|
* @param type The type of the video source. See MediaSourceType.
|
|
2486
2723
|
*
|
|
2487
2724
|
* @returns
|
|
2488
|
-
* 0: Success.
|
|
2725
|
+
* 0: Success.
|
|
2726
|
+
* < 0: Failure.
|
|
2489
2727
|
*/
|
|
2490
2728
|
abstract setLowlightEnhanceOptions(enabled: boolean, options: LowlightEnhanceOptions, type?: MediaSourceType): number;
|
|
2491
2729
|
/**
|
|
2492
2730
|
* Sets video noise reduction.
|
|
2493
2731
|
*
|
|
2494
|
-
* 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.
|
|
2732
|
+
* 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.
|
|
2733
|
+
* Call this method after calling enableVideo.
|
|
2734
|
+
* 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.
|
|
2735
|
+
* Both this method and setExtensionProperty can turn on video noise reduction function:
|
|
2736
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
2737
|
+
* 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.
|
|
2738
|
+
* 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.
|
|
2495
2739
|
*
|
|
2496
|
-
* @param enabled Whether to enable video noise reduction:true: Enable video noise reduction.false: (Default) Disable video noise reduction.
|
|
2740
|
+
* @param enabled Whether to enable video noise reduction: true : Enable video noise reduction. false : (Default) Disable video noise reduction.
|
|
2497
2741
|
* @param options The video noise reduction options. See VideoDenoiserOptions.
|
|
2498
2742
|
* @param type The type of the video source. See MediaSourceType.
|
|
2499
2743
|
*
|
|
2500
2744
|
* @returns
|
|
2501
|
-
* 0: Success.
|
|
2745
|
+
* 0: Success.
|
|
2746
|
+
* < 0: Failure.
|
|
2502
2747
|
*/
|
|
2503
2748
|
abstract setVideoDenoiserOptions(enabled: boolean, options: VideoDenoiserOptions, type?: MediaSourceType): number;
|
|
2504
2749
|
/**
|
|
2505
2750
|
* Sets color enhancement.
|
|
2506
2751
|
*
|
|
2507
|
-
* 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.
|
|
2752
|
+
* 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.
|
|
2753
|
+
* Call this method after calling enableVideo.
|
|
2754
|
+
* 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.
|
|
2755
|
+
* Both this method and setExtensionProperty can enable color enhancement:
|
|
2756
|
+
* When you use the SDK to capture video, Agora recommends this method (this method only works for video captured by the SDK).
|
|
2757
|
+
* 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.
|
|
2758
|
+
* 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.
|
|
2508
2759
|
*
|
|
2509
|
-
* @param enabled Whether to enable color enhancement:true Enable color enhancement.false: (Default) Disable color enhancement.
|
|
2760
|
+
* @param enabled Whether to enable color enhancement: true Enable color enhancement. false : (Default) Disable color enhancement.
|
|
2510
2761
|
* @param options The color enhancement options. See ColorEnhanceOptions.
|
|
2511
2762
|
* @param type The type of the video source. See MediaSourceType.
|
|
2512
2763
|
*
|
|
2513
2764
|
* @returns
|
|
2514
|
-
* 0: Success.
|
|
2765
|
+
* 0: Success.
|
|
2766
|
+
* < 0: Failure.
|
|
2515
2767
|
*/
|
|
2516
2768
|
abstract setColorEnhanceOptions(enabled: boolean, options: ColorEnhanceOptions, type?: MediaSourceType): number;
|
|
2517
2769
|
/**
|
|
2518
2770
|
* Enables/Disables the virtual background.
|
|
2519
2771
|
*
|
|
2520
|
-
* 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 .
|
|
2772
|
+
* The virtual background feature enables the local user to replace their original background with a static image, dynamic video, blurred background, or portrait-background segmentation to achieve picture-in-picture effect. Once the virtual background feature is enabled, all users in the channel can see the custom background. Call this method before calling enableVideo or startPreview.
|
|
2773
|
+
* This feature requires high performance devices. Agora recommends that you implement it on devices equipped with the following chips:
|
|
2774
|
+
* Devices with an i5 CPU and better
|
|
2775
|
+
* Agora recommends that you use this feature in scenarios that meet the following conditions:
|
|
2776
|
+
* A high-definition camera device is used, and the environment is uniformly lit.
|
|
2777
|
+
* 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.
|
|
2778
|
+
* 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.
|
|
2521
2779
|
*
|
|
2522
|
-
* @param enabled Whether to enable virtual background:true: Enable virtual background.false: Disable virtual background.
|
|
2780
|
+
* @param enabled Whether to enable virtual background: true : Enable virtual background. false : Disable virtual background.
|
|
2523
2781
|
* @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.
|
|
2524
2782
|
* @param segproperty Processing properties for background images. See SegmentationProperty.
|
|
2525
|
-
* @param type The type of the video source. See MediaSourceType.In this method, this parameter supports only the following two settings:
|
|
2783
|
+
* @param type The type of the video source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
2784
|
+
* The default value is PrimaryCameraSource.
|
|
2785
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
2526
2786
|
*
|
|
2527
2787
|
* @returns
|
|
2528
|
-
* 0: Success.
|
|
2788
|
+
* 0: Success.
|
|
2789
|
+
* < 0: Failure.
|
|
2790
|
+
* -1: The custom background image does not exist. Check the value of source in VirtualBackgroundSource.
|
|
2791
|
+
* -2: The color format of the custom background image is invalid. Check the value of color in VirtualBackgroundSource.
|
|
2792
|
+
* -3: The device does not support virtual background.
|
|
2529
2793
|
*/
|
|
2530
2794
|
abstract enableVirtualBackground(enabled: boolean, backgroundSource: VirtualBackgroundSource, segproperty: SegmentationProperty, type?: MediaSourceType): number;
|
|
2531
2795
|
/**
|
|
2532
2796
|
* Initializes the video view of a remote user.
|
|
2533
2797
|
*
|
|
2534
|
-
* 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.
|
|
2798
|
+
* 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.
|
|
2799
|
+
* 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.
|
|
2535
2800
|
*
|
|
2536
2801
|
* @param canvas The remote video view and settings. See VideoCanvas.
|
|
2537
2802
|
*
|
|
2538
2803
|
* @returns
|
|
2539
|
-
* 0: Success.
|
|
2804
|
+
* 0: Success.
|
|
2805
|
+
* < 0: Failure.
|
|
2540
2806
|
*/
|
|
2541
2807
|
abstract setupRemoteVideo(canvas: VideoCanvas): number;
|
|
2542
2808
|
/**
|
|
2543
2809
|
* Initializes the local video view.
|
|
2544
2810
|
*
|
|
2545
|
-
* 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
|
|
2811
|
+
* 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.
|
|
2812
|
+
* You can call this method either before or after joining a channel.
|
|
2546
2813
|
*
|
|
2547
2814
|
* @param canvas The local video view and settings. See VideoCanvas.
|
|
2548
2815
|
*
|
|
2549
2816
|
* @returns
|
|
2550
|
-
* 0: Success.
|
|
2817
|
+
* 0: Success.
|
|
2818
|
+
* < 0: Failure.
|
|
2551
2819
|
*/
|
|
2552
2820
|
abstract setupLocalVideo(canvas: VideoCanvas): number;
|
|
2553
2821
|
/**
|
|
@@ -2555,40 +2823,62 @@ export declare abstract class IRtcEngine {
|
|
|
2555
2823
|
*
|
|
2556
2824
|
* 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.
|
|
2557
2825
|
*
|
|
2558
|
-
* @param scenarioType The type of video application scenario. See VideoApplicationScenarioType.If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
|
|
2826
|
+
* @param scenarioType The type of video application scenario. See VideoApplicationScenarioType. If set to ApplicationScenarioMeeting (1), the SDK automatically enables the following strategies:
|
|
2827
|
+
* 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.
|
|
2828
|
+
* 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.
|
|
2829
|
+
* If nobody subscribers to the high-quality stream, the SDK automatically reduces its bitrate and frame rate to save upstream bandwidth.
|
|
2830
|
+
* 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:
|
|
2831
|
+
* Resolution: 1280 × 720
|
|
2832
|
+
* Frame rate: 15 fps
|
|
2833
|
+
* Bitrate: 1600 Kbps
|
|
2834
|
+
* 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.
|
|
2835
|
+
* If nobody subscribes to the low-quality stream, the SDK automatically disables it to save upstream bandwidth.
|
|
2836
|
+
* 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:
|
|
2837
|
+
* Resolution: 480 × 272
|
|
2838
|
+
* Frame rate: 15 fps
|
|
2839
|
+
* Bitrate: 500 Kbps
|
|
2559
2840
|
*
|
|
2560
2841
|
* @returns
|
|
2561
|
-
* 0: Success.
|
|
2842
|
+
* 0: Success.
|
|
2843
|
+
* < 0: Failure.
|
|
2562
2844
|
*/
|
|
2563
2845
|
abstract setVideoScenario(scenarioType: VideoApplicationScenarioType): number;
|
|
2564
2846
|
/**
|
|
2565
2847
|
* Enables the audio module.
|
|
2566
2848
|
*
|
|
2567
|
-
* The audio mode is enabled by default.
|
|
2849
|
+
* The audio mode is enabled by default.
|
|
2850
|
+
* This method enables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
2851
|
+
* 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.
|
|
2852
|
+
* A successful call of this method resets enableLocalAudio, muteRemoteAudioStream, and muteAllRemoteAudioStreams. Proceed it with caution.
|
|
2568
2853
|
*
|
|
2569
2854
|
* @returns
|
|
2570
|
-
* 0: Success.
|
|
2855
|
+
* 0: Success.
|
|
2856
|
+
* < 0: Failure.
|
|
2571
2857
|
*/
|
|
2572
2858
|
abstract enableAudio(): number;
|
|
2573
2859
|
/**
|
|
2574
2860
|
* Disables the audio module.
|
|
2575
2861
|
*
|
|
2576
|
-
* This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
2862
|
+
* This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel.
|
|
2863
|
+
* 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.
|
|
2577
2864
|
*
|
|
2578
2865
|
* @returns
|
|
2579
|
-
* 0: Success.
|
|
2866
|
+
* 0: Success.
|
|
2867
|
+
* < 0: Failure.
|
|
2580
2868
|
*/
|
|
2581
2869
|
abstract disableAudio(): number;
|
|
2582
2870
|
/**
|
|
2583
2871
|
* Sets the audio profile and audio scenario.
|
|
2584
2872
|
*
|
|
2585
|
-
* You can call this method either before or after joining a channel.
|
|
2873
|
+
* You can call this method either before or after joining a channel.
|
|
2874
|
+
* In scenarios requiring high-quality audio, such as online music tutoring, Agora recommends you set profile as AudioProfileMusicHighQuality (4) and scenario as AudioScenarioGameStreaming (3).
|
|
2586
2875
|
*
|
|
2587
2876
|
* @param profile The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AudioProfileType.
|
|
2588
2877
|
* @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
|
|
2589
2878
|
*
|
|
2590
2879
|
* @returns
|
|
2591
|
-
* 0: Success.
|
|
2880
|
+
* 0: Success.
|
|
2881
|
+
* < 0: Failure.
|
|
2592
2882
|
*/
|
|
2593
2883
|
abstract setAudioProfile(profile: AudioProfileType, scenario?: AudioScenarioType): number;
|
|
2594
2884
|
/**
|
|
@@ -2599,18 +2889,22 @@ export declare abstract class IRtcEngine {
|
|
|
2599
2889
|
* @param scenario The audio scenarios. See AudioScenarioType. Under different audio scenarios, the device uses different volume types.
|
|
2600
2890
|
*
|
|
2601
2891
|
* @returns
|
|
2602
|
-
* 0: Success.
|
|
2892
|
+
* 0: Success.
|
|
2893
|
+
* < 0: Failure.
|
|
2603
2894
|
*/
|
|
2604
2895
|
abstract setAudioScenario(scenario: AudioScenarioType): number;
|
|
2605
2896
|
/**
|
|
2606
2897
|
* Enables or disables the local audio capture.
|
|
2607
2898
|
*
|
|
2608
|
-
* 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 (
|
|
2899
|
+
* 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).
|
|
2900
|
+
* 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.
|
|
2901
|
+
* 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.
|
|
2609
2902
|
*
|
|
2610
|
-
* @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.
|
|
2903
|
+
* @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.
|
|
2611
2904
|
*
|
|
2612
2905
|
* @returns
|
|
2613
|
-
* 0: Success.
|
|
2906
|
+
* 0: Success.
|
|
2907
|
+
* < 0: Failure.
|
|
2614
2908
|
*/
|
|
2615
2909
|
abstract enableLocalAudio(enabled: boolean): number;
|
|
2616
2910
|
/**
|
|
@@ -2618,21 +2912,25 @@ export declare abstract class IRtcEngine {
|
|
|
2618
2912
|
*
|
|
2619
2913
|
* 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.
|
|
2620
2914
|
*
|
|
2621
|
-
* @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.
|
|
2915
|
+
* @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.
|
|
2622
2916
|
*
|
|
2623
2917
|
* @returns
|
|
2624
|
-
* 0: Success.
|
|
2918
|
+
* 0: Success.
|
|
2919
|
+
* < 0: Failure.
|
|
2625
2920
|
*/
|
|
2626
2921
|
abstract muteLocalAudioStream(mute: boolean): number;
|
|
2627
2922
|
/**
|
|
2628
2923
|
* Stops or resumes subscribing to the audio streams of all remote users.
|
|
2629
2924
|
*
|
|
2630
|
-
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
2925
|
+
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
2926
|
+
* Call this method after joining a channel.
|
|
2927
|
+
* 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.
|
|
2631
2928
|
*
|
|
2632
|
-
* @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.
|
|
2929
|
+
* @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.
|
|
2633
2930
|
*
|
|
2634
2931
|
* @returns
|
|
2635
|
-
* 0: Success.
|
|
2932
|
+
* 0: Success.
|
|
2933
|
+
* < 0: Failure.
|
|
2636
2934
|
*/
|
|
2637
2935
|
abstract muteAllRemoteAudioStreams(mute: boolean): number;
|
|
2638
2936
|
/**
|
|
@@ -2645,43 +2943,53 @@ export declare abstract class IRtcEngine {
|
|
|
2645
2943
|
* Call this method after joining a channel.
|
|
2646
2944
|
*
|
|
2647
2945
|
* @param uid The user ID of the specified user.
|
|
2648
|
-
* @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.
|
|
2946
|
+
* @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.
|
|
2649
2947
|
*
|
|
2650
2948
|
* @returns
|
|
2651
|
-
* 0: Success.
|
|
2949
|
+
* 0: Success.
|
|
2950
|
+
* < 0: Failure.
|
|
2652
2951
|
*/
|
|
2653
2952
|
abstract muteRemoteAudioStream(uid: number, mute: boolean): number;
|
|
2654
2953
|
/**
|
|
2655
2954
|
* Stops or resumes publishing the local video stream.
|
|
2656
2955
|
*
|
|
2657
|
-
* A successful call of this method triggers the onUserMuteVideo callback on the remote client.
|
|
2956
|
+
* A successful call of this method triggers the onUserMuteVideo callback on the remote client.
|
|
2957
|
+
* This method executes faster than the enableLocalVideo (false) method, which controls the sending of the local video stream.
|
|
2958
|
+
* This method does not affect any ongoing video recording, because it does not disable the camera.
|
|
2658
2959
|
*
|
|
2659
|
-
* @param mute Whether to stop publishing the local video stream.true: Stop publishing the local video stream.false: (Default) Publish the local video stream.
|
|
2960
|
+
* @param mute Whether to stop publishing the local video stream. true : Stop publishing the local video stream. false : (Default) Publish the local video stream.
|
|
2660
2961
|
*
|
|
2661
2962
|
* @returns
|
|
2662
|
-
* 0: Success.
|
|
2963
|
+
* 0: Success.
|
|
2964
|
+
* < 0: Failure.
|
|
2663
2965
|
*/
|
|
2664
2966
|
abstract muteLocalVideoStream(mute: boolean): number;
|
|
2665
2967
|
/**
|
|
2666
2968
|
* Enables/Disables the local video capture.
|
|
2667
2969
|
*
|
|
2668
|
-
* This method disables or re-enables the local video capture, and does not affect receiving the remote video stream. After calling enableVideo
|
|
2970
|
+
* 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.
|
|
2971
|
+
* You can call this method either before or after joining a channel.
|
|
2972
|
+
* This method enables the internal engine and is valid after leaving the channel.
|
|
2669
2973
|
*
|
|
2670
|
-
* @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.
|
|
2974
|
+
* @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.
|
|
2671
2975
|
*
|
|
2672
2976
|
* @returns
|
|
2673
|
-
* 0: Success.
|
|
2977
|
+
* 0: Success.
|
|
2978
|
+
* < 0: Failure.
|
|
2674
2979
|
*/
|
|
2675
2980
|
abstract enableLocalVideo(enabled: boolean): number;
|
|
2676
2981
|
/**
|
|
2677
2982
|
* Stops or resumes subscribing to the video streams of all remote users.
|
|
2678
2983
|
*
|
|
2679
|
-
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
2984
|
+
* After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users.
|
|
2985
|
+
* Call this method after joining a channel.
|
|
2986
|
+
* 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.
|
|
2680
2987
|
*
|
|
2681
|
-
* @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.
|
|
2988
|
+
* @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.
|
|
2682
2989
|
*
|
|
2683
2990
|
* @returns
|
|
2684
|
-
* 0: Success.
|
|
2991
|
+
* 0: Success.
|
|
2992
|
+
* < 0: Failure.
|
|
2685
2993
|
*/
|
|
2686
2994
|
abstract muteAllRemoteVideoStreams(mute: boolean): number;
|
|
2687
2995
|
/**
|
|
@@ -2694,93 +3002,126 @@ export declare abstract class IRtcEngine {
|
|
|
2694
3002
|
* Call this method after joining a channel.
|
|
2695
3003
|
*
|
|
2696
3004
|
* @param uid The user ID of the specified user.
|
|
2697
|
-
* @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.
|
|
3005
|
+
* @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.
|
|
2698
3006
|
*
|
|
2699
3007
|
* @returns
|
|
2700
|
-
* 0: Success.
|
|
3008
|
+
* 0: Success.
|
|
3009
|
+
* < 0: Failure.
|
|
2701
3010
|
*/
|
|
2702
3011
|
abstract muteRemoteVideoStream(uid: number, mute: boolean): number;
|
|
2703
3012
|
/**
|
|
2704
3013
|
* Sets the stream type of the remote video.
|
|
2705
3014
|
*
|
|
2706
|
-
* Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (
|
|
3015
|
+
* Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream. By default, the SDK enables the low-quality video stream auto mode on the sending end (it does not actively send the low-quality video stream). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling this method (the call to this method by the audience receiver does not take effect). After receiving the application, the sending end automatically switches to the low-quality video stream mode. You can call this method either before or after joining a channel. If you call both setRemoteVideoStreamType and setRemoteDefaultVideoStreamType, the setting of setRemoteVideoStreamType takes effect.
|
|
2707
3016
|
*
|
|
2708
3017
|
* @param uid The user ID.
|
|
2709
3018
|
* @param streamType The video stream type: VideoStreamType.
|
|
2710
3019
|
*
|
|
2711
3020
|
* @returns
|
|
2712
|
-
* 0: Success.
|
|
3021
|
+
* 0: Success.
|
|
3022
|
+
* < 0: Failure.
|
|
2713
3023
|
*/
|
|
2714
3024
|
abstract setRemoteVideoStreamType(uid: number, streamType: VideoStreamType): number;
|
|
2715
3025
|
/**
|
|
2716
3026
|
* Options for subscribing to remote video streams.
|
|
2717
3027
|
*
|
|
2718
|
-
* 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.
|
|
3028
|
+
* 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.
|
|
3029
|
+
* 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).
|
|
3030
|
+
* 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).
|
|
3031
|
+
* 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).
|
|
3032
|
+
* 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:
|
|
3033
|
+
* Set autoSubscribeVideo to false when calling joinChannel to join a channel.
|
|
3034
|
+
* Call this method after receiving the onUserJoined callback to set the subscription options for the specified remote user's video stream.
|
|
3035
|
+
* 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.
|
|
2719
3036
|
*
|
|
2720
3037
|
* @param uid The user ID of the remote user.
|
|
2721
3038
|
* @param options The video subscription options. See VideoSubscriptionOptions.
|
|
2722
3039
|
*
|
|
2723
3040
|
* @returns
|
|
2724
|
-
* 0: Success.
|
|
3041
|
+
* 0: Success.
|
|
3042
|
+
* < 0: Failure.
|
|
2725
3043
|
*/
|
|
2726
3044
|
abstract setRemoteVideoSubscriptionOptions(uid: number, options: VideoSubscriptionOptions): number;
|
|
2727
3045
|
/**
|
|
2728
3046
|
* Sets the default stream type of subscrption for remote video streams.
|
|
2729
3047
|
*
|
|
2730
|
-
*
|
|
3048
|
+
* By default, the SDK enables the low-quality video stream auto mode on the sending end (it does not actively send the low-quality video stream). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling this method (the call to this method by the audience receiver does not take effect). After receiving the application, the sending end automatically switches to the low-quality video stream mode. Under limited network conditions, if the publisher has not disabled the dual-stream mode using enableDualStreamMode (false), the receiver can choose to receive either the high-quality video stream or the low-quality video stream. The high-quality video stream has a higher resolution and bitrate, and the low-quality video stream has a lower resolution and bitrate. By default, users receive the high-quality video stream. Call this method if you want to switch to the low-quality video stream. This method allows the app to adjust the corresponding video stream type based on the size of the video window to reduce the bandwidth and resources. The aspect ratio of the low-quality video stream is the same as the high-quality video stream. Once the resolution of the high-quality video stream is set, the system automatically sets the resolution, frame rate, and bitrate of the low-quality video stream.
|
|
3049
|
+
* Call this method before joining a channel. The SDK does not support changing the default subscribed video stream type after joining a channel.
|
|
3050
|
+
* If you call both this method and setRemoteVideoStreamType, the SDK applies the settings in the setRemoteVideoStreamType method.
|
|
2731
3051
|
*
|
|
2732
3052
|
* @param streamType The default video-stream type. See VideoStreamType.
|
|
2733
3053
|
*
|
|
2734
3054
|
* @returns
|
|
2735
|
-
* 0: Success.
|
|
3055
|
+
* 0: Success.
|
|
3056
|
+
* < 0: Failure.
|
|
2736
3057
|
*/
|
|
2737
3058
|
abstract setRemoteDefaultVideoStreamType(streamType: VideoStreamType): number;
|
|
2738
3059
|
/**
|
|
2739
3060
|
* Set the blocklist of subscriptions for audio streams.
|
|
2740
3061
|
*
|
|
2741
|
-
* You can call this method to specify the audio streams of a user that you do not want to subscribe to.
|
|
3062
|
+
* You can call this method to specify the audio streams of a user that you do not want to subscribe to.
|
|
3063
|
+
* You can call this method either before or after joining a channel.
|
|
3064
|
+
* The blocklist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams, and autoSubscribeAudio in ChannelMediaOptions.
|
|
3065
|
+
* Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3066
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
2742
3067
|
*
|
|
2743
|
-
* @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.
|
|
3068
|
+
* @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.
|
|
2744
3069
|
* @param uidNumber The number of users in the user ID list.
|
|
2745
3070
|
*
|
|
2746
3071
|
* @returns
|
|
2747
|
-
* 0: Success.
|
|
3072
|
+
* 0: Success.
|
|
3073
|
+
* < 0: Failure.
|
|
2748
3074
|
*/
|
|
2749
3075
|
abstract setSubscribeAudioBlocklist(uidList: number[], uidNumber: number): number;
|
|
2750
3076
|
/**
|
|
2751
3077
|
* Sets the allowlist of subscriptions for audio streams.
|
|
2752
3078
|
*
|
|
2753
|
-
* You can call this method to specify the audio streams of a user that you want to subscribe to.
|
|
3079
|
+
* You can call this method to specify the audio streams of a user that you want to subscribe to.
|
|
3080
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3081
|
+
* You can call this method either before or after joining a channel.
|
|
3082
|
+
* The allowlist is not affected by the setting in muteRemoteAudioStream, muteAllRemoteAudioStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
3083
|
+
* Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
2754
3084
|
*
|
|
2755
|
-
* @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.
|
|
3085
|
+
* @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.
|
|
2756
3086
|
* @param uidNumber The number of users in the user ID list.
|
|
2757
3087
|
*
|
|
2758
3088
|
* @returns
|
|
2759
|
-
* 0: Success.
|
|
3089
|
+
* 0: Success.
|
|
3090
|
+
* < 0: Failure.
|
|
2760
3091
|
*/
|
|
2761
3092
|
abstract setSubscribeAudioAllowlist(uidList: number[], uidNumber: number): number;
|
|
2762
3093
|
/**
|
|
2763
3094
|
* Set the blocklist of subscriptions for video streams.
|
|
2764
3095
|
*
|
|
2765
|
-
* You can call this method to specify the video streams of a user that you do not want to subscribe to.
|
|
3096
|
+
* You can call this method to specify the video streams of a user that you do not want to subscribe to.
|
|
3097
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3098
|
+
* Once the blocklist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3099
|
+
* You can call this method either before or after joining a channel.
|
|
3100
|
+
* The blocklist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
2766
3101
|
*
|
|
2767
|
-
* @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.
|
|
3102
|
+
* @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.
|
|
2768
3103
|
* @param uidNumber The number of users in the user ID list.
|
|
2769
3104
|
*
|
|
2770
3105
|
* @returns
|
|
2771
|
-
* 0: Success.
|
|
3106
|
+
* 0: Success.
|
|
3107
|
+
* < 0: Failure.
|
|
2772
3108
|
*/
|
|
2773
3109
|
abstract setSubscribeVideoBlocklist(uidList: number[], uidNumber: number): number;
|
|
2774
3110
|
/**
|
|
2775
3111
|
* Set the allowlist of subscriptions for video streams.
|
|
2776
3112
|
*
|
|
2777
|
-
* You can call this method to specify the video streams of a user that you want to subscribe to.
|
|
3113
|
+
* You can call this method to specify the video streams of a user that you want to subscribe to.
|
|
3114
|
+
* If a user is added in the allowlist and blocklist at the same time, only the blocklist takes effect.
|
|
3115
|
+
* Once the allowlist of subscriptions is set, it is effective even if you leave the current channel and rejoin the channel.
|
|
3116
|
+
* You can call this method either before or after joining a channel.
|
|
3117
|
+
* The allowlist is not affected by the setting in muteRemoteVideoStream, muteAllRemoteVideoStreams and autoSubscribeAudio in ChannelMediaOptions.
|
|
2778
3118
|
*
|
|
2779
|
-
* @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.
|
|
3119
|
+
* @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.
|
|
2780
3120
|
* @param uidNumber The number of users in the user ID list.
|
|
2781
3121
|
*
|
|
2782
3122
|
* @returns
|
|
2783
|
-
* 0: Success.
|
|
3123
|
+
* 0: Success.
|
|
3124
|
+
* < 0: Failure.
|
|
2784
3125
|
*/
|
|
2785
3126
|
abstract setSubscribeVideoAllowlist(uidList: number[], uidNumber: number): number;
|
|
2786
3127
|
/**
|
|
@@ -2788,29 +3129,36 @@ export declare abstract class IRtcEngine {
|
|
|
2788
3129
|
*
|
|
2789
3130
|
* 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.
|
|
2790
3131
|
*
|
|
2791
|
-
* @param interval Sets the time interval between two consecutive volume indications
|
|
3132
|
+
* @param interval Sets the time interval between two consecutive volume indications:
|
|
3133
|
+
* ≤ 0: Disables the volume indication.
|
|
3134
|
+
* > 0: Time interval (ms) between two consecutive volume indications. The lowest value is 50.
|
|
2792
3135
|
* @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.
|
|
2793
|
-
* @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.
|
|
3136
|
+
* @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.
|
|
2794
3137
|
*
|
|
2795
3138
|
* @returns
|
|
2796
|
-
* 0: Success.
|
|
3139
|
+
* 0: Success.
|
|
3140
|
+
* < 0: Failure.
|
|
2797
3141
|
*/
|
|
2798
3142
|
abstract enableAudioVolumeIndication(interval: number, smooth: number, reportVad: boolean): number;
|
|
2799
3143
|
/**
|
|
2800
3144
|
* Starts audio recording on the client and sets recording configurations.
|
|
2801
3145
|
*
|
|
2802
|
-
* 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:
|
|
3146
|
+
* 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:
|
|
3147
|
+
* 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.
|
|
3148
|
+
* 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.
|
|
2803
3149
|
*
|
|
2804
3150
|
* @param config Recording configurations. See AudioRecordingConfiguration.
|
|
2805
3151
|
*
|
|
2806
3152
|
* @returns
|
|
2807
|
-
* 0: Success.
|
|
3153
|
+
* 0: Success.
|
|
3154
|
+
* < 0: Failure.
|
|
2808
3155
|
*/
|
|
2809
3156
|
abstract startAudioRecording(config: AudioRecordingConfiguration): number;
|
|
2810
3157
|
/**
|
|
2811
3158
|
* Registers an encoded audio observer.
|
|
2812
3159
|
*
|
|
2813
|
-
* Call this method after joining a channel.
|
|
3160
|
+
* Call this method after joining a channel.
|
|
3161
|
+
* 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.
|
|
2814
3162
|
*
|
|
2815
3163
|
* @returns
|
|
2816
3164
|
* One IAudioEncodedFrameObserver object.
|
|
@@ -2820,14 +3168,16 @@ export declare abstract class IRtcEngine {
|
|
|
2820
3168
|
* Stops the audio recording on the client.
|
|
2821
3169
|
*
|
|
2822
3170
|
* @returns
|
|
2823
|
-
* 0: Success.
|
|
3171
|
+
* 0: Success.
|
|
3172
|
+
* < 0: Failure.
|
|
2824
3173
|
*/
|
|
2825
3174
|
abstract stopAudioRecording(): number;
|
|
2826
3175
|
/**
|
|
2827
3176
|
* Creates a media player instance.
|
|
2828
3177
|
*
|
|
2829
3178
|
* @returns
|
|
2830
|
-
* The IMediaPlayer instance, if the method call succeeds.
|
|
3179
|
+
* The IMediaPlayer instance, if the method call succeeds.
|
|
3180
|
+
* An empty pointer, if the method call fails.
|
|
2831
3181
|
*/
|
|
2832
3182
|
abstract createMediaPlayer(): IMediaPlayer;
|
|
2833
3183
|
/**
|
|
@@ -2836,7 +3186,8 @@ export declare abstract class IRtcEngine {
|
|
|
2836
3186
|
* @param mediaPlayer One IMediaPlayer object.
|
|
2837
3187
|
*
|
|
2838
3188
|
* @returns
|
|
2839
|
-
* ≥ 0: Success. Returns the ID of media player instance.
|
|
3189
|
+
* ≥ 0: Success. Returns the ID of media player instance.
|
|
3190
|
+
* < 0: Failure.
|
|
2840
3191
|
*/
|
|
2841
3192
|
abstract destroyMediaPlayer(mediaPlayer: IMediaPlayer): number;
|
|
2842
3193
|
/**
|
|
@@ -2850,17 +3201,29 @@ export declare abstract class IRtcEngine {
|
|
|
2850
3201
|
/**
|
|
2851
3202
|
* Starts playing the music file.
|
|
2852
3203
|
*
|
|
2853
|
-
* 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 (
|
|
3204
|
+
* 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.
|
|
3205
|
+
* For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
|
|
3206
|
+
* 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.
|
|
3207
|
+
* 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.
|
|
2854
3208
|
*
|
|
2855
3209
|
* @param filePath File path:
|
|
2856
|
-
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: C:\music\audio.mp4.
|
|
3210
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
2857
3211
|
* 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.
|
|
2858
|
-
* @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.
|
|
2859
|
-
* @param cycle The number of times the music file plays
|
|
3212
|
+
* @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.
|
|
3213
|
+
* @param cycle The number of times the music file plays.
|
|
3214
|
+
* ≥ 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.
|
|
3215
|
+
* -1: Play the audio file in an infinite loop.
|
|
2860
3216
|
* @param startPos The playback position (ms) of the music file.
|
|
2861
3217
|
*
|
|
2862
3218
|
* @returns
|
|
2863
|
-
* 0: Success.
|
|
3219
|
+
* 0: Success.
|
|
3220
|
+
* < 0: Failure.
|
|
3221
|
+
* -1: A general error occurs (no specified reason).
|
|
3222
|
+
* -2: The parameter is invalid.
|
|
3223
|
+
* -3: The SDK is not ready.
|
|
3224
|
+
* The audio module is disabled.
|
|
3225
|
+
* The program is not complete.
|
|
3226
|
+
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
|
|
2864
3227
|
*/
|
|
2865
3228
|
abstract startAudioMixing(filePath: string, loopback: boolean, cycle: number, startPos?: number): number;
|
|
2866
3229
|
/**
|
|
@@ -2869,7 +3232,8 @@ export declare abstract class IRtcEngine {
|
|
|
2869
3232
|
* This method stops the audio mixing. Call this method when you are in a channel.
|
|
2870
3233
|
*
|
|
2871
3234
|
* @returns
|
|
2872
|
-
* 0: Success.
|
|
3235
|
+
* 0: Success.
|
|
3236
|
+
* < 0: Failure.
|
|
2873
3237
|
*/
|
|
2874
3238
|
abstract stopAudioMixing(): number;
|
|
2875
3239
|
/**
|
|
@@ -2878,7 +3242,8 @@ export declare abstract class IRtcEngine {
|
|
|
2878
3242
|
* Call this method after joining a channel.
|
|
2879
3243
|
*
|
|
2880
3244
|
* @returns
|
|
2881
|
-
* 0: Success.
|
|
3245
|
+
* 0: Success.
|
|
3246
|
+
* < 0: Failure.
|
|
2882
3247
|
*/
|
|
2883
3248
|
abstract pauseAudioMixing(): number;
|
|
2884
3249
|
/**
|
|
@@ -2887,180 +3252,212 @@ export declare abstract class IRtcEngine {
|
|
|
2887
3252
|
* This method resumes playing and mixing the music file. Call this method when you are in a channel.
|
|
2888
3253
|
*
|
|
2889
3254
|
* @returns
|
|
2890
|
-
* 0: Success.
|
|
3255
|
+
* 0: Success.
|
|
3256
|
+
* < 0: Failure.
|
|
2891
3257
|
*/
|
|
2892
3258
|
abstract resumeAudioMixing(): number;
|
|
2893
3259
|
/**
|
|
2894
3260
|
* Selects the audio track used during playback.
|
|
2895
3261
|
*
|
|
2896
|
-
* 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.
|
|
3262
|
+
* 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.
|
|
3263
|
+
* For the supported formats of audio files, see.
|
|
3264
|
+
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
2897
3265
|
*
|
|
2898
|
-
* @param index The audio track you want to specify. The value range is [0, getAudioTrackCount()].
|
|
3266
|
+
* @param index The audio track you want to specify. The value range is [0, getAudioTrackCount ()].
|
|
2899
3267
|
*
|
|
2900
3268
|
* @returns
|
|
2901
|
-
* 0: Success.
|
|
3269
|
+
* 0: Success.
|
|
3270
|
+
* < 0: Failure.
|
|
2902
3271
|
*/
|
|
2903
3272
|
abstract selectAudioTrack(index: number): number;
|
|
2904
3273
|
/**
|
|
2905
3274
|
* Gets the index of audio tracks of the current music file.
|
|
2906
3275
|
*
|
|
2907
|
-
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3276
|
+
* You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
2908
3277
|
*
|
|
2909
3278
|
* @returns
|
|
2910
|
-
* The SDK returns the index of the audio tracks if the method call succeeds.
|
|
3279
|
+
* The SDK returns the index of the audio tracks if the method call succeeds.
|
|
3280
|
+
* < 0: Failure.
|
|
2911
3281
|
*/
|
|
2912
3282
|
abstract getAudioTrackCount(): number;
|
|
2913
3283
|
/**
|
|
2914
3284
|
* Adjusts the volume during audio mixing.
|
|
2915
3285
|
*
|
|
2916
|
-
* This method adjusts the audio mixing volume on both the local client and remote clients.
|
|
3286
|
+
* This method adjusts the audio mixing volume on both the local client and remote clients.
|
|
3287
|
+
* Call this method after startAudioMixing.
|
|
2917
3288
|
*
|
|
2918
3289
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
2919
3290
|
*
|
|
2920
3291
|
* @returns
|
|
2921
|
-
* 0: Success.
|
|
3292
|
+
* 0: Success.
|
|
3293
|
+
* < 0: Failure.
|
|
2922
3294
|
*/
|
|
2923
3295
|
abstract adjustAudioMixingVolume(volume: number): number;
|
|
2924
3296
|
/**
|
|
2925
3297
|
* Adjusts the volume of audio mixing for publishing.
|
|
2926
3298
|
*
|
|
2927
|
-
* This method adjusts the volume of audio mixing for publishing (sending to other users). Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3299
|
+
* 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.
|
|
2928
3300
|
*
|
|
2929
3301
|
* @param volume The volume of audio mixing for local playback. The value ranges between 0 and 100 (default). 100 represents the original volume.
|
|
2930
3302
|
*
|
|
2931
3303
|
* @returns
|
|
2932
|
-
* 0: Success.
|
|
3304
|
+
* 0: Success.
|
|
3305
|
+
* < 0: Failure.
|
|
2933
3306
|
*/
|
|
2934
3307
|
abstract adjustAudioMixingPublishVolume(volume: number): number;
|
|
2935
3308
|
/**
|
|
2936
3309
|
* Retrieves the audio mixing volume for publishing.
|
|
2937
3310
|
*
|
|
2938
|
-
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3311
|
+
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
2939
3312
|
*
|
|
2940
3313
|
* @returns
|
|
2941
|
-
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3314
|
+
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3315
|
+
* < 0: Failure.
|
|
2942
3316
|
*/
|
|
2943
3317
|
abstract getAudioMixingPublishVolume(): number;
|
|
2944
3318
|
/**
|
|
2945
3319
|
* Adjusts the volume of audio mixing for local playback.
|
|
2946
3320
|
*
|
|
2947
|
-
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3321
|
+
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
2948
3322
|
*
|
|
2949
3323
|
* @param volume The volume of audio mixing for local playback. The value ranges between 0 and 100 (default). 100 represents the original volume.
|
|
2950
3324
|
*
|
|
2951
3325
|
* @returns
|
|
2952
|
-
* 0: Success.
|
|
3326
|
+
* 0: Success.
|
|
3327
|
+
* < 0: Failure.
|
|
2953
3328
|
*/
|
|
2954
3329
|
abstract adjustAudioMixingPlayoutVolume(volume: number): number;
|
|
2955
3330
|
/**
|
|
2956
3331
|
* Retrieves the audio mixing volume for local playback.
|
|
2957
3332
|
*
|
|
2958
|
-
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3333
|
+
* This method helps troubleshoot audio volume‑related issues. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
2959
3334
|
*
|
|
2960
3335
|
* @returns
|
|
2961
|
-
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3336
|
+
* ≥ 0: The audio mixing volume, if this method call succeeds. The value range is [0,100].
|
|
3337
|
+
* < 0: Failure.
|
|
2962
3338
|
*/
|
|
2963
3339
|
abstract getAudioMixingPlayoutVolume(): number;
|
|
2964
3340
|
/**
|
|
2965
3341
|
* Retrieves the duration (ms) of the music file.
|
|
2966
3342
|
*
|
|
2967
|
-
* Retrieves the total duration (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3343
|
+
* Retrieves the total duration (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
2968
3344
|
*
|
|
2969
3345
|
* @returns
|
|
2970
|
-
* ≥ 0: The audio mixing duration, if this method call succeeds.
|
|
3346
|
+
* ≥ 0: The audio mixing duration, if this method call succeeds.
|
|
3347
|
+
* < 0: Failure.
|
|
2971
3348
|
*/
|
|
2972
3349
|
abstract getAudioMixingDuration(): number;
|
|
2973
3350
|
/**
|
|
2974
3351
|
* Retrieves the playback position (ms) of the music file.
|
|
2975
3352
|
*
|
|
2976
|
-
* Retrieves the playback position (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (
|
|
3353
|
+
* Retrieves the playback position (ms) of the audio. You need to call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3354
|
+
* If you need to call getAudioMixingCurrentPosition multiple times, ensure that the time interval between calling this method is more than 500 ms.
|
|
2977
3355
|
*
|
|
2978
3356
|
* @returns
|
|
2979
|
-
* ≥ 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.
|
|
3357
|
+
* ≥ 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.
|
|
3358
|
+
* < 0: Failure.
|
|
2980
3359
|
*/
|
|
2981
3360
|
abstract getAudioMixingCurrentPosition(): number;
|
|
2982
3361
|
/**
|
|
2983
3362
|
* Sets the audio mixing position.
|
|
2984
3363
|
*
|
|
2985
|
-
* 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 (
|
|
3364
|
+
* 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.
|
|
2986
3365
|
*
|
|
2987
3366
|
* @param pos Integer. The playback position (ms).
|
|
2988
3367
|
*
|
|
2989
3368
|
* @returns
|
|
2990
|
-
* 0: Success.
|
|
3369
|
+
* 0: Success.
|
|
3370
|
+
* < 0: Failure.
|
|
2991
3371
|
*/
|
|
2992
3372
|
abstract setAudioMixingPosition(pos: number): number;
|
|
2993
3373
|
/**
|
|
2994
3374
|
* Sets the channel mode of the current audio file.
|
|
2995
3375
|
*
|
|
2996
|
-
* 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.
|
|
3376
|
+
* 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.
|
|
3377
|
+
* Call this method after calling startAudioMixing and receiving the onAudioMixingStateChanged (AudioMixingStatePlaying) callback.
|
|
3378
|
+
* This method only applies to stereo audio files.
|
|
2997
3379
|
*
|
|
2998
3380
|
* @param mode The channel mode. See AudioMixingDualMonoMode.
|
|
2999
3381
|
*
|
|
3000
3382
|
* @returns
|
|
3001
|
-
* 0: Success.
|
|
3383
|
+
* 0: Success.
|
|
3384
|
+
* < 0: Failure.
|
|
3002
3385
|
*/
|
|
3003
3386
|
abstract setAudioMixingDualMonoMode(mode: AudioMixingDualMonoMode): number;
|
|
3004
3387
|
/**
|
|
3005
3388
|
* Sets the pitch of the local music file.
|
|
3006
3389
|
*
|
|
3007
|
-
* 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 (
|
|
3390
|
+
* 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.
|
|
3008
3391
|
*
|
|
3009
3392
|
* @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.
|
|
3010
3393
|
*
|
|
3011
3394
|
* @returns
|
|
3012
|
-
* 0: Success.
|
|
3395
|
+
* 0: Success.
|
|
3396
|
+
* < 0: Failure.
|
|
3013
3397
|
*/
|
|
3014
3398
|
abstract setAudioMixingPitch(pitch: number): number;
|
|
3015
3399
|
/**
|
|
3016
3400
|
* Retrieves the volume of the audio effects.
|
|
3017
3401
|
*
|
|
3018
|
-
* 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
|
|
3402
|
+
* 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.
|
|
3019
3403
|
*
|
|
3020
3404
|
* @returns
|
|
3021
|
-
* Volume of the audio effects, if this method call succeeds.
|
|
3405
|
+
* Volume of the audio effects, if this method call succeeds.
|
|
3406
|
+
* < 0: Failure.
|
|
3022
3407
|
*/
|
|
3023
3408
|
abstract getEffectsVolume(): number;
|
|
3024
3409
|
/**
|
|
3025
3410
|
* Sets the volume of the audio effects.
|
|
3026
3411
|
*
|
|
3027
|
-
* Call this method after playEffect
|
|
3412
|
+
* Call this method after playEffect.
|
|
3028
3413
|
*
|
|
3029
3414
|
* @param volume The playback volume. The value range is [0, 100]. The default value is 100, which represents the original volume.
|
|
3030
3415
|
*
|
|
3031
3416
|
* @returns
|
|
3032
|
-
* 0: Success.
|
|
3417
|
+
* 0: Success.
|
|
3418
|
+
* < 0: Failure.
|
|
3033
3419
|
*/
|
|
3034
3420
|
abstract setEffectsVolume(volume: number): number;
|
|
3035
3421
|
/**
|
|
3036
3422
|
* Preloads a specified audio effect file into the memory.
|
|
3037
3423
|
*
|
|
3038
|
-
* 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
|
|
3424
|
+
* 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.
|
|
3425
|
+
* This method does not support online audio effect files.
|
|
3426
|
+
* For the audio file formats supported by this method, see What formats of audio files does the Agora RTC SDK support.
|
|
3039
3427
|
*
|
|
3040
3428
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3041
|
-
* @param filePath File path:
|
|
3429
|
+
* @param filePath File path:
|
|
3430
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
3431
|
+
* 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.
|
|
3042
3432
|
* @param startPos The playback position (ms) of the audio effect file.
|
|
3043
3433
|
*
|
|
3044
3434
|
* @returns
|
|
3045
|
-
* 0: Success.
|
|
3435
|
+
* 0: Success.
|
|
3436
|
+
* < 0: Failure.
|
|
3046
3437
|
*/
|
|
3047
3438
|
abstract preloadEffect(soundId: number, filePath: string, startPos?: number): number;
|
|
3048
3439
|
/**
|
|
3049
3440
|
* Plays the specified local or online audio effect file.
|
|
3050
3441
|
*
|
|
3051
|
-
* 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
|
|
3442
|
+
* 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.
|
|
3052
3443
|
*
|
|
3053
|
-
* @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.
|
|
3054
|
-
* @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.
|
|
3055
|
-
* @param loopCount The number of times the audio effect loops
|
|
3444
|
+
* @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.
|
|
3445
|
+
* @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.
|
|
3446
|
+
* @param loopCount The number of times the audio effect loops.
|
|
3447
|
+
* ≥ 0: The number of playback times. For example, 1 means looping one time, which means playing the audio effect two times in total.
|
|
3448
|
+
* -1: Play the audio file in an infinite loop.
|
|
3056
3449
|
* @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.
|
|
3057
|
-
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0
|
|
3450
|
+
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
|
3451
|
+
* -1.0: The audio effect is heard on the left of the user.
|
|
3452
|
+
* 0.0: The audio effect is heard in front of the user.
|
|
3453
|
+
* 1.0: The audio effect is heard on the right of the user.
|
|
3058
3454
|
* @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.
|
|
3059
|
-
* @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.
|
|
3455
|
+
* @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.
|
|
3060
3456
|
* @param startPos The playback position (ms) of the audio effect file.
|
|
3061
3457
|
*
|
|
3062
3458
|
* @returns
|
|
3063
|
-
* 0: Success.
|
|
3459
|
+
* 0: Success.
|
|
3460
|
+
* < 0: Failure.
|
|
3064
3461
|
*/
|
|
3065
3462
|
abstract playEffect(soundId: number, filePath: string, loopCount: number, pitch: number, pan: number, gain: number, publish?: boolean, startPos?: number): number;
|
|
3066
3463
|
/**
|
|
@@ -3068,14 +3465,21 @@ export declare abstract class IRtcEngine {
|
|
|
3068
3465
|
*
|
|
3069
3466
|
* 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.
|
|
3070
3467
|
*
|
|
3071
|
-
* @param loopCount The number of times the audio effect loops
|
|
3468
|
+
* @param loopCount The number of times the audio effect loops:
|
|
3469
|
+
* -1: Play the audio effect files in an indefinite loop until you call stopEffect or stopAllEffects.
|
|
3470
|
+
* 0: Play the audio effect once.
|
|
3471
|
+
* 1: Play the audio effect twice.
|
|
3072
3472
|
* @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.
|
|
3073
|
-
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0
|
|
3473
|
+
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
|
|
3474
|
+
* -1.0: The audio effect shows on the left.
|
|
3475
|
+
* 0: The audio effect shows ahead.
|
|
3476
|
+
* 1.0: The audio effect shows on the right.
|
|
3074
3477
|
* @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.
|
|
3075
|
-
* @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.
|
|
3478
|
+
* @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.
|
|
3076
3479
|
*
|
|
3077
3480
|
* @returns
|
|
3078
|
-
* 0: Success.
|
|
3481
|
+
* 0: Success.
|
|
3482
|
+
* < 0: Failure.
|
|
3079
3483
|
*/
|
|
3080
3484
|
abstract playAllEffects(loopCount: number, pitch: number, pan: number, gain: number, publish?: boolean): number;
|
|
3081
3485
|
/**
|
|
@@ -3084,7 +3488,8 @@ export declare abstract class IRtcEngine {
|
|
|
3084
3488
|
* @param soundId The ID of the audio effect file.
|
|
3085
3489
|
*
|
|
3086
3490
|
* @returns
|
|
3087
|
-
* ≥ 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.
|
|
3491
|
+
* ≥ 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.
|
|
3492
|
+
* < 0: Failure.
|
|
3088
3493
|
*/
|
|
3089
3494
|
abstract getVolumeOfEffect(soundId: number): number;
|
|
3090
3495
|
/**
|
|
@@ -3094,7 +3499,8 @@ export declare abstract class IRtcEngine {
|
|
|
3094
3499
|
* @param volume The playback volume. The value range is [0, 100]. The default value is 100, which represents the original volume.
|
|
3095
3500
|
*
|
|
3096
3501
|
* @returns
|
|
3097
|
-
* 0: Success.
|
|
3502
|
+
* 0: Success.
|
|
3503
|
+
* < 0: Failure.
|
|
3098
3504
|
*/
|
|
3099
3505
|
abstract setVolumeOfEffect(soundId: number, volume: number): number;
|
|
3100
3506
|
/**
|
|
@@ -3103,14 +3509,16 @@ export declare abstract class IRtcEngine {
|
|
|
3103
3509
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3104
3510
|
*
|
|
3105
3511
|
* @returns
|
|
3106
|
-
* 0: Success.
|
|
3512
|
+
* 0: Success.
|
|
3513
|
+
* < 0: Failure.
|
|
3107
3514
|
*/
|
|
3108
3515
|
abstract pauseEffect(soundId: number): number;
|
|
3109
3516
|
/**
|
|
3110
3517
|
* Pauses all audio effects.
|
|
3111
3518
|
*
|
|
3112
3519
|
* @returns
|
|
3113
|
-
* 0: Success.
|
|
3520
|
+
* 0: Success.
|
|
3521
|
+
* < 0: Failure.
|
|
3114
3522
|
*/
|
|
3115
3523
|
abstract pauseAllEffects(): number;
|
|
3116
3524
|
/**
|
|
@@ -3119,14 +3527,16 @@ export declare abstract class IRtcEngine {
|
|
|
3119
3527
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3120
3528
|
*
|
|
3121
3529
|
* @returns
|
|
3122
|
-
* 0: Success.
|
|
3530
|
+
* 0: Success.
|
|
3531
|
+
* < 0: Failure.
|
|
3123
3532
|
*/
|
|
3124
3533
|
abstract resumeEffect(soundId: number): number;
|
|
3125
3534
|
/**
|
|
3126
3535
|
* Resumes playing all audio effect files.
|
|
3127
3536
|
*
|
|
3128
3537
|
* @returns
|
|
3129
|
-
* 0: Success.
|
|
3538
|
+
* 0: Success.
|
|
3539
|
+
* < 0: Failure.
|
|
3130
3540
|
*/
|
|
3131
3541
|
abstract resumeAllEffects(): number;
|
|
3132
3542
|
/**
|
|
@@ -3135,14 +3545,16 @@ export declare abstract class IRtcEngine {
|
|
|
3135
3545
|
* @param soundId The ID of the audio effect. Each audio effect has a unique ID.
|
|
3136
3546
|
*
|
|
3137
3547
|
* @returns
|
|
3138
|
-
* 0: Success.
|
|
3548
|
+
* 0: Success.
|
|
3549
|
+
* < 0: Failure.
|
|
3139
3550
|
*/
|
|
3140
3551
|
abstract stopEffect(soundId: number): number;
|
|
3141
3552
|
/**
|
|
3142
3553
|
* Stops playing all audio effects.
|
|
3143
3554
|
*
|
|
3144
3555
|
* @returns
|
|
3145
|
-
* 0: Success.
|
|
3556
|
+
* 0: Success.
|
|
3557
|
+
* < 0: Failure.
|
|
3146
3558
|
*/
|
|
3147
3559
|
abstract stopAllEffects(): number;
|
|
3148
3560
|
/**
|
|
@@ -3151,14 +3563,16 @@ export declare abstract class IRtcEngine {
|
|
|
3151
3563
|
* @param soundId The ID of the audio effect. Each audio effect has a unique ID.
|
|
3152
3564
|
*
|
|
3153
3565
|
* @returns
|
|
3154
|
-
* 0: Success.
|
|
3566
|
+
* 0: Success.
|
|
3567
|
+
* < 0: Failure.
|
|
3155
3568
|
*/
|
|
3156
3569
|
abstract unloadEffect(soundId: number): number;
|
|
3157
3570
|
/**
|
|
3158
3571
|
* Releases a specified preloaded audio effect from the memory.
|
|
3159
3572
|
*
|
|
3160
3573
|
* @returns
|
|
3161
|
-
* 0: Success.
|
|
3574
|
+
* 0: Success.
|
|
3575
|
+
* < 0: Failure.
|
|
3162
3576
|
*/
|
|
3163
3577
|
abstract unloadAllEffects(): number;
|
|
3164
3578
|
/**
|
|
@@ -3167,23 +3581,25 @@ export declare abstract class IRtcEngine {
|
|
|
3167
3581
|
* Call this method after joining a channel.
|
|
3168
3582
|
*
|
|
3169
3583
|
* @param filePath File path:
|
|
3170
|
-
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example: C:\music\audio.mp4.
|
|
3584
|
+
* Windows: The absolute path or URL address (including the suffixes of the filename) of the audio effect file. For example : C:\music\audio.mp4.
|
|
3171
3585
|
* 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.
|
|
3172
3586
|
*
|
|
3173
3587
|
* @returns
|
|
3174
|
-
* The total duration (ms) of the specified audio effect file, if the method call succeeds.
|
|
3588
|
+
* The total duration (ms) of the specified audio effect file, if the method call succeeds.
|
|
3589
|
+
* < 0: Failure.
|
|
3175
3590
|
*/
|
|
3176
3591
|
abstract getEffectDuration(filePath: string): number;
|
|
3177
3592
|
/**
|
|
3178
3593
|
* Sets the playback position of an audio effect file.
|
|
3179
3594
|
*
|
|
3180
|
-
* After a successful setting, the local audio effect file starts playing at the specified position. Call this method after playEffect
|
|
3595
|
+
* After a successful setting, the local audio effect file starts playing at the specified position. Call this method after playEffect.
|
|
3181
3596
|
*
|
|
3182
3597
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3183
3598
|
* @param pos The playback position (ms) of the audio effect file.
|
|
3184
3599
|
*
|
|
3185
3600
|
* @returns
|
|
3186
|
-
* 0: Success.
|
|
3601
|
+
* 0: Success.
|
|
3602
|
+
* < 0: Failure.
|
|
3187
3603
|
*/
|
|
3188
3604
|
abstract setEffectPosition(soundId: number, pos: number): number;
|
|
3189
3605
|
/**
|
|
@@ -3194,112 +3610,159 @@ export declare abstract class IRtcEngine {
|
|
|
3194
3610
|
* @param soundId The audio effect ID. The ID of each audio effect file is unique.
|
|
3195
3611
|
*
|
|
3196
3612
|
* @returns
|
|
3197
|
-
* The playback position (ms) of the specified audio effect file, if the method call succeeds.
|
|
3613
|
+
* The playback position (ms) of the specified audio effect file, if the method call succeeds.
|
|
3614
|
+
* < 0: Failure.
|
|
3198
3615
|
*/
|
|
3199
3616
|
abstract getEffectCurrentPosition(soundId: number): number;
|
|
3200
3617
|
/**
|
|
3201
3618
|
* Enables or disables stereo panning for remote users.
|
|
3202
3619
|
*
|
|
3203
|
-
* 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
|
|
3620
|
+
* 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.
|
|
3204
3621
|
*
|
|
3205
|
-
* @param enabled Whether to enable stereo panning for remote users:true: Enable stereo panning.false: Disable stereo panning.
|
|
3622
|
+
* @param enabled Whether to enable stereo panning for remote users: true : Enable stereo panning. false : Disable stereo panning.
|
|
3206
3623
|
*
|
|
3207
3624
|
* @returns
|
|
3208
|
-
* 0: Success.
|
|
3625
|
+
* 0: Success.
|
|
3626
|
+
* < 0: Failure.
|
|
3209
3627
|
*/
|
|
3210
3628
|
abstract enableSoundPositionIndication(enabled: boolean): number;
|
|
3211
3629
|
/**
|
|
3212
3630
|
* Sets the 2D position (the position on the horizontal plane) of the remote user's voice.
|
|
3213
3631
|
*
|
|
3214
|
-
* 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.
|
|
3632
|
+
* 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.
|
|
3633
|
+
* For this method to work, enable stereo panning for remote users by calling the enableSoundPositionIndication method before joining a channel.
|
|
3634
|
+
* For the best voice positioning, Agora recommends using a wired headset.
|
|
3635
|
+
* Call this method after joining a channel.
|
|
3215
3636
|
*
|
|
3216
3637
|
* @param uid The user ID of the remote user.
|
|
3217
|
-
* @param pan The voice position of the remote user. The value ranges from -1.0 to 1.0:
|
|
3638
|
+
* @param pan The voice position of the remote user. The value ranges from -1.0 to 1.0:
|
|
3639
|
+
* 0.0: (Default) The remote voice comes from the front.
|
|
3640
|
+
* -1.0: The remote voice comes from the left.
|
|
3641
|
+
* 1.0: The remote voice comes from the right.
|
|
3218
3642
|
* @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.
|
|
3219
3643
|
*
|
|
3220
3644
|
* @returns
|
|
3221
|
-
* 0: Success.
|
|
3645
|
+
* 0: Success.
|
|
3646
|
+
* < 0: Failure.
|
|
3222
3647
|
*/
|
|
3223
3648
|
abstract setRemoteVoicePosition(uid: number, pan: number, gain: number): number;
|
|
3224
3649
|
/**
|
|
3225
3650
|
* Enables or disables the spatial audio effect.
|
|
3226
3651
|
*
|
|
3227
|
-
* After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
|
|
3652
|
+
* After enabling the spatial audio effect, you can call setRemoteUserSpatialAudioParams to set the spatial audio effect parameters of the remote user.
|
|
3653
|
+
* You can call this method either before or after joining a channel.
|
|
3654
|
+
* 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.
|
|
3228
3655
|
*
|
|
3229
|
-
* @param enabled Whether to enable the spatial audio effect:true: Enable the spatial audio effect.false: Disable the spatial audio effect.
|
|
3656
|
+
* @param enabled Whether to enable the spatial audio effect: true : Enable the spatial audio effect. false : Disable the spatial audio effect.
|
|
3230
3657
|
*
|
|
3231
3658
|
* @returns
|
|
3232
|
-
* 0: Success.
|
|
3659
|
+
* 0: Success.
|
|
3660
|
+
* < 0: Failure.
|
|
3233
3661
|
*/
|
|
3234
3662
|
abstract enableSpatialAudio(enabled: boolean): number;
|
|
3235
3663
|
/**
|
|
3236
3664
|
* Sets the spatial audio effect parameters of the remote user.
|
|
3237
3665
|
*
|
|
3238
|
-
* Call this method after enableSpatialAudio
|
|
3239
|
-
*
|
|
3240
|
-
* @param uid The user ID.
|
|
3666
|
+
* 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.
|
|
3241
3667
|
*
|
|
3242
3668
|
* @returns
|
|
3243
|
-
* 0: Success.
|
|
3669
|
+
* 0: Success.
|
|
3670
|
+
* < 0: Failure.
|
|
3244
3671
|
*/
|
|
3245
3672
|
abstract setRemoteUserSpatialAudioParams(uid: number, params: SpatialAudioParams): number;
|
|
3246
3673
|
/**
|
|
3247
3674
|
* Sets a preset voice beautifier effect.
|
|
3248
3675
|
*
|
|
3249
|
-
* 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.
|
|
3676
|
+
* 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.
|
|
3677
|
+
* You can call this method either before or after joining a channel.
|
|
3678
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
3679
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
3680
|
+
* 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
|
|
3681
|
+
* 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.
|
|
3250
3682
|
*
|
|
3251
3683
|
* @param preset The preset voice beautifier effect options: VoiceBeautifierPreset.
|
|
3252
3684
|
*
|
|
3253
3685
|
* @returns
|
|
3254
|
-
* 0: Success.
|
|
3686
|
+
* 0: Success.
|
|
3687
|
+
* < 0: Failure.
|
|
3255
3688
|
*/
|
|
3256
3689
|
abstract setVoiceBeautifierPreset(preset: VoiceBeautifierPreset): number;
|
|
3257
3690
|
/**
|
|
3258
3691
|
* Sets an SDK preset audio effect.
|
|
3259
3692
|
*
|
|
3260
|
-
* 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.
|
|
3693
|
+
* 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.
|
|
3694
|
+
* You can call this method either before or after joining a channel.
|
|
3695
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect.
|
|
3696
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
3697
|
+
* If you call setAudioEffectPreset and set enumerators except for RoomAcoustics3dVoice or PitchCorrection, do not call setAudioEffectParameters; otherwise, setAudioEffectPreset is overridden.
|
|
3698
|
+
* 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
|
|
3699
|
+
* 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.
|
|
3261
3700
|
*
|
|
3262
3701
|
* @param preset The options for SDK preset audio effects. See AudioEffectPreset.
|
|
3263
3702
|
*
|
|
3264
3703
|
* @returns
|
|
3265
|
-
* 0: Success.
|
|
3704
|
+
* 0: Success.
|
|
3705
|
+
* < 0: Failure.
|
|
3266
3706
|
*/
|
|
3267
3707
|
abstract setAudioEffectPreset(preset: AudioEffectPreset): number;
|
|
3268
3708
|
/**
|
|
3269
3709
|
* Sets a preset voice beautifier effect.
|
|
3270
3710
|
*
|
|
3271
|
-
* 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.
|
|
3711
|
+
* 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.
|
|
3712
|
+
* You can call this method either before or after joining a channel.
|
|
3713
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
3714
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
3715
|
+
* 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
|
|
3716
|
+
* 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.
|
|
3272
3717
|
*
|
|
3273
3718
|
* @param preset The options for the preset voice beautifier effects: VoiceConversionPreset.
|
|
3274
3719
|
*
|
|
3275
3720
|
* @returns
|
|
3276
|
-
* 0: Success.
|
|
3721
|
+
* 0: Success.
|
|
3722
|
+
* < 0: Failure.
|
|
3277
3723
|
*/
|
|
3278
3724
|
abstract setVoiceConversionPreset(preset: VoiceConversionPreset): number;
|
|
3279
3725
|
/**
|
|
3280
3726
|
* Sets parameters for SDK preset audio effects.
|
|
3281
3727
|
*
|
|
3282
|
-
* Call this method to set the following parameters for the local user who sends an audio stream:
|
|
3728
|
+
* Call this method to set the following parameters for the local user who sends an audio stream:
|
|
3729
|
+
* 3D voice effect: Sets the cycle period of the 3D voice effect.
|
|
3730
|
+
* 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.
|
|
3731
|
+
* You can call this method either before or after joining a channel.
|
|
3732
|
+
* To get better audio effect quality, Agora recommends setting the scenario parameter of setAudioProfile as AudioScenarioGameStreaming (3) before calling this method.
|
|
3733
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect.
|
|
3734
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
3735
|
+
* 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
|
|
3283
3736
|
*
|
|
3284
|
-
* @param preset The options for SDK preset audio effects:RoomAcoustics3dVoice, 3D voice effect:
|
|
3285
|
-
*
|
|
3286
|
-
*
|
|
3737
|
+
* @param preset The options for SDK preset audio effects: RoomAcoustics3dVoice, 3D voice effect:
|
|
3738
|
+
* 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.
|
|
3739
|
+
* 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.
|
|
3740
|
+
* @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.
|
|
3741
|
+
* 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.
|
|
3742
|
+
* @param param2 If you set preset to RoomAcoustics3dVoice , you need to set param2 to 0.
|
|
3743
|
+
* 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#
|
|
3287
3744
|
*
|
|
3288
3745
|
* @returns
|
|
3289
|
-
* 0: Success.
|
|
3746
|
+
* 0: Success.
|
|
3747
|
+
* < 0: Failure.
|
|
3290
3748
|
*/
|
|
3291
3749
|
abstract setAudioEffectParameters(preset: AudioEffectPreset, param1: number, param2: number): number;
|
|
3292
3750
|
/**
|
|
3293
3751
|
* Sets parameters for the preset voice beautifier effects.
|
|
3294
3752
|
*
|
|
3295
|
-
* 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.
|
|
3753
|
+
* 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.
|
|
3754
|
+
* You can call this method either before or after joining a channel.
|
|
3755
|
+
* Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect.
|
|
3756
|
+
* This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music.
|
|
3757
|
+
* 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
|
|
3296
3758
|
*
|
|
3297
|
-
* @param preset The option for the preset audio effect:SINGING_BEAUTIFIER: The singing beautifier effect.
|
|
3298
|
-
* @param param1 The gender characteristics options for the singing voice:1: A male-sounding voice.2: A female-sounding voice.
|
|
3299
|
-
* @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.
|
|
3759
|
+
* @param preset The option for the preset audio effect: SINGING_BEAUTIFIER : The singing beautifier effect.
|
|
3760
|
+
* @param param1 The gender characteristics options for the singing voice: 1 : A male-sounding voice. 2 : A female-sounding voice.
|
|
3761
|
+
* @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.
|
|
3300
3762
|
*
|
|
3301
3763
|
* @returns
|
|
3302
|
-
* 0: Success.
|
|
3764
|
+
* 0: Success.
|
|
3765
|
+
* < 0: Failure.
|
|
3303
3766
|
*/
|
|
3304
3767
|
abstract setVoiceBeautifierParameters(preset: VoiceBeautifierPreset, param1: number, param2: number): number;
|
|
3305
3768
|
/**
|
|
@@ -3314,18 +3777,20 @@ export declare abstract class IRtcEngine {
|
|
|
3314
3777
|
* @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).
|
|
3315
3778
|
*
|
|
3316
3779
|
* @returns
|
|
3317
|
-
* 0: Success.
|
|
3780
|
+
* 0: Success.
|
|
3781
|
+
* < 0: Failure.
|
|
3318
3782
|
*/
|
|
3319
3783
|
abstract setLocalVoicePitch(pitch: number): number;
|
|
3320
3784
|
/**
|
|
3321
3785
|
* Set the formant ratio to change the timbre of human voice.
|
|
3322
3786
|
*
|
|
3323
|
-
* 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
|
|
3787
|
+
* 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.
|
|
3324
3788
|
*
|
|
3325
|
-
* @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.
|
|
3789
|
+
* @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.
|
|
3326
3790
|
*
|
|
3327
3791
|
* @returns
|
|
3328
|
-
* 0: Success.
|
|
3792
|
+
* 0: Success.
|
|
3793
|
+
* < 0: Failure.
|
|
3329
3794
|
*/
|
|
3330
3795
|
abstract setLocalVoiceFormant(formantRatio: number): number;
|
|
3331
3796
|
/**
|
|
@@ -3337,19 +3802,21 @@ export declare abstract class IRtcEngine {
|
|
|
3337
3802
|
* @param bandGain The gain of each band in dB. The value ranges between -15 and 15. The default value is 0.
|
|
3338
3803
|
*
|
|
3339
3804
|
* @returns
|
|
3340
|
-
* 0: Success.
|
|
3805
|
+
* 0: Success.
|
|
3806
|
+
* < 0: Failure.
|
|
3341
3807
|
*/
|
|
3342
3808
|
abstract setLocalVoiceEqualization(bandFrequency: AudioEqualizationBandFrequency, bandGain: number): number;
|
|
3343
3809
|
/**
|
|
3344
3810
|
* Sets the local voice reverberation.
|
|
3345
3811
|
*
|
|
3346
|
-
* The SDK provides an easier-to-use method, setAudioEffectPreset
|
|
3812
|
+
* 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.
|
|
3347
3813
|
*
|
|
3348
3814
|
* @param reverbKey The reverberation key. Agora provides five reverberation keys, see AudioReverbType.
|
|
3349
3815
|
* @param value The value of the reverberation key.
|
|
3350
3816
|
*
|
|
3351
3817
|
* @returns
|
|
3352
|
-
* 0: Success.
|
|
3818
|
+
* 0: Success.
|
|
3819
|
+
* < 0: Failure.
|
|
3353
3820
|
*/
|
|
3354
3821
|
abstract setLocalVoiceReverb(reverbKey: AudioReverbType, value: number): number;
|
|
3355
3822
|
/**
|
|
@@ -3360,7 +3827,9 @@ export declare abstract class IRtcEngine {
|
|
|
3360
3827
|
* @param preset The preset headphone equalization effect. See HeadphoneEqualizerPreset.
|
|
3361
3828
|
*
|
|
3362
3829
|
* @returns
|
|
3363
|
-
* 0: Success.
|
|
3830
|
+
* 0: Success.
|
|
3831
|
+
* < 0: Failure.
|
|
3832
|
+
* -1: A general error occurs (no specified reason).
|
|
3364
3833
|
*/
|
|
3365
3834
|
abstract setHeadphoneEQPreset(preset: HeadphoneEqualizerPreset): number;
|
|
3366
3835
|
/**
|
|
@@ -3372,7 +3841,9 @@ export declare abstract class IRtcEngine {
|
|
|
3372
3841
|
* @param highGain The high-frequency parameters of the headphone equalizer. The value range is [-10,10]. The larger the value, the sharper the sound.
|
|
3373
3842
|
*
|
|
3374
3843
|
* @returns
|
|
3375
|
-
* 0: Success.
|
|
3844
|
+
* 0: Success.
|
|
3845
|
+
* < 0: Failure.
|
|
3846
|
+
* -1: A general error occurs (no specified reason).
|
|
3376
3847
|
*/
|
|
3377
3848
|
abstract setHeadphoneEQParameters(lowGain: number, highGain: number): number;
|
|
3378
3849
|
/**
|
|
@@ -3383,18 +3854,20 @@ export declare abstract class IRtcEngine {
|
|
|
3383
3854
|
* @param filePath The complete path of the log files. These log files are encoded in UTF-8.
|
|
3384
3855
|
*
|
|
3385
3856
|
* @returns
|
|
3386
|
-
* 0: Success.
|
|
3857
|
+
* 0: Success.
|
|
3858
|
+
* < 0: Failure.
|
|
3387
3859
|
*/
|
|
3388
3860
|
abstract setLogFile(filePath: string): number;
|
|
3389
3861
|
/**
|
|
3390
3862
|
* Sets the log output level of the SDK.
|
|
3391
3863
|
*
|
|
3392
|
-
* 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
|
|
3864
|
+
* 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.
|
|
3393
3865
|
*
|
|
3394
3866
|
* @param filter The output log level of the SDK. See LogFilterType.
|
|
3395
3867
|
*
|
|
3396
3868
|
* @returns
|
|
3397
|
-
* 0: Success.
|
|
3869
|
+
* 0: Success.
|
|
3870
|
+
* < 0: Failure.
|
|
3398
3871
|
*/
|
|
3399
3872
|
abstract setLogFilter(filter: LogFilterType): number;
|
|
3400
3873
|
/**
|
|
@@ -3405,18 +3878,31 @@ export declare abstract class IRtcEngine {
|
|
|
3405
3878
|
* @param level The log level: LogLevel.
|
|
3406
3879
|
*
|
|
3407
3880
|
* @returns
|
|
3408
|
-
* 0: Success.
|
|
3881
|
+
* 0: Success.
|
|
3882
|
+
* < 0: Failure.
|
|
3409
3883
|
*/
|
|
3410
3884
|
abstract setLogLevel(level: LogLevel): number;
|
|
3411
3885
|
/**
|
|
3412
3886
|
* Sets the log file size.
|
|
3413
3887
|
*
|
|
3414
|
-
* 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:
|
|
3888
|
+
* 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:
|
|
3889
|
+
* The SDK log files are: agorasdk.log, agorasdk.1.log, agorasdk.2.log, agorasdk.3.log, and agorasdk.4.log.
|
|
3890
|
+
* The API call log files are: agoraapi.log, agoraapi.1.log, agoraapi.2.log, agoraapi.3.log, and agoraapi.4.log.
|
|
3891
|
+
* 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.
|
|
3892
|
+
* The SDK writes the latest logs in agorasdk.log or agoraapi.log.
|
|
3893
|
+
* When agorasdk.log is full, the SDK processes the log files in the following order:
|
|
3894
|
+
* Delete the agorasdk.4.log file (if any).
|
|
3895
|
+
* Rename agorasdk.3.log to agorasdk.4.log.
|
|
3896
|
+
* Rename agorasdk.2.log to agorasdk.3.log.
|
|
3897
|
+
* Rename agorasdk.1.log to agorasdk.2.log.
|
|
3898
|
+
* Create a new agorasdk.log file.
|
|
3899
|
+
* 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.
|
|
3415
3900
|
*
|
|
3416
|
-
* @param fileSizeInKBytes The size (KB) of an agorasdk.log file. The value range is [128,20480]. The default value is
|
|
3901
|
+
* @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.
|
|
3417
3902
|
*
|
|
3418
3903
|
* @returns
|
|
3419
|
-
* 0: Success.
|
|
3904
|
+
* 0: Success.
|
|
3905
|
+
* < 0: Failure.
|
|
3420
3906
|
*/
|
|
3421
3907
|
abstract setLogFileSize(fileSizeInKBytes: number): number;
|
|
3422
3908
|
/**
|
|
@@ -3426,26 +3912,32 @@ export declare abstract class IRtcEngine {
|
|
|
3426
3912
|
/**
|
|
3427
3913
|
* Updates the display mode of the local video view.
|
|
3428
3914
|
*
|
|
3429
|
-
* 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.
|
|
3915
|
+
* 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.
|
|
3916
|
+
* Ensure that you have called the setupLocalVideo method to initialize the local video view before calling this method.
|
|
3917
|
+
* During a call, you can call this method as many times as necessary to update the display mode of the local video view.
|
|
3430
3918
|
*
|
|
3431
3919
|
* @param renderMode The local video display mode. See RenderModeType.
|
|
3432
|
-
* @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.
|
|
3920
|
+
* @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.
|
|
3433
3921
|
*
|
|
3434
3922
|
* @returns
|
|
3435
|
-
* 0: Success.
|
|
3923
|
+
* 0: Success.
|
|
3924
|
+
* < 0: Failure.
|
|
3436
3925
|
*/
|
|
3437
3926
|
abstract setLocalRenderMode(renderMode: RenderModeType, mirrorMode?: VideoMirrorModeType): number;
|
|
3438
3927
|
/**
|
|
3439
3928
|
* Updates the display mode of the video view of a remote user.
|
|
3440
3929
|
*
|
|
3441
|
-
* 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.
|
|
3930
|
+
* 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.
|
|
3931
|
+
* Call this method after initializing the remote view by calling the setupRemoteVideo method.
|
|
3932
|
+
* 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.
|
|
3442
3933
|
*
|
|
3443
3934
|
* @param uid The user ID of the remote user.
|
|
3444
3935
|
* @param renderMode The rendering mode of the remote user view.
|
|
3445
3936
|
* @param mirrorMode The mirror mode of the remote user view. See VideoMirrorModeType.
|
|
3446
3937
|
*
|
|
3447
3938
|
* @returns
|
|
3448
|
-
* 0: Success.
|
|
3939
|
+
* 0: Success.
|
|
3940
|
+
* < 0: Failure.
|
|
3449
3941
|
*/
|
|
3450
3942
|
abstract setRemoteRenderMode(uid: number, renderMode: RenderModeType, mirrorMode: VideoMirrorModeType): number;
|
|
3451
3943
|
/**
|
|
@@ -3456,31 +3948,44 @@ export declare abstract class IRtcEngine {
|
|
|
3456
3948
|
* @param mirrorMode The local video mirror mode. See VideoMirrorModeType.
|
|
3457
3949
|
*
|
|
3458
3950
|
* @returns
|
|
3459
|
-
* 0: Success.
|
|
3951
|
+
* 0: Success.
|
|
3952
|
+
* < 0: Failure.
|
|
3460
3953
|
*/
|
|
3461
3954
|
abstract setLocalVideoMirrorMode(mirrorMode: VideoMirrorModeType): number;
|
|
3462
3955
|
/**
|
|
3463
3956
|
* Enables or disables the dual-stream mode on the sender and sets the low-quality video stream.
|
|
3464
3957
|
*
|
|
3465
|
-
* 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:
|
|
3958
|
+
* 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:
|
|
3959
|
+
* High-quality video stream: High bitrate, high resolution.
|
|
3960
|
+
* 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.
|
|
3961
|
+
* 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.
|
|
3962
|
+
* If you need to enable dual video streams in a multi-channel scenario, you can call the enableDualStreamModeEx method.
|
|
3963
|
+
* You can call this method either before or after joining a channel.
|
|
3466
3964
|
*
|
|
3467
|
-
* @param enabled Whether to enable dual-stream mode:true: Enable dual-stream mode.false: (Default) Disable dual-stream mode.
|
|
3965
|
+
* @param enabled Whether to enable dual-stream mode: true : Enable dual-stream mode. false : (Default) Disable dual-stream mode.
|
|
3468
3966
|
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.
|
|
3469
3967
|
*
|
|
3470
3968
|
* @returns
|
|
3471
|
-
* 0: Success.
|
|
3969
|
+
* 0: Success.
|
|
3970
|
+
* < 0: Failure.
|
|
3472
3971
|
*/
|
|
3473
3972
|
abstract enableDualStreamMode(enabled: boolean, streamConfig?: SimulcastStreamConfig): number;
|
|
3474
3973
|
/**
|
|
3475
3974
|
* Sets dual-stream mode configuration on the sender, and sets the low-quality video stream.
|
|
3476
3975
|
*
|
|
3477
|
-
* The
|
|
3976
|
+
* The SDK enables the low-quality video stream auto mode on the sender side by default (it does not actively sending low-quality video streams). The host identity receiver can initiate a low-quality video stream application at the receiving end by calling setRemoteVideoStreamType. After receiving the application, the sending end automatically switches to the low-quality video stream mode.
|
|
3977
|
+
* 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).
|
|
3978
|
+
* If you want to restore the default behavior after making changes, you can call this method again with mode set to AutoSimulcastStream. The difference and connection between this method and is as follows:
|
|
3979
|
+
* When calling this method and setting mode to DisableSimulcastStream, it has the same effect as calling and setting enabled to false.
|
|
3980
|
+
* When calling this method and setting mode to EnableSimulcastStream, it has the same effect as calling and setting enabled to true.
|
|
3981
|
+
* 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.
|
|
3478
3982
|
*
|
|
3479
3983
|
* @param mode The mode in which the video stream is sent. See SimulcastStreamMode.
|
|
3480
|
-
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig.When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
|
|
3984
|
+
* @param streamConfig The configuration of the low-quality video stream. See SimulcastStreamConfig. When setting mode to DisableSimulcastStream, setting streamConfig will not take effect.
|
|
3481
3985
|
*
|
|
3482
3986
|
* @returns
|
|
3483
|
-
* 0: Success.
|
|
3987
|
+
* 0: Success.
|
|
3988
|
+
* < 0: Failure.
|
|
3484
3989
|
*/
|
|
3485
3990
|
abstract setDualStreamMode(mode: SimulcastStreamMode, streamConfig?: SimulcastStreamConfig): number;
|
|
3486
3991
|
/**
|
|
@@ -3490,29 +3995,39 @@ export declare abstract class IRtcEngine {
|
|
|
3490
3995
|
/**
|
|
3491
3996
|
* Sets the format of the captured raw audio data.
|
|
3492
3997
|
*
|
|
3493
|
-
* Sets the audio format for the onRecordAudioFrame callback.
|
|
3998
|
+
* Sets the audio format for the onRecordAudioFrame callback.
|
|
3999
|
+
* Ensure that you call this method before joining a channel.
|
|
4000
|
+
* 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).
|
|
3494
4001
|
*
|
|
3495
4002
|
* @param sampleRate The sample rate returned in the SDK, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
|
|
3496
|
-
* @param channel The number of channels returned by the SDK. You can set the value as 1 or 2:
|
|
4003
|
+
* @param channel The number of channels returned by the SDK. You can set the value as 1 or 2:
|
|
4004
|
+
* 1: Mono.
|
|
4005
|
+
* 2: Stereo.
|
|
3497
4006
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
3498
4007
|
* @param samplesPerCall The number of data samples returned in the SDK, such as 1024 for the Media Push.
|
|
3499
4008
|
*
|
|
3500
4009
|
* @returns
|
|
3501
|
-
* 0: Success.
|
|
4010
|
+
* 0: Success.
|
|
4011
|
+
* < 0: Failure.
|
|
3502
4012
|
*/
|
|
3503
4013
|
abstract setRecordingAudioFrameParameters(sampleRate: number, channel: number, mode: RawAudioFrameOpModeType, samplesPerCall: number): number;
|
|
3504
4014
|
/**
|
|
3505
4015
|
* Sets the audio data format for playback.
|
|
3506
4016
|
*
|
|
3507
|
-
* Sets the data format for the onPlaybackAudioFrame callback.
|
|
4017
|
+
* Sets the data format for the onPlaybackAudioFrame callback.
|
|
4018
|
+
* Ensure that you call this method before joining a channel.
|
|
4019
|
+
* 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.
|
|
3508
4020
|
*
|
|
3509
4021
|
* @param sampleRate The sample rate returned in the onPlaybackAudioFrame callback, which can be set as 8000, 16000, 32000, 44100, or 48000 Hz.
|
|
3510
|
-
* @param channel The number of channels returned in the onPlaybackAudioFrame callback:
|
|
4022
|
+
* @param channel The number of channels returned in the onPlaybackAudioFrame callback:
|
|
4023
|
+
* 1: Mono.
|
|
4024
|
+
* 2: Stereo.
|
|
3511
4025
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
3512
4026
|
* @param samplesPerCall The number of data samples returned in the onPlaybackAudioFrame callback, such as 1024 for the Media Push.
|
|
3513
4027
|
*
|
|
3514
4028
|
* @returns
|
|
3515
|
-
* 0: Success.
|
|
4029
|
+
* 0: Success.
|
|
4030
|
+
* < 0: Failure.
|
|
3516
4031
|
*/
|
|
3517
4032
|
abstract setPlaybackAudioFrameParameters(sampleRate: number, channel: number, mode: RawAudioFrameOpModeType, samplesPerCall: number): number;
|
|
3518
4033
|
/**
|
|
@@ -3523,31 +4038,38 @@ export declare abstract class IRtcEngine {
|
|
|
3523
4038
|
* @param samplesPerCall Sets the number of samples. In Media Push scenarios, set it as 1024.
|
|
3524
4039
|
*
|
|
3525
4040
|
* @returns
|
|
3526
|
-
* 0: Success.
|
|
4041
|
+
* 0: Success.
|
|
4042
|
+
* < 0: Failure.
|
|
3527
4043
|
*/
|
|
3528
4044
|
abstract setMixedAudioFrameParameters(sampleRate: number, channel: number, samplesPerCall: number): number;
|
|
3529
4045
|
/**
|
|
3530
4046
|
* Sets the format of the in-ear monitoring raw audio data.
|
|
3531
4047
|
*
|
|
3532
|
-
* This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
|
|
4048
|
+
* This method is used to set the in-ear monitoring audio data format reported by the onEarMonitoringAudioFrame callback.
|
|
4049
|
+
* Before calling this method, you need to call enableInEarMonitoring, and set includeAudioFilters to EarMonitoringFilterBuiltInAudioFilters or EarMonitoringFilterNoiseSuppression.
|
|
4050
|
+
* 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.
|
|
3533
4051
|
*
|
|
3534
4052
|
* @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.
|
|
3535
|
-
* @param channel The number of audio channels reported in the onEarMonitoringAudioFrame callback.
|
|
4053
|
+
* @param channel The number of audio channels reported in the onEarMonitoringAudioFrame callback.
|
|
4054
|
+
* 1: Mono.
|
|
4055
|
+
* 2: Stereo.
|
|
3536
4056
|
* @param mode The use mode of the audio frame. See RawAudioFrameOpModeType.
|
|
3537
4057
|
* @param samplesPerCall The number of data samples reported in the onEarMonitoringAudioFrame callback, such as 1,024 for the Media Push.
|
|
3538
4058
|
*
|
|
3539
4059
|
* @returns
|
|
3540
|
-
* 0: Success.
|
|
4060
|
+
* 0: Success.
|
|
4061
|
+
* < 0: Failure.
|
|
3541
4062
|
*/
|
|
3542
4063
|
abstract setEarMonitoringAudioFrameParameters(sampleRate: number, channel: number, mode: RawAudioFrameOpModeType, samplesPerCall: number): number;
|
|
3543
4064
|
/**
|
|
3544
4065
|
* Sets the audio data format reported by onPlaybackAudioFrameBeforeMixing.
|
|
3545
4066
|
*
|
|
3546
4067
|
* @param sampleRate The sample rate (Hz) of the audio data, which can be set as 8000, 16000, 32000, 44100, or 48000.
|
|
3547
|
-
* @param channel The number of channels of the external audio source, which can be set as 1(Mono) or 2(Stereo).
|
|
4068
|
+
* @param channel The number of channels of the external audio source, which can be set as 1 (Mono) or 2 (Stereo).
|
|
3548
4069
|
*
|
|
3549
4070
|
* @returns
|
|
3550
|
-
* 0: Success.
|
|
4071
|
+
* 0: Success.
|
|
4072
|
+
* < 0: Failure.
|
|
3551
4073
|
*/
|
|
3552
4074
|
abstract setPlaybackAudioFrameBeforeMixingParameters(sampleRate: number, channel: number): number;
|
|
3553
4075
|
/**
|
|
@@ -3558,16 +4080,19 @@ export declare abstract class IRtcEngine {
|
|
|
3558
4080
|
* @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.
|
|
3559
4081
|
*
|
|
3560
4082
|
* @returns
|
|
3561
|
-
* 0: Success.
|
|
4083
|
+
* 0: Success.
|
|
4084
|
+
* < 0: Failure.
|
|
4085
|
+
* -2: Invalid parameters.
|
|
3562
4086
|
*/
|
|
3563
4087
|
abstract enableAudioSpectrumMonitor(intervalInMS?: number): number;
|
|
3564
4088
|
/**
|
|
3565
4089
|
* Disables audio spectrum monitoring.
|
|
3566
4090
|
*
|
|
3567
|
-
* After calling enableAudioSpectrumMonitor
|
|
4091
|
+
* 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.
|
|
3568
4092
|
*
|
|
3569
4093
|
* @returns
|
|
3570
|
-
* 0: Success.
|
|
4094
|
+
* 0: Success.
|
|
4095
|
+
* < 0: Failure.
|
|
3571
4096
|
*/
|
|
3572
4097
|
abstract disableAudioSpectrumMonitor(): number;
|
|
3573
4098
|
/**
|
|
@@ -3584,10 +4109,11 @@ export declare abstract class IRtcEngine {
|
|
|
3584
4109
|
/**
|
|
3585
4110
|
* Unregisters the audio spectrum observer.
|
|
3586
4111
|
*
|
|
3587
|
-
* After calling registerAudioSpectrumObserver
|
|
4112
|
+
* 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.
|
|
3588
4113
|
*
|
|
3589
4114
|
* @returns
|
|
3590
|
-
* 0: Success.
|
|
4115
|
+
* 0: Success.
|
|
4116
|
+
* < 0: Failure.
|
|
3591
4117
|
*/
|
|
3592
4118
|
abstract unregisterAudioSpectrumObserver(observer: IAudioSpectrumObserver): number;
|
|
3593
4119
|
/**
|
|
@@ -3595,45 +4121,55 @@ export declare abstract class IRtcEngine {
|
|
|
3595
4121
|
*
|
|
3596
4122
|
* You can call this method either before or after joining a channel.
|
|
3597
4123
|
*
|
|
3598
|
-
* @param volume The volume of the user. The value range is [0,400].
|
|
4124
|
+
* @param volume The volume of the user. The value range is [0,400].
|
|
4125
|
+
* 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4126
|
+
* 100: (Default) The original volume.
|
|
4127
|
+
* 400: Four times the original volume (amplifying the audio signals by four times).
|
|
3599
4128
|
*
|
|
3600
4129
|
* @returns
|
|
3601
|
-
* 0: Success.
|
|
4130
|
+
* 0: Success.
|
|
4131
|
+
* < 0: Failure.
|
|
3602
4132
|
*/
|
|
3603
4133
|
abstract adjustRecordingSignalVolume(volume: number): number;
|
|
3604
4134
|
/**
|
|
3605
4135
|
* Whether to mute the recording signal.
|
|
3606
4136
|
*
|
|
3607
|
-
* @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.
|
|
4137
|
+
* @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.
|
|
3608
4138
|
*
|
|
3609
4139
|
* @returns
|
|
3610
|
-
* 0: Success.
|
|
4140
|
+
* 0: Success.
|
|
4141
|
+
* < 0: Failure.
|
|
3611
4142
|
*/
|
|
3612
4143
|
abstract muteRecordingSignal(mute: boolean): number;
|
|
3613
4144
|
/**
|
|
3614
4145
|
* Adjusts the playback signal volume of all remote users.
|
|
3615
4146
|
*
|
|
3616
|
-
* This method adjusts the playback volume that is the mixed volume of all remote users.
|
|
4147
|
+
* This method adjusts the playback volume that is the mixed volume of all remote users.
|
|
4148
|
+
* You can call this method either before or after joining a channel.
|
|
3617
4149
|
*
|
|
3618
4150
|
* @param volume The volume of the user. The value range is [0,400].
|
|
3619
|
-
* 0: Mute.If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
4151
|
+
* 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead.
|
|
3620
4152
|
* 100: (Default) The original volume.
|
|
3621
4153
|
* 400: Four times the original volume (amplifying the audio signals by four times).
|
|
3622
4154
|
*
|
|
3623
4155
|
* @returns
|
|
3624
|
-
* 0: Success.
|
|
4156
|
+
* 0: Success.
|
|
4157
|
+
* < 0: Failure.
|
|
3625
4158
|
*/
|
|
3626
4159
|
abstract adjustPlaybackSignalVolume(volume: number): number;
|
|
3627
4160
|
/**
|
|
3628
4161
|
* Adjusts the playback signal volume of a specified remote user.
|
|
3629
4162
|
*
|
|
3630
|
-
* 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.
|
|
4163
|
+
* 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.
|
|
4164
|
+
* Call this method after joining a channel.
|
|
4165
|
+
* The playback volume here refers to the mixed volume of a specified remote user.
|
|
3631
4166
|
*
|
|
3632
4167
|
* @param uid The user ID of the remote user.
|
|
3633
4168
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
3634
4169
|
*
|
|
3635
4170
|
* @returns
|
|
3636
|
-
* 0: Success.
|
|
4171
|
+
* 0: Success.
|
|
4172
|
+
* < 0: Failure.
|
|
3637
4173
|
*/
|
|
3638
4174
|
abstract adjustUserPlaybackSignalVolume(uid: number, volume: number): number;
|
|
3639
4175
|
/**
|
|
@@ -3651,13 +4187,17 @@ export declare abstract class IRtcEngine {
|
|
|
3651
4187
|
/**
|
|
3652
4188
|
* Enables loopback audio capturing.
|
|
3653
4189
|
*
|
|
3654
|
-
* If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
|
|
4190
|
+
* If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end.
|
|
4191
|
+
* 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.
|
|
4192
|
+
* You can call this method either before or after joining a channel.
|
|
3655
4193
|
*
|
|
3656
|
-
* @param enabled Whether to enable loopback audio capturing.true: Enable loopback audio capturing.false: (Default) Disable loopback audio capturing.
|
|
3657
|
-
* @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.
|
|
4194
|
+
* @param enabled Whether to enable loopback audio capturing. true : Enable loopback audio capturing. false : (Default) Disable loopback audio capturing.
|
|
4195
|
+
* @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.
|
|
4196
|
+
* 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.
|
|
3658
4197
|
*
|
|
3659
4198
|
* @returns
|
|
3660
|
-
* 0: Success.
|
|
4199
|
+
* 0: Success.
|
|
4200
|
+
* < 0: Failure.
|
|
3661
4201
|
*/
|
|
3662
4202
|
abstract enableLoopbackRecording(enabled: boolean, deviceName?: string): number;
|
|
3663
4203
|
/**
|
|
@@ -3668,7 +4208,8 @@ export declare abstract class IRtcEngine {
|
|
|
3668
4208
|
* @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume.
|
|
3669
4209
|
*
|
|
3670
4210
|
* @returns
|
|
3671
|
-
* 0: Success.
|
|
4211
|
+
* 0: Success.
|
|
4212
|
+
* < 0: Failure.
|
|
3672
4213
|
*/
|
|
3673
4214
|
abstract adjustLoopbackSignalVolume(volume: number): number;
|
|
3674
4215
|
/**
|
|
@@ -3678,19 +4219,24 @@ export declare abstract class IRtcEngine {
|
|
|
3678
4219
|
/**
|
|
3679
4220
|
* Enables in-ear monitoring.
|
|
3680
4221
|
*
|
|
3681
|
-
* This method enables or disables in-ear monitoring.
|
|
4222
|
+
* This method enables or disables in-ear monitoring.
|
|
4223
|
+
* Users must use earphones (wired or Bluetooth) to hear the in-ear monitoring effect.
|
|
4224
|
+
* You can call this method either before or after joining a channel.
|
|
3682
4225
|
*
|
|
3683
|
-
* @param enabled Enables or disables in-ear monitoring.true: Enables in-ear monitoring.false: (Default) Disables in-ear monitoring.
|
|
4226
|
+
* @param enabled Enables or disables in-ear monitoring. true : Enables in-ear monitoring. false : (Default) Disables in-ear monitoring.
|
|
3684
4227
|
* @param includeAudioFilters The audio filter of in-ear monitoring: See EarMonitoringFilterType.
|
|
3685
4228
|
*
|
|
3686
4229
|
* @returns
|
|
3687
|
-
* 0: Success.
|
|
4230
|
+
* 0: Success.
|
|
4231
|
+
* < 0: Failure.
|
|
4232
|
+
* - 8: Make sure the current audio routing is Bluetooth or headset.
|
|
3688
4233
|
*/
|
|
3689
4234
|
abstract enableInEarMonitoring(enabled: boolean, includeAudioFilters: EarMonitoringFilterType): number;
|
|
3690
4235
|
/**
|
|
3691
4236
|
* Sets the volume of the in-ear monitor.
|
|
3692
4237
|
*
|
|
3693
|
-
* Users must use wired earphones to hear their own voices.
|
|
4238
|
+
* Users must use wired earphones to hear their own voices.
|
|
4239
|
+
* You can call this method either before or after joining a channel.
|
|
3694
4240
|
*
|
|
3695
4241
|
* @param volume The volume of the in-ear monitor. The value ranges between 0 and 100. The default value is 100.
|
|
3696
4242
|
*
|
|
@@ -3704,23 +4250,25 @@ export declare abstract class IRtcEngine {
|
|
|
3704
4250
|
* This method applies to Windows only.
|
|
3705
4251
|
*
|
|
3706
4252
|
* @param path The extension library path and name. For example: /library/libagora_segmentation_extension.dll.
|
|
3707
|
-
* @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.
|
|
4253
|
+
* @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.
|
|
3708
4254
|
*
|
|
3709
4255
|
* @returns
|
|
3710
|
-
* 0: Success.
|
|
4256
|
+
* 0: Success.
|
|
4257
|
+
* < 0: Failure.
|
|
3711
4258
|
*/
|
|
3712
4259
|
abstract loadExtensionProvider(path: string, unloadAfterUse?: boolean): number;
|
|
3713
4260
|
/**
|
|
3714
4261
|
* Sets the properties of the extension provider.
|
|
3715
4262
|
*
|
|
3716
|
-
* 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
|
|
4263
|
+
* 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).
|
|
3717
4264
|
*
|
|
3718
4265
|
* @param provider The name of the extension provider.
|
|
3719
4266
|
* @param key The key of the extension.
|
|
3720
4267
|
* @param value The value of the extension key.
|
|
3721
4268
|
*
|
|
3722
4269
|
* @returns
|
|
3723
|
-
* 0: Success.
|
|
4270
|
+
* 0: Success.
|
|
4271
|
+
* < 0: Failure.
|
|
3724
4272
|
*/
|
|
3725
4273
|
abstract setExtensionProviderProperty(provider: string, key: string, value: string): number;
|
|
3726
4274
|
/**
|
|
@@ -3730,26 +4278,33 @@ export declare abstract class IRtcEngine {
|
|
|
3730
4278
|
*
|
|
3731
4279
|
* @param provider The name of the extension provider.
|
|
3732
4280
|
* @param extension The name of the extension.
|
|
3733
|
-
* @param type Type of media source. See MediaSourceType.In this method, this parameter supports only the following two settings:
|
|
4281
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
3734
4282
|
* The default value is UnknownMediaSource.
|
|
3735
4283
|
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
3736
4284
|
*
|
|
3737
4285
|
* @returns
|
|
3738
|
-
* 0: Success.
|
|
4286
|
+
* 0: Success.
|
|
4287
|
+
* < 0: Failure.
|
|
3739
4288
|
*/
|
|
3740
4289
|
abstract registerExtension(provider: string, extension: string, type?: MediaSourceType): number;
|
|
3741
4290
|
/**
|
|
3742
4291
|
* Enables or disables extensions.
|
|
3743
4292
|
*
|
|
3744
|
-
* To call this method, call it immediately after initializing the IRtcEngine object.
|
|
4293
|
+
* To call this method, call it immediately after initializing the IRtcEngine object.
|
|
4294
|
+
* If you want to enable multiple extensions, you need to call this method multiple times.
|
|
4295
|
+
* 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.
|
|
3745
4296
|
*
|
|
3746
4297
|
* @param provider The name of the extension provider.
|
|
3747
4298
|
* @param extension The name of the extension.
|
|
3748
|
-
* @param enable Whether to enable the extension:true: Enable the extension.false: Disable the extension.
|
|
3749
|
-
* @param type Type of media source. See MediaSourceType.In this method, this parameter supports only the following two settings:
|
|
4299
|
+
* @param enable Whether to enable the extension: true : Enable the extension. false : Disable the extension.
|
|
4300
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
4301
|
+
* The default value is UnknownMediaSource.
|
|
4302
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
3750
4303
|
*
|
|
3751
4304
|
* @returns
|
|
3752
|
-
* 0: Success.
|
|
4305
|
+
* 0: Success.
|
|
4306
|
+
* < 0: Failure.
|
|
4307
|
+
* -3: The extension library is not loaded. Agora recommends that you check the storage location or the name of the dynamic library.
|
|
3753
4308
|
*/
|
|
3754
4309
|
abstract enableExtension(provider: string, extension: string, enable?: boolean, type?: MediaSourceType): number;
|
|
3755
4310
|
/**
|
|
@@ -3761,10 +4316,13 @@ export declare abstract class IRtcEngine {
|
|
|
3761
4316
|
* @param extension The name of the extension.
|
|
3762
4317
|
* @param key The key of the extension.
|
|
3763
4318
|
* @param value The value of the extension key.
|
|
3764
|
-
* @param type
|
|
4319
|
+
* @param type Type of media source. See MediaSourceType. In this method, this parameter supports only the following two settings:
|
|
4320
|
+
* The default value is UnknownMediaSource.
|
|
4321
|
+
* If you want to use the second camera to capture video, set this parameter to SecondaryCameraSource.
|
|
3765
4322
|
*
|
|
3766
4323
|
* @returns
|
|
3767
|
-
* 0: Success.
|
|
4324
|
+
* 0: Success.
|
|
4325
|
+
* < 0: Failure.
|
|
3768
4326
|
*/
|
|
3769
4327
|
abstract setExtensionProperty(provider: string, extension: string, key: string, value: string, type?: MediaSourceType): number;
|
|
3770
4328
|
/**
|
|
@@ -3777,7 +4335,8 @@ export declare abstract class IRtcEngine {
|
|
|
3777
4335
|
* @param type Source type of the extension. See MediaSourceType.
|
|
3778
4336
|
*
|
|
3779
4337
|
* @returns
|
|
3780
|
-
* The extension information, if the method call succeeds.
|
|
4338
|
+
* The extension information, if the method call succeeds.
|
|
4339
|
+
* An empty string, if the method call fails.
|
|
3781
4340
|
*/
|
|
3782
4341
|
abstract getExtensionProperty(provider: string, extension: string, key: string, bufLen: number, type?: MediaSourceType): string;
|
|
3783
4342
|
/**
|
|
@@ -3787,10 +4346,14 @@ export declare abstract class IRtcEngine {
|
|
|
3787
4346
|
/**
|
|
3788
4347
|
* Creates a customized video track.
|
|
3789
4348
|
*
|
|
3790
|
-
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
|
|
4349
|
+
* When you need to publish multiple custom captured videos in the channel, you can refer to the following steps:
|
|
4350
|
+
* Call this method to create a video track and get the video track ID.
|
|
4351
|
+
* 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.
|
|
4352
|
+
* 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.
|
|
3791
4353
|
*
|
|
3792
4354
|
* @returns
|
|
3793
|
-
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.
|
|
4355
|
+
* If the method call is successful, the video track ID is returned as the unique identifier of the video track.
|
|
4356
|
+
* If the method call fails, a negative value is returned.
|
|
3794
4357
|
*/
|
|
3795
4358
|
abstract createCustomVideoTrack(): number;
|
|
3796
4359
|
/**
|
|
@@ -3803,7 +4366,8 @@ export declare abstract class IRtcEngine {
|
|
|
3803
4366
|
* @param videoTrackId The video track ID returned by calling the createCustomVideoTrack method.
|
|
3804
4367
|
*
|
|
3805
4368
|
* @returns
|
|
3806
|
-
* 0: Success.
|
|
4369
|
+
* 0: Success.
|
|
4370
|
+
* < 0: Failure.
|
|
3807
4371
|
*/
|
|
3808
4372
|
abstract destroyCustomVideoTrack(videoTrackId: number): number;
|
|
3809
4373
|
/**
|
|
@@ -3873,7 +4437,7 @@ export declare abstract class IRtcEngine {
|
|
|
3873
4437
|
/**
|
|
3874
4438
|
* @ignore
|
|
3875
4439
|
*/
|
|
3876
|
-
abstract setCameraExposureFactor(
|
|
4440
|
+
abstract setCameraExposureFactor(factor: number): number;
|
|
3877
4441
|
/**
|
|
3878
4442
|
* @ignore
|
|
3879
4443
|
*/
|
|
@@ -3905,7 +4469,7 @@ export declare abstract class IRtcEngine {
|
|
|
3905
4469
|
*
|
|
3906
4470
|
* @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.
|
|
3907
4471
|
* @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.
|
|
3908
|
-
* @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.
|
|
4472
|
+
* @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.
|
|
3909
4473
|
*
|
|
3910
4474
|
* @returns
|
|
3911
4475
|
* The ScreenCaptureSourceInfo array.
|
|
@@ -3918,60 +4482,80 @@ export declare abstract class IRtcEngine {
|
|
|
3918
4482
|
/**
|
|
3919
4483
|
* Captures the screen by specifying the display ID.
|
|
3920
4484
|
*
|
|
3921
|
-
* 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:
|
|
4485
|
+
* 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:
|
|
4486
|
+
* 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.
|
|
4487
|
+
* Call this method after joining a channel, and then call updateChannelMediaOptions and set publishScreenTrack or publishSecondaryScreenTrack to true to start screen sharing.
|
|
3922
4488
|
*
|
|
3923
|
-
* @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.
|
|
4489
|
+
* @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.
|
|
3924
4490
|
* @param regionRect (Optional) Sets the relative location of the region to the screen. Pass in nil to share the entire screen.
|
|
3925
4491
|
* @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.
|
|
3926
4492
|
*
|
|
3927
4493
|
* @returns
|
|
3928
|
-
* 0: Success.
|
|
4494
|
+
* 0: Success.
|
|
4495
|
+
* < 0: Failure.
|
|
4496
|
+
* -2: The parameter is invalid.
|
|
4497
|
+
* -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.
|
|
3929
4498
|
*/
|
|
3930
4499
|
abstract startScreenCaptureByDisplayId(displayId: number, regionRect: Rectangle, captureParams: ScreenCaptureParameters): number;
|
|
3931
4500
|
/**
|
|
3932
4501
|
* Captures the whole or part of a screen by specifying the screen rect.
|
|
3933
4502
|
*
|
|
3934
|
-
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
4503
|
+
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
4504
|
+
* 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.
|
|
4505
|
+
* 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.
|
|
3935
4506
|
*
|
|
3936
4507
|
* @param screenRect Sets the relative location of the screen to the virtual screen.
|
|
3937
|
-
* @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.
|
|
4508
|
+
* @param regionRect Sets the relative location of the region to the screen. If you do not set this parameter, the SDK shares the whole screen. See Rectangle. If the specified region overruns the screen, the SDK shares only the region within it; if you set width or height as 0, the SDK shares the whole screen.
|
|
3938
4509
|
* @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.
|
|
3939
4510
|
*
|
|
3940
4511
|
* @returns
|
|
3941
|
-
* 0: Success.
|
|
4512
|
+
* 0: Success.
|
|
4513
|
+
* < 0: Failure.
|
|
4514
|
+
* -2: The parameter is invalid.
|
|
4515
|
+
* -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.
|
|
3942
4516
|
*/
|
|
3943
4517
|
abstract startScreenCaptureByScreenRect(screenRect: Rectangle, regionRect: Rectangle, captureParams: ScreenCaptureParameters): number;
|
|
3944
4518
|
/**
|
|
3945
4519
|
* Gets the audio device information.
|
|
3946
4520
|
*
|
|
3947
|
-
* After calling this method, you can get whether the audio device supports ultra-low-latency capture and playback.
|
|
4521
|
+
* After calling this method, you can get whether the audio device supports ultra-low-latency capture and playback.
|
|
4522
|
+
* You can call this method either before or after joining a channel.
|
|
3948
4523
|
*
|
|
3949
4524
|
* @returns
|
|
3950
|
-
* The DeviceInfo object that identifies the audio device information.
|
|
4525
|
+
* The DeviceInfo object that identifies the audio device information.
|
|
4526
|
+
* Not null: Success.
|
|
4527
|
+
* Null: Failure.
|
|
3951
4528
|
*/
|
|
3952
4529
|
abstract getAudioDeviceInfo(): DeviceInfo;
|
|
3953
4530
|
/**
|
|
3954
4531
|
* Captures the whole or part of a window by specifying the window ID.
|
|
3955
4532
|
*
|
|
3956
|
-
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
4533
|
+
* There are two ways to start screen sharing, you can choose one according to your needs:
|
|
4534
|
+
* 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.
|
|
4535
|
+
* 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.
|
|
4536
|
+
* 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:
|
|
3957
4537
|
*
|
|
3958
4538
|
* @param windowId The ID of the window to be shared.
|
|
3959
4539
|
* @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.
|
|
3960
4540
|
* @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.
|
|
3961
4541
|
*
|
|
3962
4542
|
* @returns
|
|
3963
|
-
* 0: Success.
|
|
4543
|
+
* 0: Success.
|
|
4544
|
+
* < 0: Failure.
|
|
4545
|
+
* -2: The parameter is invalid.
|
|
4546
|
+
* -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.
|
|
3964
4547
|
*/
|
|
3965
4548
|
abstract startScreenCaptureByWindowId(windowId: any, regionRect: Rectangle, captureParams: ScreenCaptureParameters): number;
|
|
3966
4549
|
/**
|
|
3967
4550
|
* Sets the content hint for screen sharing.
|
|
3968
4551
|
*
|
|
3969
|
-
* 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
|
|
4552
|
+
* 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.
|
|
3970
4553
|
*
|
|
3971
4554
|
* @param contentHint The content hint for screen sharing. See VideoContentHint.
|
|
3972
4555
|
*
|
|
3973
4556
|
* @returns
|
|
3974
|
-
* 0: Success.
|
|
4557
|
+
* 0: Success.
|
|
4558
|
+
* < 0: Failure.
|
|
3975
4559
|
* -2: The parameter is invalid.
|
|
3976
4560
|
* -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.
|
|
3977
4561
|
*/
|
|
@@ -3984,7 +4568,10 @@ export declare abstract class IRtcEngine {
|
|
|
3984
4568
|
* @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.
|
|
3985
4569
|
*
|
|
3986
4570
|
* @returns
|
|
3987
|
-
* 0: Success.
|
|
4571
|
+
* 0: Success.
|
|
4572
|
+
* < 0: Failure.
|
|
4573
|
+
* -2: The parameter is invalid.
|
|
4574
|
+
* -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.
|
|
3988
4575
|
*/
|
|
3989
4576
|
abstract updateScreenCaptureRegion(regionRect: Rectangle): number;
|
|
3990
4577
|
/**
|
|
@@ -3992,10 +4579,11 @@ export declare abstract class IRtcEngine {
|
|
|
3992
4579
|
*
|
|
3993
4580
|
* Call this method after starting screen sharing or window sharing.
|
|
3994
4581
|
*
|
|
3995
|
-
* @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
|
|
4582
|
+
* @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.
|
|
3996
4583
|
*
|
|
3997
4584
|
* @returns
|
|
3998
|
-
* 0: Success.
|
|
4585
|
+
* 0: Success.
|
|
4586
|
+
* < 0: Failure.
|
|
3999
4587
|
* -2: The parameter is invalid.
|
|
4000
4588
|
* -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.
|
|
4001
4589
|
*/
|
|
@@ -4007,9 +4595,12 @@ export declare abstract class IRtcEngine {
|
|
|
4007
4595
|
/**
|
|
4008
4596
|
* Starts screen capture.
|
|
4009
4597
|
*
|
|
4010
|
-
* This method, as well as startScreenCaptureByDisplayId and startScreenCaptureByWindowId
|
|
4598
|
+
* 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.
|
|
4599
|
+
* If you call this method to start screen capture, Agora recommends that you call stopScreenCaptureBySourceType to stop the capture and avoid using stopScreenCapture.
|
|
4011
4600
|
*
|
|
4012
|
-
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4601
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4602
|
+
* Windows supports up to four screen capture video streams.
|
|
4603
|
+
* macOS supports only one screen capture video stream. You can only set this parameter to VideoSourceScreen (2).
|
|
4013
4604
|
* @param config The configuration of the captured screen. See ScreenCaptureConfiguration.
|
|
4014
4605
|
*/
|
|
4015
4606
|
abstract startScreenCaptureBySourceType(sourceType: VideoSourceType, config: ScreenCaptureConfiguration): number;
|
|
@@ -4020,7 +4611,7 @@ export declare abstract class IRtcEngine {
|
|
|
4020
4611
|
/**
|
|
4021
4612
|
* @ignore
|
|
4022
4613
|
*/
|
|
4023
|
-
abstract queryScreenCaptureCapability():
|
|
4614
|
+
abstract queryScreenCaptureCapability(): number;
|
|
4024
4615
|
/**
|
|
4025
4616
|
* Sets the screen sharing scenario.
|
|
4026
4617
|
*
|
|
@@ -4029,34 +4620,39 @@ export declare abstract class IRtcEngine {
|
|
|
4029
4620
|
* @param screenScenario The screen sharing scenario. See ScreenScenarioType.
|
|
4030
4621
|
*
|
|
4031
4622
|
* @returns
|
|
4032
|
-
* 0: Success.
|
|
4623
|
+
* 0: Success.
|
|
4624
|
+
* < 0: Failure.
|
|
4033
4625
|
*/
|
|
4034
4626
|
abstract setScreenCaptureScenario(screenScenario: ScreenScenarioType): number;
|
|
4035
4627
|
/**
|
|
4036
4628
|
* Stops screen capture.
|
|
4037
4629
|
*
|
|
4038
4630
|
* @returns
|
|
4039
|
-
* 0: Success.
|
|
4631
|
+
* 0: Success.
|
|
4632
|
+
* < 0: Failure.
|
|
4040
4633
|
*/
|
|
4041
4634
|
abstract stopScreenCapture(): number;
|
|
4042
4635
|
/**
|
|
4043
4636
|
* Stops screen capture.
|
|
4044
4637
|
*
|
|
4045
|
-
* 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.
|
|
4638
|
+
* 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.
|
|
4639
|
+
* 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.
|
|
4046
4640
|
*
|
|
4047
4641
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4048
4642
|
*
|
|
4049
4643
|
* @returns
|
|
4050
|
-
* 0: Success.
|
|
4644
|
+
* 0: Success.
|
|
4645
|
+
* < 0: Failure.
|
|
4051
4646
|
*/
|
|
4052
4647
|
abstract stopScreenCaptureBySourceType(sourceType: VideoSourceType): number;
|
|
4053
4648
|
/**
|
|
4054
4649
|
* Retrieves the call ID.
|
|
4055
4650
|
*
|
|
4056
|
-
* 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
|
|
4651
|
+
* 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.
|
|
4057
4652
|
*
|
|
4058
4653
|
* @returns
|
|
4059
|
-
* The current call ID, if the method succeeds.
|
|
4654
|
+
* The current call ID, if the method succeeds.
|
|
4655
|
+
* An empty string, if the method call fails.
|
|
4060
4656
|
*/
|
|
4061
4657
|
abstract getCallId(): string;
|
|
4062
4658
|
/**
|
|
@@ -4069,7 +4665,10 @@ export declare abstract class IRtcEngine {
|
|
|
4069
4665
|
* @param description A description of the call. The string length should be less than 800 bytes.
|
|
4070
4666
|
*
|
|
4071
4667
|
* @returns
|
|
4072
|
-
* 0: Success.
|
|
4668
|
+
* 0: Success.
|
|
4669
|
+
* < 0: Failure.
|
|
4670
|
+
* -2 (ERR_INVALID_ARGUMENT).
|
|
4671
|
+
* -3 (ERR_NOT_READY).
|
|
4073
4672
|
*/
|
|
4074
4673
|
abstract rate(callId: string, rating: number, description: string): number;
|
|
4075
4674
|
/**
|
|
@@ -4081,88 +4680,123 @@ export declare abstract class IRtcEngine {
|
|
|
4081
4680
|
* @param description A description of the call. The string length should be less than 800 bytes.
|
|
4082
4681
|
*
|
|
4083
4682
|
* @returns
|
|
4084
|
-
* 0: Success.
|
|
4683
|
+
* 0: Success.
|
|
4684
|
+
* < 0: Failure.
|
|
4685
|
+
* -2: The parameter is invalid.
|
|
4686
|
+
* - 3: The SDK is not ready. Possible reasons include the following:
|
|
4687
|
+
* The initialization of IRtcEngine fails. Reinitialize the IRtcEngine.
|
|
4688
|
+
* No user has joined the channel when the method is called. Please check your code logic.
|
|
4689
|
+
* The user has not left the channel when the rate or complain method is called. Please check your code logic.
|
|
4690
|
+
* The audio module is disabled. The program is not complete.
|
|
4085
4691
|
*/
|
|
4086
4692
|
abstract complain(callId: string, description: string): number;
|
|
4087
4693
|
/**
|
|
4088
4694
|
* Starts pushing media streams to a CDN without transcoding.
|
|
4089
4695
|
*
|
|
4090
|
-
* Ensure that you enable the Media Push service before using this function. See Enable Media Push
|
|
4696
|
+
* Ensure that you enable the Media Push service before using this function. See Enable Media Push.
|
|
4697
|
+
* Call this method after joining a channel.
|
|
4698
|
+
* Only hosts in the LIVE_BROADCASTING profile can call this method.
|
|
4699
|
+
* 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.
|
|
4091
4700
|
*
|
|
4092
4701
|
* @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.
|
|
4093
4702
|
*
|
|
4094
4703
|
* @returns
|
|
4095
|
-
* 0: Success.
|
|
4704
|
+
* 0: Success.
|
|
4705
|
+
* < 0: Failure.
|
|
4706
|
+
* -2: The URL is null or the string length is 0.
|
|
4707
|
+
* -7: The SDK is not initialized before calling this method.
|
|
4708
|
+
* -19: The Media Push URL is already in use, use another URL instead.
|
|
4096
4709
|
*/
|
|
4097
4710
|
abstract startRtmpStreamWithoutTranscoding(url: string): number;
|
|
4098
4711
|
/**
|
|
4099
4712
|
* Starts Media Push and sets the transcoding configuration.
|
|
4100
4713
|
*
|
|
4101
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
4714
|
+
* 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.
|
|
4715
|
+
* Ensure that you enable the Media Push service before using this function. See Enable Media Push.
|
|
4716
|
+
* Call this method after joining a channel.
|
|
4717
|
+
* Only hosts in the LIVE_BROADCASTING profile can call this method.
|
|
4718
|
+
* 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.
|
|
4102
4719
|
*
|
|
4103
4720
|
* @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.
|
|
4104
4721
|
* @param transcoding The transcoding configuration for Media Push. See LiveTranscoding.
|
|
4105
4722
|
*
|
|
4106
4723
|
* @returns
|
|
4107
|
-
* 0: Success.
|
|
4724
|
+
* 0: Success.
|
|
4725
|
+
* < 0: Failure.
|
|
4726
|
+
* -2: The URL is null or the string length is 0.
|
|
4727
|
+
* -7: The SDK is not initialized before calling this method.
|
|
4728
|
+
* -19: The Media Push URL is already in use, use another URL instead.
|
|
4108
4729
|
*/
|
|
4109
4730
|
abstract startRtmpStreamWithTranscoding(url: string, transcoding: LiveTranscoding): number;
|
|
4110
4731
|
/**
|
|
4111
4732
|
* Updates the transcoding configuration.
|
|
4112
4733
|
*
|
|
4113
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
4734
|
+
* 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.
|
|
4114
4735
|
*
|
|
4115
4736
|
* @param transcoding The transcoding configuration for Media Push. See LiveTranscoding.
|
|
4116
4737
|
*
|
|
4117
4738
|
* @returns
|
|
4118
|
-
* 0: Success.
|
|
4739
|
+
* 0: Success.
|
|
4740
|
+
* < 0: Failure.
|
|
4119
4741
|
*/
|
|
4120
4742
|
abstract updateRtmpTranscoding(transcoding: LiveTranscoding): number;
|
|
4121
4743
|
/**
|
|
4122
4744
|
* Stops pushing media streams to a CDN.
|
|
4123
4745
|
*
|
|
4124
|
-
* Agora recommends that you use the server-side Media Push function.
|
|
4746
|
+
* 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.
|
|
4125
4747
|
*
|
|
4126
4748
|
* @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.
|
|
4127
4749
|
*
|
|
4128
4750
|
* @returns
|
|
4129
|
-
* 0: Success.
|
|
4751
|
+
* 0: Success.
|
|
4752
|
+
* < 0: Failure.
|
|
4130
4753
|
*/
|
|
4131
4754
|
abstract stopRtmpStream(url: string): number;
|
|
4132
4755
|
/**
|
|
4133
4756
|
* Starts the local video mixing.
|
|
4134
4757
|
*
|
|
4135
|
-
* 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.
|
|
4758
|
+
* 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.
|
|
4759
|
+
* Local video mixing requires more CPU resources. Therefore, Agora recommends enabling this function on devices with higher performance.
|
|
4760
|
+
* If you need to mix locally captured video streams, the SDK supports the following capture combinations:
|
|
4761
|
+
* On the Windows platform, it supports up to 4 video streams captured by cameras + 4 screen sharing streams.
|
|
4762
|
+
* On the macOS platform, it supports up to 4 video streams captured by cameras + 1 screen sharing stream.
|
|
4763
|
+
* If you need to mix the locally collected video streams, you need to call this method after startCameraCapture or startScreenCaptureBySourceType.
|
|
4764
|
+
* 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.
|
|
4136
4765
|
*
|
|
4137
|
-
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
4766
|
+
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
4767
|
+
* 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.
|
|
4768
|
+
* The maximum resolution of the mixed video stream is 4096 × 2160.
|
|
4138
4769
|
*
|
|
4139
4770
|
* @returns
|
|
4140
|
-
* 0: Success.
|
|
4771
|
+
* 0: Success.
|
|
4772
|
+
* < 0: Failure.
|
|
4141
4773
|
*/
|
|
4142
4774
|
abstract startLocalVideoTranscoder(config: LocalTranscoderConfiguration): number;
|
|
4143
4775
|
/**
|
|
4144
4776
|
* Updates the local video mixing configuration.
|
|
4145
4777
|
*
|
|
4146
|
-
* After calling startLocalVideoTranscoder
|
|
4778
|
+
* 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.
|
|
4147
4779
|
*
|
|
4148
4780
|
* @param config Configuration of the local video mixing, see LocalTranscoderConfiguration.
|
|
4149
4781
|
*
|
|
4150
4782
|
* @returns
|
|
4151
|
-
* 0: Success.
|
|
4783
|
+
* 0: Success.
|
|
4784
|
+
* < 0: Failure.
|
|
4152
4785
|
*/
|
|
4153
4786
|
abstract updateLocalTranscoderConfiguration(config: LocalTranscoderConfiguration): number;
|
|
4154
4787
|
/**
|
|
4155
4788
|
* Stops the local video mixing.
|
|
4156
4789
|
*
|
|
4157
|
-
* After calling startLocalVideoTranscoder
|
|
4790
|
+
* After calling startLocalVideoTranscoder, call this method if you want to stop the local video mixing.
|
|
4158
4791
|
*/
|
|
4159
4792
|
abstract stopLocalVideoTranscoder(): number;
|
|
4160
4793
|
/**
|
|
4161
4794
|
* Starts camera capture.
|
|
4162
4795
|
*
|
|
4163
|
-
* You can call this method to start capturing video from one or more cameras by specifying sourceType
|
|
4796
|
+
* You can call this method to start capturing video from one or more cameras by specifying sourceType.
|
|
4164
4797
|
*
|
|
4165
|
-
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4798
|
+
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4799
|
+
* On the desktop platforms, you can capture video from up to 4 cameras.
|
|
4166
4800
|
* @param config The configuration of the video capture. See CameraCapturerConfiguration.
|
|
4167
4801
|
*/
|
|
4168
4802
|
abstract startCameraCapture(sourceType: VideoSourceType, config: CameraCapturerConfiguration): number;
|
|
@@ -4174,19 +4808,23 @@ export declare abstract class IRtcEngine {
|
|
|
4174
4808
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4175
4809
|
*
|
|
4176
4810
|
* @returns
|
|
4177
|
-
* 0: Success.
|
|
4811
|
+
* 0: Success.
|
|
4812
|
+
* < 0: Failure.
|
|
4178
4813
|
*/
|
|
4179
4814
|
abstract stopCameraCapture(sourceType: VideoSourceType): number;
|
|
4180
4815
|
/**
|
|
4181
4816
|
* Sets the rotation angle of the captured video.
|
|
4182
4817
|
*
|
|
4183
|
-
* This method applies to Windows only.
|
|
4818
|
+
* This method applies to Windows only.
|
|
4819
|
+
* You must call this method after enableVideo. The setting result will take effect after the camera is successfully turned on, that is, after the SDK triggers the onLocalVideoStateChanged callback and returns the local video state as LocalVideoStreamStateCapturing (1).
|
|
4820
|
+
* 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.
|
|
4184
4821
|
*
|
|
4185
4822
|
* @param type The video source type. See VideoSourceType.
|
|
4186
4823
|
* @param orientation The clockwise rotation angle. See VideoOrientation.
|
|
4187
4824
|
*
|
|
4188
4825
|
* @returns
|
|
4189
|
-
* 0: Success.
|
|
4826
|
+
* 0: Success.
|
|
4827
|
+
* < 0: Failure.
|
|
4190
4828
|
*/
|
|
4191
4829
|
abstract setCameraDeviceOrientation(type: VideoSourceType, orientation: VideoOrientation): number;
|
|
4192
4830
|
/**
|
|
@@ -4199,7 +4837,7 @@ export declare abstract class IRtcEngine {
|
|
|
4199
4837
|
* You can call this method either before or after joining a channel.
|
|
4200
4838
|
*
|
|
4201
4839
|
* @returns
|
|
4202
|
-
* The current connection state. See ConnectionStateType
|
|
4840
|
+
* The current connection state. See ConnectionStateType.
|
|
4203
4841
|
*/
|
|
4204
4842
|
abstract getConnectionState(): ConnectionStateType;
|
|
4205
4843
|
/**
|
|
@@ -4232,23 +4870,34 @@ export declare abstract class IRtcEngine {
|
|
|
4232
4870
|
/**
|
|
4233
4871
|
* Sets the built-in encryption mode.
|
|
4234
4872
|
*
|
|
4235
|
-
* 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
|
|
4873
|
+
* 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.
|
|
4236
4874
|
*
|
|
4237
|
-
* @param encryptionMode The following encryption modes:
|
|
4875
|
+
* @param encryptionMode The following encryption modes:
|
|
4876
|
+
* " aes-128-xts ": 128-bit AES encryption, XTS mode.
|
|
4877
|
+
* " aes-128-ecb ": 128-bit AES encryption, ECB mode.
|
|
4878
|
+
* " aes-256-xts ": 256-bit AES encryption, XTS mode.
|
|
4879
|
+
* " sm4-128-ecb ": 128-bit SM4 encryption, ECB mode.
|
|
4880
|
+
* " aes-128-gcm ": 128-bit AES encryption, GCM mode.
|
|
4881
|
+
* " aes-256-gcm ": 256-bit AES encryption, GCM mode.
|
|
4882
|
+
* "": When this parameter is set as null, the encryption mode is set as " aes-128-gcm " by default.
|
|
4238
4883
|
*
|
|
4239
4884
|
* @returns
|
|
4240
|
-
* 0: Success.
|
|
4885
|
+
* 0: Success.
|
|
4886
|
+
* < 0: Failure.
|
|
4241
4887
|
*/
|
|
4242
4888
|
abstract setEncryptionMode(encryptionMode: string): number;
|
|
4243
4889
|
/**
|
|
4244
4890
|
* Enables built-in encryption with an encryption password before users join a channel.
|
|
4245
4891
|
*
|
|
4246
|
-
* 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
|
|
4892
|
+
* 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.
|
|
4893
|
+
* Do not use this method for Media Push.
|
|
4894
|
+
* 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.
|
|
4247
4895
|
*
|
|
4248
4896
|
* @param secret The encryption password.
|
|
4249
4897
|
*
|
|
4250
4898
|
* @returns
|
|
4251
|
-
* 0: Success.
|
|
4899
|
+
* 0: Success.
|
|
4900
|
+
* < 0: Failure.
|
|
4252
4901
|
*/
|
|
4253
4902
|
abstract setEncryptionSecret(secret: string): number;
|
|
4254
4903
|
/**
|
|
@@ -4256,11 +4905,15 @@ export declare abstract class IRtcEngine {
|
|
|
4256
4905
|
*
|
|
4257
4906
|
* 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.
|
|
4258
4907
|
*
|
|
4259
|
-
* @param enabled Whether to enable built-in encryption:true: Enable the built-in encryption.false: Disable the built-in encryption.
|
|
4908
|
+
* @param enabled Whether to enable built-in encryption: true : Enable the built-in encryption. false : Disable the built-in encryption.
|
|
4260
4909
|
* @param config Built-in encryption configurations. See EncryptionConfig.
|
|
4261
4910
|
*
|
|
4262
4911
|
* @returns
|
|
4263
|
-
* 0: Success.
|
|
4912
|
+
* 0: Success.
|
|
4913
|
+
* < 0: Failure.
|
|
4914
|
+
* -2: An invalid parameter is used. Set the parameter with a valid value.
|
|
4915
|
+
* -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.
|
|
4916
|
+
* -7: The SDK is not initialized. Initialize the IRtcEngine instance before calling this method.
|
|
4264
4917
|
*/
|
|
4265
4918
|
abstract enableEncryption(enabled: boolean, config: EncryptionConfig): number;
|
|
4266
4919
|
/**
|
|
@@ -4271,40 +4924,58 @@ export declare abstract class IRtcEngine {
|
|
|
4271
4924
|
* @param config The configurations for the data stream. See DataStreamConfig.
|
|
4272
4925
|
*
|
|
4273
4926
|
* @returns
|
|
4274
|
-
* ID of the created data stream, if the method call succeeds.
|
|
4927
|
+
* ID of the created data stream, if the method call succeeds.
|
|
4928
|
+
* < 0: Failure.
|
|
4275
4929
|
*/
|
|
4276
4930
|
abstract createDataStream(config: DataStreamConfig): number;
|
|
4277
4931
|
/**
|
|
4278
4932
|
* Sends data stream messages.
|
|
4279
4933
|
*
|
|
4280
|
-
* Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
|
|
4281
|
-
*
|
|
4934
|
+
* Sends data stream messages to all users in a channel. The SDK has the following restrictions on this method:
|
|
4935
|
+
* Up to 30 packets can be sent per second in a channel with each packet having a maximum size of 1 KB.
|
|
4936
|
+
* Each client can send up to 6 KB of data per second.
|
|
4937
|
+
* 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.
|
|
4938
|
+
* A failed method call triggers the onStreamMessageError callback on the remote client.
|
|
4939
|
+
* Ensure that you call createDataStream to create a data channel before calling this method.
|
|
4940
|
+
* In live streaming scenarios, this method only applies to hosts.
|
|
4282
4941
|
*
|
|
4283
4942
|
* @param streamId The data stream ID. You can get the data stream ID by calling createDataStream.
|
|
4284
4943
|
* @param data The message to be sent.
|
|
4285
4944
|
* @param length The length of the data.
|
|
4286
4945
|
*
|
|
4287
4946
|
* @returns
|
|
4288
|
-
* 0: Success.
|
|
4947
|
+
* 0: Success.
|
|
4948
|
+
* < 0: Failure.
|
|
4289
4949
|
*/
|
|
4290
4950
|
abstract sendStreamMessage(streamId: number, data: Uint8Array, length: number): number;
|
|
4291
4951
|
/**
|
|
4292
4952
|
* Adds a watermark image to the local video.
|
|
4293
4953
|
*
|
|
4294
|
-
* 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:
|
|
4954
|
+
* 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:
|
|
4955
|
+
* If the orientation mode of the encoding video (OrientationMode) is fixed landscape mode or the adaptive landscape mode, the watermark uses the landscape orientation.
|
|
4956
|
+
* If the orientation mode of the encoding video (OrientationMode) is fixed portrait mode or the adaptive portrait mode, the watermark uses the portrait orientation.
|
|
4957
|
+
* 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.
|
|
4958
|
+
* Ensure that calling this method after enableVideo.
|
|
4959
|
+
* If you only want to add a watermark to the media push, you can call this method or the method.
|
|
4960
|
+
* 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.
|
|
4961
|
+
* 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.
|
|
4962
|
+
* 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.
|
|
4963
|
+
* 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.
|
|
4295
4964
|
*
|
|
4296
4965
|
* @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.
|
|
4297
4966
|
* @param options The options of the watermark image to be added. See WatermarkOptions.
|
|
4298
4967
|
*
|
|
4299
4968
|
* @returns
|
|
4300
|
-
* 0: Success.
|
|
4969
|
+
* 0: Success.
|
|
4970
|
+
* < 0: Failure.
|
|
4301
4971
|
*/
|
|
4302
4972
|
abstract addVideoWatermark(watermarkUrl: string, options: WatermarkOptions): number;
|
|
4303
4973
|
/**
|
|
4304
4974
|
* Removes the watermark image from the video stream.
|
|
4305
4975
|
*
|
|
4306
4976
|
* @returns
|
|
4307
|
-
* 0: Success.
|
|
4977
|
+
* 0: Success.
|
|
4978
|
+
* < 0: Failure.
|
|
4308
4979
|
*/
|
|
4309
4980
|
abstract clearVideoWatermarks(): number;
|
|
4310
4981
|
/**
|
|
@@ -4320,10 +4991,11 @@ export declare abstract class IRtcEngine {
|
|
|
4320
4991
|
*
|
|
4321
4992
|
* 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.
|
|
4322
4993
|
*
|
|
4323
|
-
* @param enabled Whether to enable interoperability:true: Enable interoperability.false: (Default) Disable interoperability.
|
|
4994
|
+
* @param enabled Whether to enable interoperability: true : Enable interoperability. false : (Default) Disable interoperability.
|
|
4324
4995
|
*
|
|
4325
4996
|
* @returns
|
|
4326
|
-
* 0: Success.
|
|
4997
|
+
* 0: Success.
|
|
4998
|
+
* < 0: Failure.
|
|
4327
4999
|
*/
|
|
4328
5000
|
abstract enableWebSdkInteroperability(enabled: boolean): number;
|
|
4329
5001
|
/**
|
|
@@ -4336,13 +5008,14 @@ export declare abstract class IRtcEngine {
|
|
|
4336
5008
|
* Registers the metadata observer.
|
|
4337
5009
|
*
|
|
4338
5010
|
* 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
|
|
4339
|
-
* live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. Call this method before joinChannel
|
|
5011
|
+
* live interactive streaming, such as sending shopping links, digital coupons, and online quizzes. Call this method before joinChannel.
|
|
4340
5012
|
*
|
|
4341
5013
|
* @param observer The metadata observer. See IMetadataObserver.
|
|
4342
5014
|
* @param type The metadata type. The SDK currently only supports VideoMetadata. See MetadataType.
|
|
4343
5015
|
*
|
|
4344
5016
|
* @returns
|
|
4345
|
-
* 0: Success.
|
|
5017
|
+
* 0: Success.
|
|
5018
|
+
* < 0: Failure.
|
|
4346
5019
|
*/
|
|
4347
5020
|
abstract registerMediaMetadataObserver(observer: IMetadataObserver, type: MetadataType): number;
|
|
4348
5021
|
/**
|
|
@@ -4352,7 +5025,8 @@ export declare abstract class IRtcEngine {
|
|
|
4352
5025
|
* @param type The metadata type. The SDK currently only supports VideoMetadata. See MetadataType.
|
|
4353
5026
|
*
|
|
4354
5027
|
* @returns
|
|
4355
|
-
* 0: Success.
|
|
5028
|
+
* 0: Success.
|
|
5029
|
+
* < 0: Failure.
|
|
4356
5030
|
*/
|
|
4357
5031
|
abstract unregisterMediaMetadataObserver(observer: IMetadataObserver, type: MetadataType): number;
|
|
4358
5032
|
/**
|
|
@@ -4366,58 +5040,104 @@ export declare abstract class IRtcEngine {
|
|
|
4366
5040
|
/**
|
|
4367
5041
|
* Sets whether to enable the AI noise suppression function and set the noise suppression mode.
|
|
4368
5042
|
*
|
|
4369
|
-
* 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:
|
|
5043
|
+
* 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:
|
|
5044
|
+
* Television;
|
|
5045
|
+
* Air conditioner;
|
|
5046
|
+
* 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:
|
|
5047
|
+
* Thunder;
|
|
5048
|
+
* Explosion;
|
|
5049
|
+
* Cracking, etc.
|
|
4370
5050
|
*
|
|
4371
|
-
* @param enabled Whether to enable the AI noise suppression function:true: Enable the AI noise suppression.false: (Default) Disable the AI noise suppression.
|
|
5051
|
+
* @param enabled Whether to enable the AI noise suppression function: true : Enable the AI noise suppression. false : (Default) Disable the AI noise suppression.
|
|
4372
5052
|
* @param mode The AI noise suppression modes. See AudioAinsMode.
|
|
4373
5053
|
*
|
|
4374
5054
|
* @returns
|
|
4375
|
-
* 0: Success.
|
|
5055
|
+
* 0: Success.
|
|
5056
|
+
* < 0: Failure.
|
|
4376
5057
|
*/
|
|
4377
5058
|
abstract setAINSMode(enabled: boolean, mode: AudioAinsMode): number;
|
|
4378
5059
|
/**
|
|
4379
5060
|
* Registers a user account.
|
|
4380
5061
|
*
|
|
4381
|
-
* 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:
|
|
5062
|
+
* 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:
|
|
5063
|
+
* Call registerLocalUserAccount to create a user account, and then call joinChannelWithUserAccount to join the channel.
|
|
5064
|
+
* 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.
|
|
5065
|
+
* Ensure that you set the userAccount parameter; otherwise, this method does not take effect.
|
|
5066
|
+
* Ensure that the userAccount is unique in the channel.
|
|
5067
|
+
* 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.
|
|
4382
5068
|
*
|
|
4383
5069
|
* @param appId The App ID of your project on Agora Console.
|
|
4384
|
-
* @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):
|
|
5070
|
+
* @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):
|
|
5071
|
+
* The 26 lowercase English letters: a to z.
|
|
5072
|
+
* The 26 uppercase English letters: A to Z.
|
|
5073
|
+
* All numeric characters: 0 to 9.
|
|
5074
|
+
* Space
|
|
5075
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
4385
5076
|
*
|
|
4386
5077
|
* @returns
|
|
4387
|
-
* 0: Success.
|
|
5078
|
+
* 0: Success.
|
|
5079
|
+
* < 0: Failure.
|
|
4388
5080
|
*/
|
|
4389
5081
|
abstract registerLocalUserAccount(appId: string, userAccount: string): number;
|
|
4390
5082
|
/**
|
|
4391
5083
|
* Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
|
|
4392
5084
|
*
|
|
4393
|
-
* 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:
|
|
5085
|
+
* 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:
|
|
5086
|
+
* The local client: onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
5087
|
+
* 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.
|
|
4394
5088
|
*
|
|
4395
5089
|
* @param token The token generated on your server for authentication.
|
|
4396
|
-
* @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:
|
|
4397
|
-
*
|
|
5090
|
+
* @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:
|
|
5091
|
+
* All lowercase English letters: a to z.
|
|
5092
|
+
* All uppercase English letters: A to Z.
|
|
5093
|
+
* All numeric characters: 0 to 9.
|
|
5094
|
+
* Space
|
|
5095
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
5096
|
+
* @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):
|
|
5097
|
+
* The 26 lowercase English letters: a to z.
|
|
5098
|
+
* The 26 uppercase English letters: A to Z.
|
|
5099
|
+
* All numeric characters: 0 to 9.
|
|
5100
|
+
* Space
|
|
5101
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
4398
5102
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
4399
5103
|
*
|
|
4400
5104
|
* @returns
|
|
4401
|
-
* 0: Success.
|
|
5105
|
+
* 0: Success.
|
|
5106
|
+
* < 0: Failure.
|
|
5107
|
+
* -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.
|
|
5108
|
+
* -3: Failes to initialize the IRtcEngine object. You need to reinitialize the IRtcEngine object.
|
|
5109
|
+
* -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method.
|
|
5110
|
+
* -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.
|
|
5111
|
+
* -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.
|
|
5112
|
+
* -102: The channel name is invalid. You need to pass in a valid channelname in channelId to rejoin the channel.
|
|
5113
|
+
* -121: The user ID is invalid. You need to pass in a valid user ID in uid to rejoin the channel.
|
|
4402
5114
|
*/
|
|
4403
5115
|
abstract joinChannelWithUserAccount(token: string, channelId: string, userAccount: string, options?: ChannelMediaOptions): number;
|
|
4404
5116
|
/**
|
|
4405
5117
|
* Joins the channel with a user account, and configures whether to automatically subscribe to audio or video streams after joining the channel.
|
|
4406
5118
|
*
|
|
4407
|
-
* 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:
|
|
5119
|
+
* 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:
|
|
5120
|
+
* The local client: onLocalUserRegistered, onJoinChannelSuccess and onConnectionStateChanged callbacks.
|
|
5121
|
+
* 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.
|
|
4408
5122
|
*
|
|
4409
5123
|
* @param token The token generated on your server for authentication.
|
|
4410
|
-
* @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:
|
|
5124
|
+
* @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:
|
|
5125
|
+
* All lowercase English letters: a to z.
|
|
5126
|
+
* All uppercase English letters: A to Z.
|
|
5127
|
+
* All numeric characters: 0 to 9.
|
|
5128
|
+
* Space
|
|
5129
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
4411
5130
|
* @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):
|
|
4412
5131
|
* The 26 lowercase English letters: a to z.
|
|
4413
5132
|
* The 26 uppercase English letters: A to Z.
|
|
4414
5133
|
* All numeric characters: 0 to 9.
|
|
4415
5134
|
* Space
|
|
4416
|
-
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=
|
|
5135
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
4417
5136
|
* @param options The channel media options. See ChannelMediaOptions.
|
|
4418
5137
|
*
|
|
4419
5138
|
* @returns
|
|
4420
|
-
* 0: Success.
|
|
5139
|
+
* 0: Success.
|
|
5140
|
+
* < 0: Failure.
|
|
4421
5141
|
*/
|
|
4422
5142
|
abstract joinChannelWithUserAccountEx(token: string, channelId: string, userAccount: string, options: ChannelMediaOptions): number;
|
|
4423
5143
|
/**
|
|
@@ -4428,7 +5148,8 @@ export declare abstract class IRtcEngine {
|
|
|
4428
5148
|
* @param userAccount The user account.
|
|
4429
5149
|
*
|
|
4430
5150
|
* @returns
|
|
4431
|
-
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
5151
|
+
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
5152
|
+
* If the call fails, returns NULL.
|
|
4432
5153
|
*/
|
|
4433
5154
|
abstract getUserInfoByUserAccount(userAccount: string): UserInfo;
|
|
4434
5155
|
/**
|
|
@@ -4439,40 +5160,65 @@ export declare abstract class IRtcEngine {
|
|
|
4439
5160
|
* @param uid The user ID.
|
|
4440
5161
|
*
|
|
4441
5162
|
* @returns
|
|
4442
|
-
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
5163
|
+
* A pointer to the UserInfo instance, if the method call succeeds.
|
|
5164
|
+
* If the call fails, returns NULL.
|
|
4443
5165
|
*/
|
|
4444
5166
|
abstract getUserInfoByUid(uid: number): UserInfo;
|
|
4445
5167
|
/**
|
|
4446
5168
|
* Starts relaying media streams across channels or updates channels for media relay.
|
|
4447
5169
|
*
|
|
4448
|
-
* 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:
|
|
5170
|
+
* 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:
|
|
5171
|
+
* 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.
|
|
5172
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
|
|
5173
|
+
* Call this method after joining the channel.
|
|
5174
|
+
* This method takes effect only when you are a host in a live streaming channel.
|
|
5175
|
+
* The relaying media streams across channels function needs to be enabled by contacting.
|
|
5176
|
+
* Agora does not support string user accounts in this API.
|
|
4449
5177
|
*
|
|
4450
5178
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
4451
5179
|
*
|
|
4452
5180
|
* @returns
|
|
4453
|
-
* 0: Success.
|
|
5181
|
+
* 0: Success.
|
|
5182
|
+
* < 0: Failure.
|
|
5183
|
+
* -1: A general error occurs (no specified reason).
|
|
5184
|
+
* -2: The parameter is invalid.
|
|
5185
|
+
* -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.
|
|
5186
|
+
* -8: Internal state error. Probably because the user is not a broadcaster.
|
|
4454
5187
|
*/
|
|
4455
5188
|
abstract startOrUpdateChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): number;
|
|
4456
5189
|
/**
|
|
4457
5190
|
* Starts relaying media streams across channels. This method can be used to implement scenarios such as co-host across channels.
|
|
4458
5191
|
*
|
|
4459
|
-
* 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.
|
|
5192
|
+
* 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.
|
|
5193
|
+
* 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.
|
|
5194
|
+
* If the onChannelMediaRelayStateChanged callback returns RelayStateFailure (3), an exception occurs during the media stream relay.
|
|
5195
|
+
* Call this method after joining the channel.
|
|
5196
|
+
* This method takes effect only when you are a host in a live streaming channel.
|
|
5197
|
+
* 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.
|
|
5198
|
+
* The relaying media streams across channels function needs to be enabled by contacting.
|
|
5199
|
+
* Agora does not support string user accounts in this API.
|
|
4460
5200
|
*
|
|
4461
5201
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
4462
5202
|
*
|
|
4463
5203
|
* @returns
|
|
4464
|
-
* 0: Success.
|
|
5204
|
+
* 0: Success.
|
|
5205
|
+
* < 0: Failure.
|
|
5206
|
+
* -1: A general error occurs (no specified reason).
|
|
5207
|
+
* -2: The parameter is invalid.
|
|
5208
|
+
* -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.
|
|
5209
|
+
* -8: Internal state error. Probably because the user is not a broadcaster.
|
|
4465
5210
|
*/
|
|
4466
5211
|
abstract startChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): number;
|
|
4467
5212
|
/**
|
|
4468
5213
|
* Updates the channels for media stream relay.
|
|
4469
5214
|
*
|
|
4470
|
-
* 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 (
|
|
5215
|
+
* 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.
|
|
4471
5216
|
*
|
|
4472
5217
|
* @param configuration The configuration of the media stream relay. See ChannelMediaRelayConfiguration.
|
|
4473
5218
|
*
|
|
4474
5219
|
* @returns
|
|
4475
|
-
* 0: Success.
|
|
5220
|
+
* 0: Success.
|
|
5221
|
+
* < 0: Failure.
|
|
4476
5222
|
*/
|
|
4477
5223
|
abstract updateChannelMediaRelay(configuration: ChannelMediaRelayConfiguration): number;
|
|
4478
5224
|
/**
|
|
@@ -4481,25 +5227,28 @@ export declare abstract class IRtcEngine {
|
|
|
4481
5227
|
* 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.
|
|
4482
5228
|
*
|
|
4483
5229
|
* @returns
|
|
4484
|
-
* 0: Success.
|
|
5230
|
+
* 0: Success.
|
|
5231
|
+
* < 0: Failure.
|
|
4485
5232
|
*/
|
|
4486
5233
|
abstract stopChannelMediaRelay(): number;
|
|
4487
5234
|
/**
|
|
4488
5235
|
* Pauses the media stream relay to all target channels.
|
|
4489
5236
|
*
|
|
4490
|
-
* 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
|
|
5237
|
+
* 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.
|
|
4491
5238
|
*
|
|
4492
5239
|
* @returns
|
|
4493
|
-
* 0: Success.
|
|
5240
|
+
* 0: Success.
|
|
5241
|
+
* < 0: Failure.
|
|
4494
5242
|
*/
|
|
4495
5243
|
abstract pauseAllChannelMediaRelay(): number;
|
|
4496
5244
|
/**
|
|
4497
5245
|
* Resumes the media stream relay to all target channels.
|
|
4498
5246
|
*
|
|
4499
|
-
* After calling the pauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels. Call this method after pauseAllChannelMediaRelay
|
|
5247
|
+
* After calling the pauseAllChannelMediaRelay method, you can call this method to resume relaying media streams to all destination channels. Call this method after pauseAllChannelMediaRelay.
|
|
4500
5248
|
*
|
|
4501
5249
|
* @returns
|
|
4502
|
-
* 0: Success.
|
|
5250
|
+
* 0: Success.
|
|
5251
|
+
* < 0: Failure.
|
|
4503
5252
|
*/
|
|
4504
5253
|
abstract resumeAllChannelMediaRelay(): number;
|
|
4505
5254
|
/**
|
|
@@ -4516,30 +5265,33 @@ export declare abstract class IRtcEngine {
|
|
|
4516
5265
|
*
|
|
4517
5266
|
* 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.
|
|
4518
5267
|
*
|
|
4519
|
-
* @param config Video profile. See VideoEncoderConfiguration.During CDN live streaming, Agora only supports setting OrientationMode as OrientationFixedLandscape or OrientationFixedPortrait.
|
|
5268
|
+
* @param config Video profile. See VideoEncoderConfiguration. During CDN live streaming, Agora only supports setting OrientationMode as OrientationFixedLandscape or OrientationFixedPortrait.
|
|
4520
5269
|
*
|
|
4521
5270
|
* @returns
|
|
4522
|
-
* 0: Success.
|
|
5271
|
+
* 0: Success.
|
|
5272
|
+
* < 0: Failure.
|
|
4523
5273
|
*/
|
|
4524
5274
|
abstract setDirectCdnStreamingVideoConfiguration(config: VideoEncoderConfiguration): number;
|
|
4525
5275
|
/**
|
|
4526
5276
|
* Starts pushing media streams to the CDN directly.
|
|
4527
5277
|
*
|
|
4528
|
-
* 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
|
|
5278
|
+
* 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.
|
|
4529
5279
|
*
|
|
4530
5280
|
* @param eventHandler See onDirectCdnStreamingStateChanged and onDirectCdnStreamingStats.
|
|
4531
5281
|
* @param publishUrl The CDN live streaming URL.
|
|
4532
5282
|
* @param options The media setting options for the host. See DirectCdnStreamingMediaOptions.
|
|
4533
5283
|
*
|
|
4534
5284
|
* @returns
|
|
4535
|
-
* 0: Success.
|
|
5285
|
+
* 0: Success.
|
|
5286
|
+
* < 0: Failure.
|
|
4536
5287
|
*/
|
|
4537
5288
|
abstract startDirectCdnStreaming(eventHandler: IDirectCdnStreamingEventHandler, publishUrl: string, options: DirectCdnStreamingMediaOptions): number;
|
|
4538
5289
|
/**
|
|
4539
5290
|
* Stops pushing media streams to the CDN directly.
|
|
4540
5291
|
*
|
|
4541
5292
|
* @returns
|
|
4542
|
-
* 0: Success.
|
|
5293
|
+
* 0: Success.
|
|
5294
|
+
* < 0: Failure.
|
|
4543
5295
|
*/
|
|
4544
5296
|
abstract stopDirectCdnStreaming(): number;
|
|
4545
5297
|
/**
|
|
@@ -4561,37 +5313,46 @@ export declare abstract class IRtcEngine {
|
|
|
4561
5313
|
/**
|
|
4562
5314
|
* Takes a snapshot of a video stream.
|
|
4563
5315
|
*
|
|
4564
|
-
* 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.
|
|
5316
|
+
* 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.
|
|
5317
|
+
* Call this method after joining a channel.
|
|
5318
|
+
* When used for local video snapshots, this method takes a snapshot for the video streams specified in ChannelMediaOptions.
|
|
5319
|
+
* If the user's video has been preprocessed, for example, watermarked or beautified, the resulting snapshot includes the pre-processing effect.
|
|
4565
5320
|
*
|
|
4566
5321
|
* @param uid The user ID. Set uid as 0 if you want to take a snapshot of the local user's video.
|
|
4567
|
-
* @param filePath The local path (including filename extensions) of the snapshot. For example:
|
|
5322
|
+
* @param filePath The local path (including filename extensions) of the snapshot. For example:
|
|
5323
|
+
* Windows: C:\Users\<user_name>\AppData\Local\Agora\<process_name>\example.jpg
|
|
5324
|
+
* macOS: ~/Library/Logs/example.jpg Ensure that the path you specify exists and is writable.
|
|
4568
5325
|
*
|
|
4569
5326
|
* @returns
|
|
4570
|
-
* 0: Success.
|
|
5327
|
+
* 0: Success.
|
|
5328
|
+
* < 0: Failure.
|
|
4571
5329
|
*/
|
|
4572
5330
|
abstract takeSnapshot(uid: number, filePath: string): number;
|
|
4573
5331
|
/**
|
|
4574
5332
|
* Enables or disables video screenshot and upload.
|
|
4575
5333
|
*
|
|
4576
|
-
* 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
|
|
5334
|
+
* 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.
|
|
5335
|
+
* 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.
|
|
4577
5336
|
*
|
|
4578
|
-
* @param enabled Whether to enable video screenshot and
|
|
5337
|
+
* @param enabled Whether to enable video screenshot and upload : true : Enables video screenshot and upload. false : Disables video screenshot and upload.
|
|
4579
5338
|
* @param config Configuration of video screenshot and upload. See ContentInspectConfig.
|
|
4580
5339
|
*
|
|
4581
5340
|
* @returns
|
|
4582
|
-
* 0: Success.
|
|
5341
|
+
* 0: Success.
|
|
5342
|
+
* < 0: Failure.
|
|
4583
5343
|
*/
|
|
4584
5344
|
abstract enableContentInspect(enabled: boolean, config: ContentInspectConfig): number;
|
|
4585
5345
|
/**
|
|
4586
|
-
* Adjusts the volume of the custom
|
|
5346
|
+
* Adjusts the volume of the custom audio track played remotely.
|
|
4587
5347
|
*
|
|
4588
|
-
* Ensure you have called the createCustomAudioTrack method to create
|
|
5348
|
+
* Ensure you have called the createCustomAudioTrack method to create a custom audio track before calling this method. If you want to change the volume of the audio to be published, you need to call this method again.
|
|
4589
5349
|
*
|
|
4590
5350
|
* @param trackId The audio track ID. Set this parameter to the custom audio track ID returned in createCustomAudioTrack.
|
|
4591
5351
|
* @param volume The volume of the audio source. The value can range from 0 to 100. 0 means mute; 100 means the original volume.
|
|
4592
5352
|
*
|
|
4593
5353
|
* @returns
|
|
4594
|
-
* 0: Success.
|
|
5354
|
+
* 0: Success.
|
|
5355
|
+
* < 0: Failure.
|
|
4595
5356
|
*/
|
|
4596
5357
|
abstract adjustCustomAudioPublishVolume(trackId: number, volume: number): number;
|
|
4597
5358
|
/**
|
|
@@ -4601,12 +5362,18 @@ export declare abstract class IRtcEngine {
|
|
|
4601
5362
|
/**
|
|
4602
5363
|
* Sets up cloud proxy service.
|
|
4603
5364
|
*
|
|
4604
|
-
* 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 (
|
|
5365
|
+
* 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.
|
|
5366
|
+
* Agora recommends that you call this method after joining a channel.
|
|
5367
|
+
* 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.
|
|
5368
|
+
* 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.
|
|
4605
5369
|
*
|
|
4606
|
-
* @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.
|
|
5370
|
+
* @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.
|
|
4607
5371
|
*
|
|
4608
5372
|
* @returns
|
|
4609
|
-
* 0: Success.
|
|
5373
|
+
* 0: Success.
|
|
5374
|
+
* < 0: Failure.
|
|
5375
|
+
* -2: The parameter is invalid.
|
|
5376
|
+
* -7: The SDK is not initialized.
|
|
4610
5377
|
*/
|
|
4611
5378
|
abstract setCloudProxy(proxyType: CloudProxyType): number;
|
|
4612
5379
|
/**
|
|
@@ -4616,12 +5383,13 @@ export declare abstract class IRtcEngine {
|
|
|
4616
5383
|
/**
|
|
4617
5384
|
* Sets audio advanced options.
|
|
4618
5385
|
*
|
|
4619
|
-
* 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
|
|
5386
|
+
* 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.
|
|
4620
5387
|
*
|
|
4621
5388
|
* @param options The advanced options for audio. See AdvancedAudioOptions.
|
|
4622
5389
|
*
|
|
4623
5390
|
* @returns
|
|
4624
|
-
* 0: Success.
|
|
5391
|
+
* 0: Success.
|
|
5392
|
+
* < 0: Failure.
|
|
4625
5393
|
*/
|
|
4626
5394
|
abstract setAdvancedAudioOptions(options: AdvancedAudioOptions, sourceType?: number): number;
|
|
4627
5395
|
/**
|
|
@@ -4633,20 +5401,22 @@ export declare abstract class IRtcEngine {
|
|
|
4633
5401
|
*
|
|
4634
5402
|
* 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.
|
|
4635
5403
|
*
|
|
4636
|
-
* @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.
|
|
5404
|
+
* @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.
|
|
4637
5405
|
* @param options Image configurations. See ImageTrackOptions.
|
|
4638
5406
|
*
|
|
4639
5407
|
* @returns
|
|
4640
|
-
* 0: Success.
|
|
5408
|
+
* 0: Success.
|
|
5409
|
+
* < 0: Failure.
|
|
4641
5410
|
*/
|
|
4642
5411
|
abstract enableVideoImageSource(enable: boolean, options: ImageTrackOptions): number;
|
|
4643
5412
|
/**
|
|
4644
5413
|
* Gets the current Monotonic Time of the SDK.
|
|
4645
5414
|
*
|
|
4646
|
-
* 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 (
|
|
5415
|
+
* 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).
|
|
4647
5416
|
*
|
|
4648
5417
|
* @returns
|
|
4649
|
-
* ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
|
|
5418
|
+
* ≥0: The method call is successful, and returns the current Monotonic Time of the SDK (in milliseconds).
|
|
5419
|
+
* < 0: Failure.
|
|
4650
5420
|
*/
|
|
4651
5421
|
abstract getCurrentMonotonicTimeInMs(): number;
|
|
4652
5422
|
/**
|
|
@@ -4659,34 +5429,52 @@ export declare abstract class IRtcEngine {
|
|
|
4659
5429
|
* 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.
|
|
4660
5430
|
*
|
|
4661
5431
|
* @returns
|
|
4662
|
-
* ≥ 0: The method call is successful, and the local network connection type is returned.
|
|
5432
|
+
* ≥ 0: The method call is successful, and the local network connection type is returned.
|
|
5433
|
+
* 0: The SDK disconnects from the network.
|
|
5434
|
+
* 1: The network type is LAN.
|
|
5435
|
+
* 2: The network type is Wi-Fi (including hotspots).
|
|
5436
|
+
* 3: The network type is mobile 2G.
|
|
5437
|
+
* 4: The network type is mobile 3G.
|
|
5438
|
+
* 5: The network type is mobile 4G.
|
|
5439
|
+
* 6: The network type is mobile 5G.
|
|
5440
|
+
* < 0: The method call failed with an error code.
|
|
5441
|
+
* -1: The network type is unknown.
|
|
4663
5442
|
*/
|
|
4664
|
-
abstract getNetworkType():
|
|
5443
|
+
abstract getNetworkType(): number;
|
|
4665
5444
|
/**
|
|
4666
5445
|
* Provides technical preview functionalities or special customizations by configuring the SDK with JSON options.
|
|
4667
5446
|
*
|
|
4668
5447
|
* @param parameters Pointer to the set parameters in a JSON string.
|
|
4669
5448
|
*
|
|
4670
5449
|
* @returns
|
|
4671
|
-
* 0: Success.
|
|
5450
|
+
* 0: Success.
|
|
5451
|
+
* < 0: Failure.
|
|
4672
5452
|
*/
|
|
4673
5453
|
abstract setParameters(parameters: string): number;
|
|
4674
5454
|
/**
|
|
4675
5455
|
* Enables tracing the video frame rendering process.
|
|
4676
5456
|
*
|
|
4677
|
-
* 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.
|
|
5457
|
+
* 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.
|
|
5458
|
+
* 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.
|
|
5459
|
+
* 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.
|
|
4678
5460
|
*
|
|
4679
5461
|
* @returns
|
|
4680
|
-
* 0: Success.
|
|
5462
|
+
* 0: Success.
|
|
5463
|
+
* < 0: Failure.
|
|
5464
|
+
* -7: The method is called before IRtcEngine is initialized.
|
|
4681
5465
|
*/
|
|
4682
5466
|
abstract startMediaRenderingTracing(): number;
|
|
4683
5467
|
/**
|
|
4684
5468
|
* Enables audio and video frame instant rendering.
|
|
4685
5469
|
*
|
|
4686
|
-
* 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.
|
|
5470
|
+
* 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.
|
|
5471
|
+
* Once the instant rendering function is enabled, it can only be canceled by calling the release method to destroy the IRtcEngine object.
|
|
5472
|
+
* 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.
|
|
4687
5473
|
*
|
|
4688
5474
|
* @returns
|
|
4689
|
-
* 0: Success.
|
|
5475
|
+
* 0: Success.
|
|
5476
|
+
* < 0: Failure.
|
|
5477
|
+
* -7: The method is called before IRtcEngine is initialized.
|
|
4690
5478
|
*/
|
|
4691
5479
|
abstract enableInstantMediaRendering(): number;
|
|
4692
5480
|
/**
|
|
@@ -4746,18 +5534,20 @@ export declare abstract class IRtcEngine {
|
|
|
4746
5534
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4747
5535
|
*
|
|
4748
5536
|
* @returns
|
|
4749
|
-
* 0: Success.
|
|
5537
|
+
* 0: Success.
|
|
5538
|
+
* < 0: Failure.
|
|
4750
5539
|
*/
|
|
4751
5540
|
abstract sendMetaData(metadata: Metadata, sourceType: VideoSourceType): number;
|
|
4752
5541
|
/**
|
|
4753
5542
|
* Sets the maximum size of the media metadata.
|
|
4754
5543
|
*
|
|
4755
|
-
* After calling registerMediaMetadataObserver
|
|
5544
|
+
* After calling registerMediaMetadataObserver, you can call this method to set the maximum size of the media metadata.
|
|
4756
5545
|
*
|
|
4757
5546
|
* @param size The maximum size of media metadata.
|
|
4758
5547
|
*
|
|
4759
5548
|
* @returns
|
|
4760
|
-
* 0: Success.
|
|
5549
|
+
* 0: Success.
|
|
5550
|
+
* < 0: Failure.
|
|
4761
5551
|
*/
|
|
4762
5552
|
abstract setMaxMetadataSize(size: number): number;
|
|
4763
5553
|
/**
|
|
@@ -4770,7 +5560,12 @@ export declare abstract class IRtcEngine {
|
|
|
4770
5560
|
* Destroys multiple video renderer objects at one time.
|
|
4771
5561
|
*
|
|
4772
5562
|
* @param sourceType The type of the video source. See VideoSourceType.
|
|
4773
|
-
* @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:
|
|
5563
|
+
* @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:
|
|
5564
|
+
* All lowercase English letters: a to z.
|
|
5565
|
+
* All uppercase English letters: A to Z.
|
|
5566
|
+
* All numeric characters: 0 to 9.
|
|
5567
|
+
* Space
|
|
5568
|
+
* "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", ","
|
|
4774
5569
|
* @param uid The user ID of the remote user.
|
|
4775
5570
|
*/
|
|
4776
5571
|
abstract destroyRendererByConfig(sourceType: VideoSourceType, channelId?: string, uid?: number): void;
|
|
@@ -4780,7 +5575,8 @@ export declare abstract class IRtcEngine {
|
|
|
4780
5575
|
* @param observer The encoded audio observer. See IAudioEncodedFrameObserver.
|
|
4781
5576
|
*
|
|
4782
5577
|
* @returns
|
|
4783
|
-
* 0: Success.
|
|
5578
|
+
* 0: Success.
|
|
5579
|
+
* < 0: Failure.
|
|
4784
5580
|
*/
|
|
4785
5581
|
abstract unregisterAudioEncodedFrameObserver(observer: IAudioEncodedFrameObserver): number;
|
|
4786
5582
|
/**
|
|
@@ -4892,15 +5688,15 @@ export declare enum VideoProfileType {
|
|
|
4892
5688
|
*/
|
|
4893
5689
|
VideoProfileLandscape360p8 = 37,
|
|
4894
5690
|
/**
|
|
4895
|
-
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
5691
|
+
* 38: 640 × 360, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
4896
5692
|
*/
|
|
4897
5693
|
VideoProfileLandscape360p9 = 38,
|
|
4898
5694
|
/**
|
|
4899
|
-
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
5695
|
+
* 39: 640 × 360, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
4900
5696
|
*/
|
|
4901
5697
|
VideoProfileLandscape360p10 = 39,
|
|
4902
5698
|
/**
|
|
4903
|
-
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
5699
|
+
* 100: 640 × 360, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
4904
5700
|
*/
|
|
4905
5701
|
VideoProfileLandscape360p11 = 100,
|
|
4906
5702
|
/**
|
|
@@ -5032,15 +5828,15 @@ export declare enum VideoProfileType {
|
|
|
5032
5828
|
*/
|
|
5033
5829
|
VideoProfilePortrait360p8 = 1037,
|
|
5034
5830
|
/**
|
|
5035
|
-
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
5831
|
+
* 1038: 360 × 640, frame rate 15 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
5036
5832
|
*/
|
|
5037
5833
|
VideoProfilePortrait360p9 = 1038,
|
|
5038
5834
|
/**
|
|
5039
|
-
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps.This profile applies only to the live streaming channel profile.
|
|
5835
|
+
* 1039: 360 × 640, frame rate 24 fps, bitrate 800 Kbps. This profile applies only to the live streaming channel profile.
|
|
5040
5836
|
*/
|
|
5041
5837
|
VideoProfilePortrait360p10 = 1039,
|
|
5042
5838
|
/**
|
|
5043
|
-
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps.This profile applies only to the live streaming channel profile.
|
|
5839
|
+
* 1100: 360 × 640, frame rate 24 fps, bitrate 1000 Kbps. This profile applies only to the live streaming channel profile.
|
|
5044
5840
|
*/
|
|
5045
5841
|
VideoProfilePortrait360p11 = 1100,
|
|
5046
5842
|
/**
|