diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml index c231ecda..4cb55bc4 100644 --- a/.github/workflows/gitleaks.yml +++ b/.github/workflows/gitleaks.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: gitleaks/gitleaks-action@v2 + - uses: gitleaks/gitleaks-action@v2.3.4 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} GITLEAKS_LICENSE: ${{ secrets.GITLEAKS_LICENSE }} # Only required for Organizations, not personal accounts. diff --git a/android/build.gradle b/android/build.gradle index c4f250aa..1cde02fa 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -164,9 +164,9 @@ dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs') - api 'io.agora.rtc:full-sdk:4.3.1' - implementation 'io.agora.rtc:full-screen-sharing:4.3.1' - implementation 'io.agora.rtc:iris-rtc:4.3.1-build.1' + api 'io.agora.rtc:full-sdk:4.3.2' + implementation 'io.agora.rtc:full-screen-sharing:4.3.2' + implementation 'io.agora.rtc:iris-rtc:4.3.2-build.1' } if (isNewArchitectureEnabled()) { diff --git a/example/Gemfile.lock b/example/Gemfile.lock index e13d9d25..49267653 100644 --- a/example/Gemfile.lock +++ b/example/Gemfile.lock @@ -71,8 +71,10 @@ GEM nap (1.1.0) netrc (0.11.0) public_suffix (4.0.7) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) ruby-macho (2.5.1) + strscan (3.1.0) typhoeus (1.4.0) ethon (>= 0.9.0) tzinfo (2.0.6) diff --git a/example/ios/Podfile b/example/ios/Podfile index 76e338e6..9a763124 100644 --- a/example/ios/Podfile +++ b/example/ios/Podfile @@ -62,5 +62,5 @@ target 'AgoraRtcNgExample' do end target 'ScreenShare' do - pod 'AgoraRtcEngine_iOS', '4.3.1' + pod 'AgoraRtcEngine_iOS', '4.3.2' end diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 7fc7a031..35a7d095 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -1,40 +1,40 @@ PODS: - - AgoraIrisRTC_iOS (4.3.1-build.1) - - AgoraRtcEngine_iOS (4.3.1): - - AgoraRtcEngine_iOS/AIAEC (= 4.3.1) - - AgoraRtcEngine_iOS/AINS (= 4.3.1) - - AgoraRtcEngine_iOS/AudioBeauty (= 4.3.1) - - AgoraRtcEngine_iOS/ClearVision (= 4.3.1) - - AgoraRtcEngine_iOS/ContentInspect (= 4.3.1) - - AgoraRtcEngine_iOS/FaceCapture (= 4.3.1) - - AgoraRtcEngine_iOS/FaceDetection (= 4.3.1) - - AgoraRtcEngine_iOS/LipSync (= 4.3.1) - - AgoraRtcEngine_iOS/ReplayKit (= 4.3.1) - - AgoraRtcEngine_iOS/RtcBasic (= 4.3.1) - - AgoraRtcEngine_iOS/SpatialAudio (= 4.3.1) - - AgoraRtcEngine_iOS/VideoAv1CodecDec (= 4.3.1) - - AgoraRtcEngine_iOS/VideoAv1CodecEnc (= 4.3.1) - - AgoraRtcEngine_iOS/VideoCodecDec (= 4.3.1) - - AgoraRtcEngine_iOS/VideoCodecEnc (= 4.3.1) - - AgoraRtcEngine_iOS/VirtualBackground (= 4.3.1) - - AgoraRtcEngine_iOS/VQA (= 4.3.1) - - AgoraRtcEngine_iOS/AIAEC (4.3.1) - - AgoraRtcEngine_iOS/AINS (4.3.1) - - AgoraRtcEngine_iOS/AudioBeauty (4.3.1) - - AgoraRtcEngine_iOS/ClearVision (4.3.1) - - AgoraRtcEngine_iOS/ContentInspect (4.3.1) - - AgoraRtcEngine_iOS/FaceCapture (4.3.1) - - AgoraRtcEngine_iOS/FaceDetection (4.3.1) - - AgoraRtcEngine_iOS/LipSync (4.3.1) - - AgoraRtcEngine_iOS/ReplayKit (4.3.1) - - AgoraRtcEngine_iOS/RtcBasic (4.3.1) - - AgoraRtcEngine_iOS/SpatialAudio (4.3.1) - - AgoraRtcEngine_iOS/VideoAv1CodecDec (4.3.1) - - AgoraRtcEngine_iOS/VideoAv1CodecEnc (4.3.1) - - AgoraRtcEngine_iOS/VideoCodecDec (4.3.1) - - AgoraRtcEngine_iOS/VideoCodecEnc (4.3.1) - - AgoraRtcEngine_iOS/VirtualBackground (4.3.1) - - AgoraRtcEngine_iOS/VQA (4.3.1) + - AgoraIrisRTC_iOS (4.3.2-build.1) + - AgoraRtcEngine_iOS (4.3.2): + - AgoraRtcEngine_iOS/AIAEC (= 4.3.2) + - AgoraRtcEngine_iOS/AINS (= 4.3.2) + - AgoraRtcEngine_iOS/AudioBeauty (= 4.3.2) + - AgoraRtcEngine_iOS/ClearVision (= 4.3.2) + - AgoraRtcEngine_iOS/ContentInspect (= 4.3.2) + - AgoraRtcEngine_iOS/FaceCapture (= 4.3.2) + - AgoraRtcEngine_iOS/FaceDetection (= 4.3.2) + - AgoraRtcEngine_iOS/LipSync (= 4.3.2) + - AgoraRtcEngine_iOS/ReplayKit (= 4.3.2) + - AgoraRtcEngine_iOS/RtcBasic (= 4.3.2) + - AgoraRtcEngine_iOS/SpatialAudio (= 4.3.2) + - AgoraRtcEngine_iOS/VideoAv1CodecDec (= 4.3.2) + - AgoraRtcEngine_iOS/VideoAv1CodecEnc (= 4.3.2) + - AgoraRtcEngine_iOS/VideoCodecDec (= 4.3.2) + - AgoraRtcEngine_iOS/VideoCodecEnc (= 4.3.2) + - AgoraRtcEngine_iOS/VirtualBackground (= 4.3.2) + - AgoraRtcEngine_iOS/VQA (= 4.3.2) + - AgoraRtcEngine_iOS/AIAEC (4.3.2) + - AgoraRtcEngine_iOS/AINS (4.3.2) + - AgoraRtcEngine_iOS/AudioBeauty (4.3.2) + - AgoraRtcEngine_iOS/ClearVision (4.3.2) + - AgoraRtcEngine_iOS/ContentInspect (4.3.2) + - AgoraRtcEngine_iOS/FaceCapture (4.3.2) + - AgoraRtcEngine_iOS/FaceDetection (4.3.2) + - AgoraRtcEngine_iOS/LipSync (4.3.2) + - AgoraRtcEngine_iOS/ReplayKit (4.3.2) + - AgoraRtcEngine_iOS/RtcBasic (4.3.2) + - AgoraRtcEngine_iOS/SpatialAudio (4.3.2) + - AgoraRtcEngine_iOS/VideoAv1CodecDec (4.3.2) + - AgoraRtcEngine_iOS/VideoAv1CodecEnc (4.3.2) + - AgoraRtcEngine_iOS/VideoCodecDec (4.3.2) + - AgoraRtcEngine_iOS/VideoCodecEnc (4.3.2) + - AgoraRtcEngine_iOS/VirtualBackground (4.3.2) + - AgoraRtcEngine_iOS/VQA (4.3.2) - boost (1.76.0) - CocoaAsyncSocket (7.6.5) - DoubleConversion (1.1.6) @@ -411,9 +411,9 @@ PODS: - React-jsinspector (0.72.10) - React-logger (0.72.10): - glog - - react-native-agora (4.3.0): - - AgoraIrisRTC_iOS (= 4.3.1-build.1) - - AgoraRtcEngine_iOS (= 4.3.1) + - react-native-agora (4.3.1): + - AgoraIrisRTC_iOS (= 4.3.2-build.1) + - AgoraRtcEngine_iOS (= 4.3.2) - RCT-Folly (= 2021.07.22.00) - React-Core - react-native-agora-rawdata (0.1.0): @@ -553,7 +553,7 @@ PODS: - Yoga (~> 1.14) DEPENDENCIES: - - AgoraRtcEngine_iOS (= 4.3.1) + - AgoraRtcEngine_iOS (= 4.3.2) - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) @@ -751,8 +751,8 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native/ReactCommon/yoga" SPEC CHECKSUMS: - AgoraIrisRTC_iOS: 7710d853202eca4900c2916aefc44abd5a139d4e - AgoraRtcEngine_iOS: f64be00fdda786bb7edd84ab461c31b7b4c93534 + AgoraIrisRTC_iOS: 3cb15344a503a1a35ab6d60481732a8beeda98fe + AgoraRtcEngine_iOS: eaa97751fcfe1b50d9b067e0df92752a6a5f899f boost: 7dcd2de282d72e344012f7d6564d024930a6a440 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 @@ -786,7 +786,7 @@ SPEC CHECKSUMS: React-jsiexecutor: 45ef2ec6dcde31b90469175ec76ddac77b91dfc3 React-jsinspector: de0198127395fec3058140a20c045167f761bb16 React-logger: dc3a2b174d79c2da635059212747d8d929b54e06 - react-native-agora: 4f85b3cdfa151e91df4953d4b9bf4fdbb3d527ff + react-native-agora: c302fe34042f47907915d38106db3b36282d2a37 react-native-agora-rawdata: 097895cdccd8fcf3cff5dffe23372f5d3c89fd31 react-native-image-tools: 88218449791389bbf550a2c475a3b564c8233c8b react-native-safe-area-context: 7aa8e6d9d0f3100a820efb1a98af68aa747f9284 @@ -818,6 +818,6 @@ SPEC CHECKSUMS: Yoga: d0003f849d2b5224c072cef6568b540d8bb15cd3 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: a1a891aa26be28bd4953131bc93b8f452d3aff23 +PODFILE CHECKSUM: 4c65a7c0566ed49c11cba4929585c4fdec8fc7c0 COCOAPODS: 1.13.0 diff --git a/example/src/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx b/example/src/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx index 57e6fe45..16bf0196 100644 --- a/example/src/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx +++ b/example/src/examples/advanced/ChannelMediaRelay/ChannelMediaRelay.tsx @@ -191,7 +191,7 @@ export default class ChannelMediaRelay <> { - this.setState({ destChannelNames: text.split(' ') }); + this.setState({ destChannelNames: text ? text.split(' ') : [] }); }} placeholder={'destChannelNames (split by blank)'} value={destChannelNames.join(' ')} diff --git a/react-native-agora.podspec b/react-native-agora.podspec index ccff16d5..1ca2a606 100644 --- a/react-native-agora.podspec +++ b/react-native-agora.podspec @@ -40,8 +40,8 @@ Pod::Spec.new do |s| end end - s.dependency 'AgoraRtcEngine_iOS', '4.3.1' - s.dependency 'AgoraIrisRTC_iOS', '4.3.1-build.1' + s.dependency 'AgoraRtcEngine_iOS', '4.3.2' + s.dependency 'AgoraIrisRTC_iOS', '4.3.2-build.1' s.libraries = 'stdc++' s.framework = 'ReplayKit' end diff --git a/scripts/terra/config/impl_config.yaml b/scripts/terra/config/impl_config.yaml index b8372dd8..56885e79 100644 --- a/scripts/terra/config/impl_config.yaml +++ b/scripts/terra/config/impl_config.yaml @@ -2,7 +2,7 @@ parsers: - name: RTCParser package: '@agoraio-extensions/terra_shared_configs' args: - sdkVersion: 4.3.1 + sdkVersion: 4.3.2 FixEnumConstantParser: skipCalEnumValue: true diff --git a/scripts/terra/config/types_config.yaml b/scripts/terra/config/types_config.yaml index f6677480..9a0c789f 100644 --- a/scripts/terra/config/types_config.yaml +++ b/scripts/terra/config/types_config.yaml @@ -2,7 +2,7 @@ parsers: - name: RTCParser package: '@agoraio-extensions/terra_shared_configs' args: - sdkVersion: 4.3.1 + sdkVersion: 4.3.2 FixEnumConstantParser: skipCalEnumValue: true diff --git a/src/AgoraBase.ts b/src/AgoraBase.ts index f14afe15..aae3c3ff 100644 --- a/src/AgoraBase.ts +++ b/src/AgoraBase.ts @@ -527,11 +527,11 @@ export enum UserOfflineReasonType { */ export enum InterfaceIdType { /** - * The IAudioDeviceManager interface class. + * 1: The IAudioDeviceManager interface class. */ AgoraIidAudioDeviceManager = 1, /** - * The IVideoDeviceManager interface class. + * 2: The IVideoDeviceManager interface class. */ AgoraIidVideoDeviceManager = 2, /** @@ -539,7 +539,7 @@ export enum InterfaceIdType { */ AgoraIidParameterEngine = 3, /** - * The IMediaEngine interface class. + * 4: The IMediaEngine interface class. */ AgoraIidMediaEngine = 4, /** @@ -1295,7 +1295,7 @@ export enum VideoMirrorModeType { } /** - * The bit mask that indicates the device codec capability. + * The bit mask of the codec type. */ export enum CodecCapMask { /** @@ -1335,7 +1335,7 @@ export class CodecCapLevels { } /** - * The codec capability of the device. + * The codec capability of the SDK. */ export class CodecCapInfo { /** @@ -1343,11 +1343,11 @@ export class CodecCapInfo { */ codecType?: VideoCodecType; /** - * The bit mask of the codec type. See CodecCapMask. + * Bit mask of the codec types in SDK. See CodecCapMask. */ codecCapMask?: number; /** - * The level of the codec capability. See CodecCapLevels. + * Codec capability of the SDK. See CodecCapLevels. */ codecLevels?: CodecCapLevels; } @@ -1383,7 +1383,7 @@ export class VideoEncoderConfiguration { */ frameRate?: number; /** - * The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution, frame rate, and bitrate, please refer to. STANDARD_BITRATE (0): (Recommended) Standard bitrate mode. COMPATIBLE_BITRATE (-1): Adaptive bitrate mode. In general, Agora suggests that you do not use this value. + * The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see. STANDARD_BITRATE (0): (Recommended) Standard bitrate mode. COMPATIBLE_BITRATE (-1): Adaptive bitrate mode. In general, Agora suggests that you do not use this value. */ bitrate?: number; /** @@ -2424,10 +2424,6 @@ export class VideoTrackInfo { * @ignore */ channelId?: string; - /** - * @ignore - */ - streamType?: VideoStreamType; /** * @ignore */ @@ -2913,7 +2909,7 @@ export class LiveTranscoding { */ height?: number; /** - * Bitrate of the output video stream for Media Push in Kbps. The default value is 400 Kbps. Set this member according to the table. If you set a bitrate beyond the proper range, the SDK automatically adapts it to a value within the range. + * The encoding bitrate (Kbps) of the video. This parameter does not need to be set; keeping the default value STANDARD_BITRATE is sufficient. The SDK automatically matches the most suitable bitrate based on the video resolution and frame rate you have set. For the correspondence between video resolution and frame rate, see. */ videoBitrate?: number; /** @@ -3204,11 +3200,11 @@ export enum ConnectionChangedReasonType { */ ConnectionChangedInterrupted = 2, /** - * 3: The connection between the SDK and the Agora edge server is banned by the Agora edge server. This error occurs when the user is kicked out of the channel by the server. + * 3: The connection between the SDK and the Agora edge server is banned by the Agora edge server. For example, when a user is kicked out of the channel, this status will be returned. */ ConnectionChangedBannedByServer = 3, /** - * 4: The SDK fails to join the channel. When the SDK fails to join the channel for more than 20 minutes, this error occurs and the SDK stops reconnecting to the channel. + * 4: The SDK fails to join the channel. When the SDK fails to join the channel for more than 20 minutes, this code will be returned and the SDK stops reconnecting to the channel. You need to prompt the user to try to switch to another network and rejoin the channel. */ ConnectionChangedJoinFailed = 4, /** @@ -3216,21 +3212,30 @@ export enum ConnectionChangedReasonType { */ ConnectionChangedLeaveChannel = 5, /** - * 6: The connection failed because the App ID is not valid. Please rejoin the channel with a valid App ID. + * 6: The App ID is invalid. You need to rejoin the channel with a valid APP ID and make sure the App ID you are using is consistent with the one generated in the Agora Console. */ ConnectionChangedInvalidAppId = 6, /** - * 7: The connection failed since channel name is not valid. Rejoin the channel with a valid channel name. + * 7: Invalid channel name. Rejoin the channel with a valid channel name. A valid channel name is a string of up to 64 bytes in length. Supported characters (89 characters in total): + * All lowercase English letters: a to z. + * All uppercase English letters: A to Z. + * All numeric characters: 0 to 9. + * Space + * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", "," */ ConnectionChangedInvalidChannelName = 7, /** - * 8: The connection failed because the token is not valid. Possible reasons are as follows: - * The App Certificate for the project is enabled in Agora Console, but you do not use a token when joining the channel. If you enable the App Certificate, you must use a token to join the channel. + * 8: Invalid token. Possible reasons are as follows: + * The App Certificate for the project is enabled in Agora Console, but you do not pass in a token when joining a channel. * The uid specified when calling joinChannel to join the channel is inconsistent with the uid passed in when generating the token. + * The generated token and the token used to join the channel are not consistent. Ensure the following: + * When your project enables App Certificate, you need to pass in a token to join a channel. + * The user ID specified when generating the token is consistent with the user ID used when joining the channel. + * The generated token is the same as the token passed in to join the channel. */ ConnectionChangedInvalidToken = 8, /** - * 9: The connection failed since token is expired. + * (9): The token currently being used has expired. You need to generate a new token on your server and rejoin the channel with the new token. */ ConnectionChangedTokenExpired = 9, /** @@ -3248,7 +3253,7 @@ export enum ConnectionChangedReasonType { */ ConnectionChangedRenewToken = 12, /** - * 13: The IP address of the client has changed, possibly because the network type, IP address, or port has been changed. + * (13): Client IP address changed. If you receive this code multiple times, You need to prompt the user to switch networks and try joining the channel again. */ ConnectionChangedClientIpAddressChanged = 13, /** @@ -4829,41 +4834,41 @@ export enum MediaTraceEvent { */ export class VideoRenderingTracingInfo { /** - * The time interval from calling the startMediaRenderingTracing method to SDK triggering the onVideoRenderingTracingResult callback. The unit is milliseconds. Agora recommends you call startMediaRenderingTracing before joining a channel. + * The time interval (ms) from startMediaRenderingTracing to SDK triggering the onVideoRenderingTracingResult callback. Agora recommends you call startMediaRenderingTracing before joining a channel. */ elapsedTime?: number; /** - * The time interval from calling startMediaRenderingTracing to calling joinChannel. The unit is milliseconds. A negative number means to call joinChannel after calling startMediaRenderingTracing. + * The time interval (ms) from startMediaRenderingTracing to joinChannel. A negative number indicates that startMediaRenderingTracing is called after calling joinChannel. */ start2JoinChannel?: number; /** - * Time interval from calling joinChannel to successfully joining the channel. The unit is milliseconds. + * The time interval (ms) from or joinChannel to successfully joining the channel. */ join2JoinSuccess?: number; /** - * If the local user calls startMediaRenderingTracing before successfully joining the channel, this value is the time interval from the local user successfully joining the channel to the remote user joining the channel. The unit is milliseconds. - * If the local user calls startMediaRenderingTracing after successfully joining the channel, the value is the time interval from calling startMediaRenderingTracing to when the remote user joins the channel. The unit is milliseconds. + * If the local user calls startMediaRenderingTracing before successfully joining the channel, this value is the time interval (ms) from the local user successfully joining the channel to the remote user joining the channel. + * If the local user calls startMediaRenderingTracing after successfully joining the channel, the value is the time interval (ms) from startMediaRenderingTracing to when the remote user joins the channel. * If the local user calls startMediaRenderingTracing after the remote user joins the channel, the value is 0 and meaningless. * In order to reduce the time of rendering the first frame for remote users, Agora recommends that the local user joins the channel when the remote user is in the channel to reduce this value. */ joinSuccess2RemoteJoined?: number; /** - * If the local user calls startMediaRenderingTracing before the remote user joins the channel, this value is the time interval from when the remote user joins the channel to when the local user sets the remote view. The unit is milliseconds. - * If the local user calls startMediaRenderingTracing after the remote user joins the channel, this value is the time interval from calling startMediaRenderingTracing to setting the remote view. The unit is milliseconds. + * If the local user calls startMediaRenderingTracing before the remote user joins the channel, this value is the time interval (ms) from when the remote user joins the channel to when the local user sets the remote view. + * If the local user calls startMediaRenderingTracing after the remote user joins the channel, this value is the time interval (ms) from calling startMediaRenderingTracing to setting the remote view. * If the local user calls startMediaRenderingTracing after setting the remote view, the value is 0 and has no effect. * In order to reduce the time of rendering the first frame for remote users, Agora recommends that the local user sets the remote view before the remote user joins the channel, or sets the remote view immediately after the remote user joins the channel to reduce this value. */ remoteJoined2SetView?: number; /** - * If the local user calls startMediaRenderingTracing before the remote user joins the channel, this value is the time interval from the remote user joining the channel to subscribing to the remote video stream. The unit is milliseconds. - * If the local user calls startMediaRenderingTracing after the remote user joins the channel, this value is the time interval from calling startMediaRenderingTracing to subscribing to the remote video stream. The unit is milliseconds. + * If the local user calls startMediaRenderingTracing before the remote user joins the channel, this value is the time interval (ms) from the remote user joining the channel to subscribing to the remote video stream. + * If the local user calls startMediaRenderingTracing after the remote user joins the channel, this value is the time interval (ms) from startMediaRenderingTracing to subscribing to the remote video stream. * If the local user calls startMediaRenderingTracing after subscribing to the remote video stream, the value is 0 and has no effect. * In order to reduce the time of rendering the first frame for remote users, Agora recommends that after the remote user joins the channel, the local user immediately subscribes to the remote video stream to reduce this value. */ remoteJoined2UnmuteVideo?: number; /** - * If the local user calls startMediaRenderingTracing before the remote user joins the channel, this value is the time interval from when the remote user joins the channel to when the local user receives the remote video stream. The unit is milliseconds. - * If the local user calls startMediaRenderingTracing after the remote user joins the channel, this value is the time interval from calling startMediaRenderingTracing to receiving the remote video stream. The unit is milliseconds. + * If the local user calls startMediaRenderingTracing before the remote user joins the channel, this value is the time interval (ms) from when the remote user joins the channel to when the local user receives the remote video stream. + * If the local user calls startMediaRenderingTracing after the remote user joins the channel, this value is the time interval (ms) from startMediaRenderingTracing to receiving the remote video stream. * If the local user calls startMediaRenderingTracing after receiving the remote video stream, the value is 0 and has no effect. * In order to reduce the time of rendering the first frame for remote users, Agora recommends that the remote user publishes video streams immediately after joining the channel, and the local user immediately subscribes to remote video streams to reduce this value. */ diff --git a/src/AgoraMediaBase.ts b/src/AgoraMediaBase.ts index 3f764396..0c5e7306 100644 --- a/src/AgoraMediaBase.ts +++ b/src/AgoraMediaBase.ts @@ -949,12 +949,12 @@ export interface IAudioFrameObserverBase { */ export interface IAudioFrameObserver extends IAudioFrameObserverBase { /** - * Retrieves the audio frame of a specified user before mixing. + * Retrieves the audio frame before mixing of subscribed remote users. * * Due to framework limitations, this callback does not support sending processed audio data back to the SDK. * * @param channelId The channel ID. - * @param uid The user ID of the specified user. + * @param uid The ID of subscribed remote users. * @param audioFrame The raw audio data. See AudioFrame. */ onPlaybackAudioFrameBeforeMixing?( @@ -1066,8 +1066,8 @@ export interface IVideoFrameObserver { * * @param sourceType Video source types, including cameras, screens, or media player. See VideoSourceType. * @param videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows: - * Android: I420 or RGB (GLES20.GL_TEXTURE_2D) - * iOS: I420 or CVPixelBufferRef + * Android: I420 + * iOS: I420 */ onCaptureVideoFrame?( sourceType: VideoSourceType, @@ -1078,13 +1078,14 @@ export interface IVideoFrameObserver { * Occurs each time the SDK receives a video frame before encoding. * * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data before encoding and then process the data according to your particular scenarios. After processing, you can send the processed video data back to the SDK in this callback. + * It's recommended that you implement this callback through the C++ API. * Due to framework limitations, this callback does not support sending processed video data back to the SDK. * The video data that this callback gets has been preprocessed, with its content cropped and rotated, and the image enhanced. * * @param sourceType The type of the video source. See VideoSourceType. * @param videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows: - * Android: I420 or RGB (GLES20.GL_TEXTURE_2D) - * iOS: I420 or CVPixelBufferRef + * Android: I420 + * iOS: I420 */ onPreEncodeVideoFrame?( sourceType: VideoSourceType, @@ -1101,13 +1102,14 @@ export interface IVideoFrameObserver { * * After you successfully register the video frame observer, the SDK triggers this callback each time it receives a video frame. In this callback, you can get the video data sent from the remote end before rendering, and then process it according to the particular scenarios. * If the video data type you get is RGBA, the SDK does not support processing the data of the alpha channel. + * It's recommended that you implement this callback through the C++ API. * Due to framework limitations, this callback does not support sending processed video data back to the SDK. * * @param channelId The channel ID. * @param remoteUid The user ID of the remote user who sends the current video frame. * @param videoFrame The video frame. See VideoFrame. The default value of the video frame data format obtained through this callback is as follows: - * Android: I420 or RGB (GLES20.GL_TEXTURE_2D) - * iOS: I420 or CVPixelBufferRef + * Android: I420 + * iOS: I420 */ onRenderVideoFrame?( channelId: string, @@ -1236,7 +1238,7 @@ export class MediaRecorderConfiguration { /** * Facial information observer. * - * You can call registerFaceInfoObserver to register or unregister the IFaceInfoObserver object. + * You can call registerFaceInfoObserver to register one IFaceInfoObserver observer. */ export interface IFaceInfoObserver { /** diff --git a/src/IAgoraMusicContentCenter.ts b/src/IAgoraMusicContentCenter.ts index f3135d00..fe58a6f0 100644 --- a/src/IAgoraMusicContentCenter.ts +++ b/src/IAgoraMusicContentCenter.ts @@ -1,6 +1,24 @@ import './extension/IAgoraMusicContentCenterExtension'; import { IMediaPlayer } from './IAgoraMediaPlayer'; +/** + * @ignore + */ +export enum MusicPlayMode { + /** + * @ignore + */ + KMusicPlayModeOriginal = 0, + /** + * @ignore + */ + KMusicPlayModeAccompany = 1, + /** + * @ignore + */ + KMusicPlayModeLeadSing = 2, +} + /** * @ignore */ @@ -323,6 +341,11 @@ export class MusicContentCenterConfiguration { * @ignore */ export abstract class IMusicPlayer extends IMediaPlayer { + /** + * @ignore + */ + abstract setPlayMode(mode: MusicPlayMode): number; + /** * @ignore */ @@ -365,6 +388,11 @@ export abstract class IMusicContentCenter { */ abstract createMusicPlayer(): IMusicPlayer; + /** + * @ignore + */ + abstract destroyMusicPlayer(musicPlayer: IMusicPlayer): number; + /** * @ignore */ diff --git a/src/IAgoraRtcEngine.ts b/src/IAgoraRtcEngine.ts index dfdd2de8..099a876c 100644 --- a/src/IAgoraRtcEngine.ts +++ b/src/IAgoraRtcEngine.ts @@ -1396,9 +1396,7 @@ export interface IRtcEngineEventHandler { onLeaveChannel?(connection: RtcConnection, stats: RtcStats): void; /** - * Reports the statistics of the current call. - * - * The SDK triggers this callback once every two seconds after the user joins the channel. + * Reports the statistics about the current call. * * @param connection The connection information. See RtcConnection. * @param stats Statistics of the RTC engine. See RtcStats. @@ -1505,7 +1503,7 @@ export interface IRtcEngineEventHandler { * @param source The type of the video source. See VideoSourceType. * @param width The width (px) of the first local video frame. * @param height The height (px) of the first local video frame. - * @param elapsed Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback. If you call startPreview before calling joinChannel, then this parameter is the time elapsed from calling the startPreview method until the SDK triggers this callback. + * @param elapsed The time elapsed (ms) from the local user calling joinChannel to join the channel to when the SDK triggers this callback. If startPreviewWithoutSourceType / startPreview is called before joining the channel, this parameter indicates the time elapsed from calling startPreviewWithoutSourceType or startPreview to when this event occurred. */ onFirstLocalVideoFrame?( source: VideoSourceType, @@ -1518,12 +1516,12 @@ export interface IRtcEngineEventHandler { * Occurs when the first video frame is published. * * The SDK triggers this callback under one of the following circumstances: - * The local client enables the video module and calls joinChannel successfully. + * The local client enables the video module and calls joinChannel to join the channel successfully. * The local client calls muteLocalVideoStream (true) and muteLocalVideoStream (false) in sequence. * The local client calls disableVideo and enableVideo in sequence. * * @param connection The connection information. See RtcConnection. - * @param elapsed Time elapsed (ms) from the local user calling joinChannel until the SDK triggers this callback. + * @param elapsed Time elapsed (ms) from the local user calling joinChannel until this callback is triggered. */ onFirstLocalVideoFramePublished?( source: VideoSourceType, @@ -1941,9 +1939,11 @@ export interface IRtcEngineEventHandler { /** * Occurs when the token expires. * - * 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: + * The SDK triggers this callback if the token expires. 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: + * In scenarios involving one channel: * Call renewToken to pass in the new token. * Call leaveChannel to leave the current channel and then pass in the new token when you call joinChannel to join a channel. + * In scenarios involving mutiple channels: Call updateChannelMediaOptionsEx to pass in the new token. * * @param connection The connection information. See RtcConnection. */ @@ -1952,10 +1952,14 @@ export interface IRtcEngineEventHandler { /** * Occurs when the token expires in 30 seconds. * - * 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. + * 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: + * In scenarios involving one channel: + * Call renewToken to pass in the new token. + * Call leaveChannel to leave the current channel and then pass in the new token when you call joinChannel to join a channel. + * In scenarios involving mutiple channels: Call updateChannelMediaOptionsEx to pass in the new token. * * @param connection The connection information. See RtcConnection. - * @param token The token that expires in 30 seconds. + * @param token The token that is about to expire. */ onTokenPrivilegeWillExpire?(connection: RtcConnection, token: string): void; @@ -2921,7 +2925,7 @@ export abstract class IRtcEngine { abstract getErrorDescription(code: number): string; /** - * Queries the current device's supported video codec capabilities. + * Queries the video codec capabilities of the SDK. * * @returns * 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. @@ -2941,11 +2945,7 @@ export abstract class IRtcEngine { /** * Preloads a channel with token, channelId, and uid. * - * 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. - * 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. - * 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. - * One IRtcEngine instance supports preloading 20 channels at most. When exceeding this limit, the latest 20 preloaded channels take effect. - * 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. + * 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. 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. 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. * * @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. * When preloading one channel, calling this method to pass in the new token. @@ -2958,7 +2958,7 @@ export abstract class IRtcEngine { * All numeric characters: 0 to 9. * Space * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", "," - * @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. + * @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 onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so. * * @returns * 0: Success. @@ -3013,7 +3013,7 @@ export abstract class IRtcEngine { * All numeric characters: 0 to 9. * Space * "!", "#", "$", "%", "&", "(", ")", "+", "-", ":", ";", "<", "=", ".", ">", "?", "@", "[", "]", "^", "_", "{", "}", "|", "~", "," - * @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 app must record and maintain the returned user ID, because the SDK does not do so. + * @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 onJoinChannelSuccess returns it in the callback. Your application must record and maintain the returned user ID, because the SDK does not do so. * @param options The channel media options. See ChannelMediaOptions. * * @returns @@ -3065,15 +3065,18 @@ export abstract class IRtcEngine { /** * Renews the token. * - * The SDK triggers the onTokenPrivilegeWillExpire callback. onConnectionStateChanged The ConnectionChangedTokenExpired callback reports (9). + * You can call this method to pass a new token to the SDK. A token will expire after a certain period of time, at which point the SDK will be unable to establish a connection with the server. * * @param token The new token. * * @returns * 0: Success. * < 0: Failure. - * -2: The parameter is invalid. For example, the token is invalid. You need to fill in a valid parameter. + * -2: The parameter is invalid. For example, the token is empty. * -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine object before calling this method. + * 110: Invalid token. Ensure the following: + * The user ID specified when generating the token is consistent with the user ID used when joining the channel. + * The generated token is the same as the token passed in to join the channel. */ abstract renewToken(token: string): number; @@ -3188,9 +3191,7 @@ export abstract class IRtcEngine { /** * Disables the video module. * - * 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. - * This method affects the internal engine and can be called after leaving the channel. - * 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. + * This method is used to disable the video module. * * @returns * 0: Success. @@ -3201,10 +3202,7 @@ export abstract class IRtcEngine { /** * Enables the local video preview and specifies the video source for the preview. * - * You can call this method to enable local video preview. Call this method after the following: - * Call enableVideo to enable the video module. - * The local preview enables the mirror mode by default. - * 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. + * This method is used to start local video preview and specify the video source that appears in the preview screen. * * @param sourceType The type of the video source. See VideoSourceType. * @@ -3217,8 +3215,6 @@ export abstract class IRtcEngine { /** * Stops the local video preview. * - * After calling startPreview to start the preview, if you want to close the local video preview, call this method. Call this method before joining a channel or after leaving a channel. - * * @param sourceType The type of the video source. See VideoSourceType. * * @returns @@ -3254,7 +3250,7 @@ export abstract class IRtcEngine { /** * Sets the video encoder configuration. * - * Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. The config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found. Call this method before joining a channel. Agora recommends calling this method before enableVideo to reduce the time to render the first video frame. + * Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. * * @param config Video profile. See VideoEncoderConfiguration. * @@ -3453,10 +3449,7 @@ export abstract class IRtcEngine { /** * Enables the audio module. * - * The audio mode is enabled by default. - * This method enables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel. - * 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. - * A successful call of this method resets enableLocalAudio, muteRemoteAudioStream, and muteAllRemoteAudioStreams. Proceed it with caution. + * The audio module is enabled by default After calling disableAudio to disable the audio module, you can call this method to re-enable it. * * @returns * 0: Success. @@ -3467,8 +3460,7 @@ export abstract class IRtcEngine { /** * Disables the audio module. * - * This method disables the internal engine and can be called anytime after initialization. It is still valid after one leaves channel. - * 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. + * The audio module is enabled by default, and you can call this method to disable the audio module. * * @returns * 0: Success. @@ -3479,10 +3471,6 @@ export abstract class IRtcEngine { /** * Sets the audio profile and audio scenario. * - * You can call this method either before or after joining a channel. - * Due to iOS system restrictions, some audio routes cannot be recognized in call volume mode. Therefore, if you need to use an external sound card, it is recommended to set the audio scenario to AudioScenarioGameStreaming (3). In this scenario, the SDK will switch to media volume to avoid this issue. - * In scenarios requiring high-quality audio, such as online music tutoring, Agora recommends you set profile as AudioProfileMusicHighQuality (4) and scenario as AudioScenarioGameStreaming (3). - * * @param profile The audio profile, including the sampling rate, bitrate, encoding mode, and the number of channels. See AudioProfileType. * @param scenario The audio scenarios. Under different audio scenarios, the device uses different volume types. See AudioScenarioType. * @@ -3498,9 +3486,6 @@ export abstract class IRtcEngine { /** * Sets audio scenarios. * - * Due to iOS system restrictions, some audio routes cannot be recognized in call volume mode. Therefore, if you need to use an external sound card, it is recommended to set the audio scenario to AudioScenarioGameStreaming (3). In this scenario, the SDK will switch to media volume to avoid this issue. - * You can call this method either before or after joining a channel. - * * @param scenario The audio scenarios. Under different audio scenarios, the device uses different volume types. See AudioScenarioType. * * @returns @@ -3512,9 +3497,7 @@ export abstract class IRtcEngine { /** * Enables or disables the local audio capture. * - * 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 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). - * 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. - * 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. + * 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. The difference between this method and muteLocalAudioStream are as follows: 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 without affecting the audio capture status. * * @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. * @@ -3527,7 +3510,7 @@ export abstract class IRtcEngine { /** * Stops or resumes publishing the local audio stream. * - * 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. + * This method is used to control whether to publish the locally captured audio stream. If you call this method to stop publishing locally captured audio streams, the audio capturing device will still work and won't be affected. * * @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. * @@ -3540,9 +3523,7 @@ export abstract class IRtcEngine { /** * Stops or resumes subscribing to the audio streams of all remote users. * - * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users. - * Call this method after joining a channel. - * 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. + * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users. By default, the SDK subscribes to the audio streams of all remote users when joining a channel. To modify this behavior, you can set autoSubscribeAudio to false when calling joinChannel to join the channel, which will cancel the subscription to the audio streams of all users upon joining the channel. * * @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. * @@ -3560,8 +3541,6 @@ export abstract class IRtcEngine { /** * Stops or resumes subscribing to the audio stream of a specified user. * - * Call this method after joining a channel. - * * @param uid The user ID of the specified user. * @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. * @@ -3574,9 +3553,7 @@ export abstract class IRtcEngine { /** * Stops or resumes publishing the local video stream. * - * A successful call of this method triggers the onUserMuteVideo callback on the remote client. - * This method executes faster than the enableLocalVideo (false) method, which controls the sending of the local video stream. - * This method does not affect any ongoing video recording, because it does not disable the camera. + * This method is used to control whether to publish the locally captured video stream. If you call this method to stop publishing locally captured video streams, the video capturing device will still work and won't be affected. Compared to enableLocalVideo (false), which can also cancel the publishing of local video stream by turning off the local video stream capture, this method responds faster. * * @param mute Whether to stop publishing the local video stream. true : Stop publishing the local video stream. false : (Default) Publish the local video stream. * @@ -3604,9 +3581,7 @@ export abstract class IRtcEngine { /** * Stops or resumes subscribing to the video streams of all remote users. * - * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users. - * Call this method after joining a channel. - * 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. + * After successfully calling this method, the local user stops or resumes subscribing to the audio streams of all remote users, including all subsequent users. By default, the SDK subscribes to the video streams of all remote users when joining a channel. To modify this behavior, you can set autoSubscribeVideo to false when calling joinChannel to join the channel, which will cancel the subscription to the video streams of all users upon joining the channel. * * @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. * @@ -3639,8 +3614,6 @@ export abstract class IRtcEngine { /** * Stops or resumes subscribing to the video stream of a specified user. * - * Call this method after joining a channel. - * * @param uid The user ID of the specified user. * @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. * @@ -3782,7 +3755,7 @@ export abstract class IRtcEngine { /** * Enables the reporting of users' volume indication. * - * 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. + * 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. * * @param interval Sets the time interval between two consecutive volume indications: * ≤ 0: Disables the volume indication. @@ -4430,7 +4403,9 @@ export abstract class IRtcEngine { /** * Sets a preset voice beautifier effect. * - * 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. + * 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. To achieve better vocal effects, it is recommended that you call the following APIs before calling this method: + * Call setAudioScenario to set the audio scenario to high-quality audio scenario, namely AudioScenarioGameStreaming (3). + * Call setAudioProfile to set the profile parameter to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5). * You can call this method either before or after joining a channel. * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect. * This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music. @@ -4448,10 +4423,11 @@ export abstract class IRtcEngine { /** * Sets an SDK preset audio effect. * - * 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. + * To achieve better vocal effects, it is recommended that you call the following APIs before calling this method: + * Call setAudioScenario to set the audio scenario to high-quality audio scenario, namely AudioScenarioGameStreaming (3). + * Call setAudioProfile to set the profile parameter to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5). 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. + * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect. * You can call this method either before or after joining a channel. - * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect. - * This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music. * If you call setAudioEffectPreset and set enumerators except for RoomAcoustics3dVoice or PitchCorrection, do not call setAudioEffectParameters; otherwise, setAudioEffectPreset is overridden. * 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 * 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. @@ -4467,9 +4443,11 @@ export abstract class IRtcEngine { /** * Sets a preset voice beautifier effect. * - * 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. - * You can call this method either before or after joining a channel. + * To achieve better vocal effects, it is recommended that you call the following APIs before calling this method: + * Call setAudioScenario to set the audio scenario to high-quality audio scenario, namely AudioScenarioGameStreaming (3). + * Call setAudioProfile to set the profile parameter to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5). 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. * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect. + * You can call this method either before or after joining a channel. * This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music. * 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 * 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. @@ -4485,18 +4463,19 @@ export abstract class IRtcEngine { /** * Sets parameters for SDK preset audio effects. * - * Call this method to set the following parameters for the local user who sends an audio stream: + * To achieve better vocal effects, it is recommended that you call the following APIs before calling this method: + * Call setAudioScenario to set the audio scenario to high-quality audio scenario, namely AudioScenarioGameStreaming (3). + * Call setAudioProfile to set the profile parameter to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5). Call this method to set the following parameters for the local user who sends an audio stream: * 3D voice effect: Sets the cycle period of the 3D voice effect. * 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. + * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect. * You can call this method either before or after joining a channel. - * To get better audio effect quality, Agora recommends setting the scenario parameter of setAudioProfile as AudioScenarioGameStreaming (3) before calling this method. - * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) AudioProfileIot or (6), or the method does not take effect. * This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music. * 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 * * @param preset The options for SDK preset audio effects: RoomAcoustics3dVoice, 3D voice effect: - * 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. - * 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. + * You need to set the profile parameter in setAudioProfile to AudioProfileMusicStandardStereo (3) or AudioProfileMusicHighQualityStereo (5) before setting this enumerator; otherwise, the enumerator setting does not take effect. + * 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: * @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. * 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. * @param param2 If you set preset to RoomAcoustics3dVoice , you need to set param2 to 0. @@ -4515,9 +4494,11 @@ export abstract class IRtcEngine { /** * Sets parameters for the preset voice beautifier effects. * - * 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. - * You can call this method either before or after joining a channel. + * To achieve better vocal effects, it is recommended that you call the following APIs before calling this method: + * Call setAudioScenario to set the audio scenario to high-quality audio scenario, namely AudioScenarioGameStreaming (3). + * Call setAudioProfile to set the profile parameter to AudioProfileMusicHighQuality (4) or AudioProfileMusicHighQualityStereo (5). 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. * Do not set the profile parameter in setAudioProfile to AudioProfileSpeechStandard (1) or AudioProfileIot (6), or the method does not take effect. + * You can call this method either before or after joining a channel. * This method has the best effect on human voice processing, and Agora does not recommend calling this method to process audio data containing music. * 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 * @@ -4980,10 +4961,10 @@ export abstract class IRtcEngine { /** * Adjusts the capturing signal volume. * - * You can call this method either before or after joining a channel. + * If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead. * * @param volume The volume of the user. The value range is [0,400]. - * 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead. + * 0: Mute. * 100: (Default) The original volume. * 400: Four times the original volume (amplifying the audio signals by four times). * @@ -5007,11 +4988,10 @@ export abstract class IRtcEngine { /** * Adjusts the playback signal volume of all remote users. * - * This method adjusts the playback volume that is the mixed volume of all remote users. - * You can call this method either before or after joining a channel. + * This method is used to adjust the signal volume of all remote users mixed and played locally. If you need to adjust the signal volume of a specified remote user played locally, it is recommended that you call adjustUserPlaybackSignalVolume instead. * * @param volume The volume of the user. The value range is [0,400]. - * 0: Mute. If you only need to mute the audio signal, Agora recommends that you use muteRecordingSignal instead. + * 0: Mute. * 100: (Default) The original volume. * 400: Four times the original volume (amplifying the audio signals by four times). * @@ -5025,11 +5005,12 @@ export abstract class IRtcEngine { * Adjusts the playback signal volume of a specified remote user. * * 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. - * Call this method after joining a channel. - * The playback volume here refers to the mixed volume of a specified remote user. * * @param uid The user ID of the remote user. - * @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume. + * @param volume The volume of the user. The value range is [0,400]. + * 0: Mute. + * 100: (Default) The original volume. + * 400: Four times the original volume (amplifying the audio signals by four times). * * @returns * 0: Success. @@ -5045,7 +5026,7 @@ export abstract class IRtcEngine { /** * Sets the fallback option for the subscribed video stream based on the network conditions. * - * An unstable network affects the audio and video quality in a video call or interactive live video streaming. If option is set as StreamFallbackOptionVideoStreamLow or StreamFallbackOptionAudioOnly, the SDK automatically switches the video from a high-quality stream to a low-quality stream or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. Meanwhile, the SDK continuously monitors network quality and resumes subscribing to audio and video streams when the network quality improves. When the subscribed video stream falls back to an audio-only stream, or recovers from an audio-only stream to an audio-video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback. Ensure that you call this method before joining a channel. + * An unstable network affects the audio and video quality in a video call or interactive live video streaming. If option is set as StreamFallbackOptionVideoStreamLow or StreamFallbackOptionAudioOnly, the SDK automatically switches the video from a high-quality stream to a low-quality stream or disables the video when the downlink network conditions cannot support both audio and video to guarantee the quality of the audio. Meanwhile, the SDK continuously monitors network quality and resumes subscribing to audio and video streams when the network quality improves. When the subscribed video stream falls back to an audio-only stream, or recovers from an audio-only stream to an audio-video stream, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback. * * @param option Fallback options for the subscribed stream. See STREAM_FALLBACK_OPTIONS. * @@ -5069,10 +5050,6 @@ export abstract class IRtcEngine { /** * Enables or disables extensions. * - * To call this method, call it immediately after initializing the IRtcEngine object. - * If you want to enable multiple extensions, you need to call this method multiple times. - * 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. - * * @param provider The name of the extension provider. * @param extension The name of the extension. * @param enable Whether to enable the extension: true : Enable the extension. false : Disable the extension. @@ -5175,12 +5152,10 @@ export abstract class IRtcEngine { /** * Sets the volume of the in-ear monitor. * - * You can call this method either before or after joining a channel. - * - * @param volume The volume of the in-ear monitor. The value range is [0,400]. + * @param volume The volume of the user. The value range is [0,400]. * 0: Mute. * 100: (Default) The original volume. - * 400: Four times the original volume. + * 400: Four times the original volume (amplifying the audio signals by four times). * * @returns * 0: Success. @@ -5190,9 +5165,9 @@ export abstract class IRtcEngine { abstract setInEarMonitoringVolume(volume: number): number; /** - * Adds an extension to the SDK. + * Loads an extension. * - * This method is for Android only. + * This method is used to add extensions external to the SDK (such as those from Extensions Marketplace and SDK extensions) to the SDK. * * @param path The extension library path and name. For example: /library/libagora_segmentation_extension.dll. * @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. @@ -5209,7 +5184,7 @@ export abstract class IRtcEngine { /** * Sets the properties of the extension provider. * - * 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). + * 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. * * @param provider The name of the extension provider. * @param key The key of the extension. @@ -5228,9 +5203,7 @@ export abstract class IRtcEngine { /** * Registers an extension. * - * After the extension is loaded, you can call this method to register the extension. - * Before calling this method, you need to call loadExtensionProvider to load the extension first. - * For extensions external to the SDK (such as those from Extensions Marketplace and SDK Extensions), you need to call this method before calling setExtensionProperty. + * For extensions external to the SDK (such as those from Extensions Marketplace and SDK Extensions), you need to load them before calling this method. Extensions internal to the SDK (those included in the full SDK package) are automatically loaded and registered after the initialization of IRtcEngine. * * @param provider The name of the extension provider. * @param extension The name of the extension. @@ -5561,7 +5534,7 @@ export abstract class IRtcEngine { /** * Enables/Disables the audio route to the speakerphone. * - * If the default audio route of the SDK (see Set the Audio Route) or the setting in setDefaultAudioRouteToSpeakerphone cannot meet your requirements, you can call setEnableSpeakerphone to switch the current audio route. After a successful method call, the SDK triggers the onAudioRoutingChanged callback. This method only sets the audio route in the current channel and does not influence the default audio route. If the user leaves the current channel and joins another channel, the default audio route is used. + * If the default audio route of the SDK or the setting in setDefaultAudioRouteToSpeakerphone cannot meet your requirements, you can call setEnableSpeakerphone to switch the current audio route. After a successful method call, the SDK triggers the onAudioRoutingChanged callback. For the default audio route in different scenarios, see Audio Route. This method only sets the audio route in the current channel and does not influence the default audio route. If the user leaves the current channel and joins another channel, the default audio route is used. * Call this method after joining a channel. * If the user uses an external audio playback device such as a Bluetooth or wired headset, this method does not take effect, and the SDK plays audio through the external device. When the user uses multiple external devices, the SDK plays audio through the last connected device. * @@ -5740,18 +5713,9 @@ export abstract class IRtcEngine { /** * Starts screen capture. * - * This method applies to Android and iOS only. - * On the iOS platform, screen sharing is only available on iOS 12.0 and later. - * The billing for the screen sharing stream is based on the dimensions in ScreenVideoParameters. When you do not pass in a value, Agora bills you at 1280 × 720; when you pass a value in, Agora bills you at that value. For billing details, see. - * If you are using the custom audio source instead of the SDK to capture audio, Agora recommends you add the keep-alive processing logic to your application to avoid screen sharing stopping when the application goes to the background. - * This feature requires high-performance device, and Agora recommends that you use it on iPhone X and later models. - * This method relies on the iOS screen sharing dynamic library AgoraReplayKitExtension.xcframework. If the dynamic library is deleted, screen sharing cannot be enabled normally. - * On the Android platform, if the user has not granted the app screen capture permission, the SDK reports the onPermissionError (2) callback. - * On Android 9 and later, to avoid the application being killed by the system after going to the background, Agora recommends you add the foreground service android.permission.FOREGROUND_SERVICE to the /app/Manifests/AndroidManifest.xml file. - * Due to performance limitations, screen sharing is not supported on Android TV. - * Due to system limitations, if you are using Huawei phones, do not adjust the video encoding resolution of the screen sharing stream during the screen sharing, or you could experience crashes. - * Due to system limitations, some Xiaomi devices do not support capturing system audio during screen sharing. - * To avoid system audio capture failure when screen sharing, Agora recommends that you set the audio application scenario to AudioScenarioGameStreaming by using the setAudioScenario method before joining the channel. + * The billing for the screen sharing stream is based on the dimensions in ScreenVideoParameters : + * When you do not pass in a value, Agora bills you at 1280 × 720. + * When you pass in a value, Agora bills you at that value. For billing examples, see. * * @param captureParams The screen sharing encoding parameters. 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 ScreenCaptureParameters2. * @@ -5770,7 +5734,7 @@ export abstract class IRtcEngine { * If the system audio is not captured when screen sharing is enabled, and then you want to update the parameter configuration and publish the system audio, you can refer to the following steps: * Call this method, and set captureAudio to true. * Call updateChannelMediaOptions, and set publishScreenCaptureAudio to true to publish the audio captured by the screen. - * This method applies to Android and iOS only. + * This method is for Android and iOS only. * On the iOS platform, screen sharing is only available on iOS 12.0 and later. * * @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 ScreenCaptureParameters2. @@ -5844,14 +5808,14 @@ export abstract class IRtcEngine { * Ensure that you call this method after leaving a channel. * * @param callId The current call ID. You can get the call ID by calling getCallId. - * @param rating The rating of the call. The value is between 1 (the lowest score) and 5 (the highest score). If you set a value out of this range, the SDK returns the -2 (ERR_INVALID_ARGUMENT) error. + * @param rating The value is between 1 (the lowest score) and 5 (the highest score). * @param description A description of the call. The string length should be less than 800 bytes. * * @returns * 0: Success. * < 0: Failure. - * -2 (ERR_INVALID_ARGUMENT). - * -3 (ERR_NOT_READY). + * -1: A general error occurs (no specified reason). + * -2: The parameter is invalid. */ abstract rate(callId: string, rating: number, description: string): number; @@ -5866,12 +5830,9 @@ export abstract class IRtcEngine { * @returns * 0: Success. * < 0: Failure. + * -1: A general error occurs (no specified reason). * -2: The parameter is invalid. - * - 3: The SDK is not ready. Possible reasons include the following: - * The initialization of IRtcEngine fails. Reinitialize the IRtcEngine. - * No user has joined the channel when the method is called. Please check your code logic. - * The user has not left the channel when the rate or complain method is called. Please check your code logic. - * The audio module is disabled. The program is not complete. + * -7: The method is called before IRtcEngine is initialized. */ abstract complain(callId: string, description: string): number; @@ -6184,7 +6145,7 @@ export abstract class IRtcEngine { * If the orientation mode of the encoding video (OrientationMode) is fixed portrait mode or the adaptive portrait mode, the watermark uses the portrait orientation. * 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. * Ensure that calling this method after enableVideo. - * If you only want to add a watermark to the media push, you can call this method or the method. + * If you only want to add a watermark to the media push, you can call this method or the startRtmpStreamWithTranscoding method. * 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. * 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. * 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. @@ -6875,10 +6836,7 @@ export abstract class IRtcEngine { /** * Enables the local video preview. * - * You can call this method to enable local video preview. Call this method after the following: - * Call enableVideo to enable the video module. - * The local preview enables the mirror mode by default. - * 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. + * You can call this method to enable local video preview. * * @returns * 0: Success. diff --git a/src/IAgoraRtcEngineEx.ts b/src/IAgoraRtcEngineEx.ts index 1a168af8..75c4ffef 100644 --- a/src/IAgoraRtcEngineEx.ts +++ b/src/IAgoraRtcEngineEx.ts @@ -114,7 +114,7 @@ export abstract class IRtcEngineEx extends IRtcEngine { /** * Sets the video encoder configuration. * - * Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. The config specified in this method is the maximum value under ideal network conditions. If the video engine cannot render the video using the specified config due to unreliable network conditions, the parameters further down the list are considered until a successful configuration is found. + * Sets the encoder configuration for the local video. Each configuration profile corresponds to a set of video parameters, including the resolution, frame rate, and bitrate. * * @param config Video profile. See VideoEncoderConfiguration. * @param connection The connection information. See RtcConnection. @@ -466,7 +466,10 @@ export abstract class IRtcEngineEx extends IRtcEngine { * The playback volume here refers to the mixed volume of a specified remote user. * * @param uid The user ID of the remote user. - * @param volume Audio mixing volume. The value ranges between 0 and 100. The default value is 100, which means the original volume. + * @param volume The volume of the user. The value range is [0,400]. + * 0: Mute. + * 100: (Default) The original volume. + * 400: Four times the original volume (amplifying the audio signals by four times). * @param connection The connection information. See RtcConnection. * * @returns diff --git a/src/IAgoraSpatialAudio.ts b/src/IAgoraSpatialAudio.ts index 61904ff5..34229f08 100644 --- a/src/IAgoraSpatialAudio.ts +++ b/src/IAgoraSpatialAudio.ts @@ -87,7 +87,7 @@ export abstract class ILocalSpatialAudioEngine { /** * Updates the spatial position of the specified remote user. * - * After successfully calling this method, the SDK calculates the spatial audio parameters based on the relative position of the local and remote user. Call this method after joinChannel. + * After successfully calling this method, the SDK calculates the spatial audio parameters based on the relative position of the local and remote user. Call this method after the or joinChannel method. * * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel. * @param posInfo The spatial position of the remote user. See RemoteVoicePositionInfo. @@ -113,7 +113,7 @@ export abstract class ILocalSpatialAudioEngine { /** * Removes the spatial position of the specified remote user. * - * After successfully calling this method, the local user no longer hears the specified remote user. After leaving the channel, to avoid wasting resources, you can also call this method to delete the spatial position of the specified remote user. + * After successfully calling this method, the local user no longer hears the specified remote user. After leaving the channel, to avoid wasting computing resources, call this method to delete the spatial position information of the specified remote user. Otherwise, the user's spatial position information will be saved continuously. When the number of remote users exceeds the number of audio streams that can be received as set in setMaxAudioRecvCount, the system automatically unsubscribes from the audio stream of the user who is furthest away based on relative distance. * * @param uid The user ID. This parameter must be the same as the user ID passed in when the user joined the channel. * diff --git a/src/impl/IAgoraMusicContentCenterImpl.ts b/src/impl/IAgoraMusicContentCenterImpl.ts index b5a3cd54..a0cc2381 100644 --- a/src/impl/IAgoraMusicContentCenterImpl.ts +++ b/src/impl/IAgoraMusicContentCenterImpl.ts @@ -8,6 +8,7 @@ import { MusicChartInfo, MusicCollection, MusicContentCenterConfiguration, + MusicPlayMode, } from '../IAgoraMusicContentCenter'; import { IMediaPlayerImpl } from './IAgoraMediaPlayerImpl'; @@ -174,6 +175,24 @@ export function processIMusicContentCenterEventHandler( // @ts-ignore export class IMusicPlayerImpl extends IMediaPlayerImpl implements IMusicPlayer { + setPlayMode(mode: MusicPlayMode): number { + const apiType = this.getApiTypeFromSetPlayMode(mode); + const jsonParams = { + mode: mode, + toJSON: () => { + return { + mode: mode, + }; + }, + }; + const jsonResults = callIrisApi.call(this, apiType, jsonParams); + return jsonResults.result; + } + + protected getApiTypeFromSetPlayMode(mode: MusicPlayMode): string { + return 'MusicPlayer_setPlayMode_748bee0'; + } + openWithSongCode(songCode: number, startPos: number = 0): number { const apiType = this.getApiTypeFromOpenWithSongCode(songCode, startPos); const jsonParams = { @@ -288,6 +307,24 @@ export class IMusicContentCenterImpl implements IMusicContentCenter { return 'MusicContentCenter_createMusicPlayer'; } + destroyMusicPlayer(musicPlayer: IMusicPlayer): number { + const apiType = this.getApiTypeFromDestroyMusicPlayer(musicPlayer); + const jsonParams = { + music_player: musicPlayer, + toJSON: () => { + return {}; + }, + }; + const jsonResults = callIrisApi.call(this, apiType, jsonParams); + return jsonResults.result; + } + + protected getApiTypeFromDestroyMusicPlayer( + musicPlayer: IMusicPlayer + ): string { + return 'MusicContentCenter_destroyMusicPlayer_876d086'; + } + getMusicCharts(): string { const apiType = this.getApiTypeFromGetMusicCharts(); const jsonParams = {}; @@ -455,11 +492,11 @@ export class IMusicContentCenterImpl implements IMusicContentCenter { const apiType = this.getApiTypeFromGetLyric(songCode, lyricType); const jsonParams = { songCode: songCode, - LyricType: lyricType, + lyricType: lyricType, toJSON: () => { return { songCode: songCode, - LyricType: lyricType, + lyricType: lyricType, }; }, }; diff --git a/src/impl/IAgoraRtcEngineImpl.ts b/src/impl/IAgoraRtcEngineImpl.ts index 3eb536a1..a8a66997 100644 --- a/src/impl/IAgoraRtcEngineImpl.ts +++ b/src/impl/IAgoraRtcEngineImpl.ts @@ -6997,7 +6997,7 @@ export class IRtcEngineImpl implements IRtcEngine { } protected getApiTypeFromDestroyRendererByView(view: any): string { - return ''; + return 'RtcEngine_destroyRendererByView'; } destroyRendererByConfig( @@ -7030,7 +7030,7 @@ export class IRtcEngineImpl implements IRtcEngine { channelId?: string, uid: number = 0 ): string { - return ''; + return 'RtcEngine_destroyRendererByConfig'; } unregisterAudioEncodedFrameObserver( diff --git a/src/internal/MusicContentCenterInternal.ts b/src/internal/MusicContentCenterInternal.ts index 24b1144d..7b4d7b5a 100644 --- a/src/internal/MusicContentCenterInternal.ts +++ b/src/internal/MusicContentCenterInternal.ts @@ -5,6 +5,7 @@ import { IMusicPlayer, Music, MusicCollection, + MusicPlayMode, } from '../IAgoraMusicContentCenter'; import { IMusicContentCenterEvent } from '../extension/IAgoraMusicContentCenterExtension'; import { @@ -131,6 +132,10 @@ export class MusicPlayerInternal this._musicPlayer = new _MusicPlayerInternal(mediaPlayerId); } + setPlayMode(mode: MusicPlayMode): number { + return this._musicPlayer.setPlayMode(mode); + } + openWithSongCode(songCode: number, startPos?: number): number { return this._musicPlayer.openWithSongCode(songCode, startPos); } diff --git a/src/internal/RtcEngineExInternal.ts b/src/internal/RtcEngineExInternal.ts index da5ce002..b5ce9d4d 100644 --- a/src/internal/RtcEngineExInternal.ts +++ b/src/internal/RtcEngineExInternal.ts @@ -27,6 +27,7 @@ import { RtcEngineContext, SDKBuildInfo, } from '../IAgoraRtcEngine'; +import { RtcConnection } from '../IAgoraRtcEngineEx'; import { ILocalSpatialAudioEngine } from '../IAgoraSpatialAudio'; import { IAudioDeviceManager } from '../IAudioDeviceManager'; import { IRtcEngineEvent } from '../extension/IAgoraRtcEngineExtension'; @@ -312,6 +313,15 @@ export class RtcEngineExInternal extends IRtcEngineExImpl { : 'RtcEngine_leaveChannel_2c0e3aa'; } + protected override getApiTypeFromLeaveChannelEx( + connection: RtcConnection, + options?: LeaveChannelOptions + ): string { + return options === undefined + ? 'RtcEngineEx_leaveChannelEx_c81e1a4' + : 'RtcEngineEx_leaveChannelEx_b03ee9a'; + } + protected override getApiTypeFromSetClientRole( role: ClientRoleType, options?: ClientRoleOptions