diff --git a/lib/src/agora_base.dart b/lib/src/agora_base.dart index 5812cbd05..2a48fc1ae 100644 --- a/lib/src/agora_base.dart +++ b/lib/src/agora_base.dart @@ -2643,50 +2643,50 @@ extension LocalAudioStreamStateExt on LocalAudioStreamState { } } -/// Local audio state error codes. +/// @nodoc @JsonEnum(alwaysCreate: true) enum LocalAudioStreamError { - /// 0: The local audio is normal. + /// @nodoc @JsonValue(0) localAudioStreamErrorOk, - /// 1: No specified reason for the local audio failure. Remind your users to try to rejoin the channel. + /// @nodoc @JsonValue(1) localAudioStreamErrorFailure, - /// 2: No permission to use the local audio capturing device. Remind your users to grant permission. Deprecated: This enumerator is deprecated. Please use recordAudio in the onPermissionError callback instead. + /// @nodoc @JsonValue(2) localAudioStreamErrorDeviceNoPermission, - /// 3: (Android and iOS only) The local audio capture device is already in use. Remind your users to check whether another application occupies the microphone. Local audio capture automatically resumes after the microphone is idle for about five seconds. You can also try to rejoin the channel after the microphone is idle. + /// @nodoc @JsonValue(3) localAudioStreamErrorDeviceBusy, - /// 4: The local audio capture fails. + /// @nodoc @JsonValue(4) localAudioStreamErrorRecordFailure, - /// 5: The local audio encoding fails. + /// @nodoc @JsonValue(5) localAudioStreamErrorEncodeFailure, - /// 6: (Windows only) The application cannot find the local audio capture device. Remind your users to check whether the microphone is connected to the device properly in the control plane of the device or if the microphone is working properly. + /// @nodoc @JsonValue(6) localAudioStreamErrorNoRecordingDevice, - /// 7: (Windows only) The application cannot find the local audio playback device. Remind your users to check whether the speaker is connected to the device properly in the control plane of the device or if the speaker is working properly. + /// @nodoc @JsonValue(7) localAudioStreamErrorNoPlayoutDevice, - /// 8: (Android and iOS only) The local audio capture is interrupted by a system call, Siri, or alarm clock. Remind your users to end the phone call, Siri, or alarm clock if the local audio capture is required. + /// @nodoc @JsonValue(8) localAudioStreamErrorInterrupted, - /// 9: (Windows only) The ID of the local audio-capture device is invalid. Check the audio capture device ID. + /// @nodoc @JsonValue(9) localAudioStreamErrorRecordInvalidId, - /// 10: (Windows only) The ID of the local audio-playback device is invalid. Check the audio playback device ID. + /// @nodoc @JsonValue(10) localAudioStreamErrorPlayoutInvalidId, } @@ -2737,69 +2737,66 @@ extension LocalVideoStreamStateExt on LocalVideoStreamState { } } -/// Local video state error codes. +/// @nodoc @JsonEnum(alwaysCreate: true) enum LocalVideoStreamError { - /// 0: The local video is normal. + /// @nodoc @JsonValue(0) localVideoStreamErrorOk, - /// 1: No specified reason for the local video failure. + /// @nodoc @JsonValue(1) localVideoStreamErrorFailure, - /// 2: No permission to use the local video capturing device. Remind the user to grant permissions and rejoin the channel. Deprecated: This enumerator is deprecated. Please use camera in the onPermissionError callback instead. + /// @nodoc @JsonValue(2) localVideoStreamErrorDeviceNoPermission, - /// 3: The local video capturing device is in use. Remind the user to check whether another application occupies the camera. + /// @nodoc @JsonValue(3) localVideoStreamErrorDeviceBusy, - /// 4: The local video capture fails. Remind your user to check whether the video capture device is working properly, whether the camera is occupied by another application, or try to rejoin the channel. + /// @nodoc @JsonValue(4) localVideoStreamErrorCaptureFailure, - /// 5: The local video encoding fails. + /// @nodoc @JsonValue(5) localVideoStreamErrorEncodeFailure, - /// 6: (iOS only) The app is in the background. Remind the user that video capture cannot be performed normally when the app is in the background. + /// @nodoc @JsonValue(6) localVideoStreamErrorCaptureInbackground, - /// 7: (iOS only) The current application window is running in Slide Over, Split View, or Picture in Picture mode, and another app is occupying the camera. Remind the user that the application cannot capture video properly when the app is running in Slide Over, Split View, or Picture in Picture mode and another app is occupying the camera. + /// @nodoc @JsonValue(7) localVideoStreamErrorCaptureMultipleForegroundApps, - /// 8: Fails to find a local video capture device. Remind the user to check whether the camera is connected to the device properly or the camera is working properly, and then to rejoin the channel. + /// @nodoc @JsonValue(8) localVideoStreamErrorDeviceNotFound, - /// 9: (macOS only) The video capture device currently in use is disconnected (such as being unplugged). + /// @nodoc @JsonValue(9) localVideoStreamErrorDeviceDisconnected, - /// 10: (macOS and Windows only) The SDK cannot find the video device in the video device list. Check whether the ID of the video device is valid. + /// @nodoc @JsonValue(10) localVideoStreamErrorDeviceInvalidId, - /// 101: The current video capture device is unavailable due to excessive system pressure. + /// @nodoc @JsonValue(101) localVideoStreamErrorDeviceSystemPressure, - /// 11: (macOS only) The shared window is minimized when you call startScreenCaptureByWindowId to share a window. The SDK cannot share a minimized window. You can cancel the minimization of this window at the application layer, for example by maximizing this window. + /// @nodoc @JsonValue(11) localVideoStreamErrorScreenCaptureWindowMinimized, - /// 12: (macOS and Windows only) The error code indicates that a window shared by the window ID has been closed or a full-screen window shared by the window ID has exited full-screen mode. After exiting full-screen mode, remote users cannot see the shared window. To prevent remote users from seeing a black screen, Agora recommends that you immediately stop screen sharing. Common scenarios reporting this error code: - /// When the local user closes the shared window, the SDK reports this error code. - /// The local user shows some slides in full-screen mode first, and then shares the windows of the slides. After the user exits full-screen mode, the SDK reports this error code. - /// The local user watches a web video or reads a web document in full-screen mode first, and then shares the window of the web video or document. After the user exits full-screen mode, the SDK reports this error code. + /// @nodoc @JsonValue(12) localVideoStreamErrorScreenCaptureWindowClosed, - /// 13: (Windows only) The window being shared is overlapped by another window, so the overlapped area is blacked out by the SDK during window sharing. + /// @nodoc @JsonValue(13) localVideoStreamErrorScreenCaptureWindowOccluded, @@ -2811,27 +2808,27 @@ enum LocalVideoStreamError { @JsonValue(21) localVideoStreamErrorScreenCaptureFailure, - /// 22: (Windows and macOS only) No permission for screen capture. + /// @nodoc @JsonValue(22) localVideoStreamErrorScreenCaptureNoPermission, - /// 23: (Windows only) Screen capture has been paused. Common scenarios reporting this error code: The current screen may have been switched to a secure desktop, such as a UAC dialog box or Winlogon desktop. + /// @nodoc @JsonValue(23) localVideoStreamErrorScreenCapturePaused, - /// 24: (Windows only) Screen capture has resumed from paused state. + /// @nodoc @JsonValue(24) localVideoStreamErrorScreenCaptureResumed, - /// 25: (Windows only) The window for the current screen capture is hidden and not visible on the current screen. + /// @nodoc @JsonValue(25) localVideoStreamErrorScreenCaptureWindowHidden, - /// 26: (Windows only) The window for screen capture has been restored from hidden state. + /// @nodoc @JsonValue(26) localVideoStreamErrorScreenCaptureWindowRecoverFromHidden, - /// 27: (Windows only) The window for screen capture has been restored from minimized state. + /// @nodoc @JsonValue(27) localVideoStreamErrorScreenCaptureWindowRecoverFromMinimized, } @@ -3450,62 +3447,62 @@ extension RtmpStreamPublishStateExt on RtmpStreamPublishState { } } -/// Error codes of the RTMP or RTMPS streaming. +/// @nodoc @JsonEnum(alwaysCreate: true) enum RtmpStreamPublishErrorType { - /// 0: The RTMP or RTMPS streaming has not started or has ended. + /// @nodoc @JsonValue(0) rtmpStreamPublishErrorOk, - /// 1: Invalid argument used. Check the parameter setting. + /// @nodoc @JsonValue(1) rtmpStreamPublishErrorInvalidArgument, - /// 2: The RTMP or RTMPS streaming is encrypted and cannot be published. + /// @nodoc @JsonValue(2) rtmpStreamPublishErrorEncryptedStreamNotAllowed, - /// 3: Timeout for the RTMP or RTMPS streaming. + /// @nodoc @JsonValue(3) rtmpStreamPublishErrorConnectionTimeout, - /// 4: An error occurs in Agora's streaming server. + /// @nodoc @JsonValue(4) rtmpStreamPublishErrorInternalServerError, - /// 5: An error occurs in the CDN server. + /// @nodoc @JsonValue(5) rtmpStreamPublishErrorRtmpServerError, - /// 6: The RTMP or RTMPS streaming publishes too frequently. + /// @nodoc @JsonValue(6) rtmpStreamPublishErrorTooOften, - /// 7: The host publishes more than 10 URLs. Delete the unnecessary URLs before adding new ones. + /// @nodoc @JsonValue(7) rtmpStreamPublishErrorReachLimit, - /// 8: The host manipulates other hosts' URLs. For example, the host updates or stops other hosts' streams. Check your app logic. + /// @nodoc @JsonValue(8) rtmpStreamPublishErrorNotAuthorized, - /// 9: Agora's server fails to find the RTMP or RTMPS streaming. + /// @nodoc @JsonValue(9) rtmpStreamPublishErrorStreamNotFound, - /// 10: The format of the RTMP or RTMPS streaming URL is not supported. Check whether the URL format is correct. + /// @nodoc @JsonValue(10) rtmpStreamPublishErrorFormatNotSupported, - /// 11: The user role is not host, so the user cannot use the CDN live streaming function. Check your application code logic. + /// @nodoc @JsonValue(11) rtmpStreamPublishErrorNotBroadcaster, - /// 13: The updateRtmpTranscoding method is called to update the transcoding configuration in a scenario where there is streaming without transcoding. Check your application code logic. + /// @nodoc @JsonValue(13) rtmpStreamPublishErrorTranscodingNoMixStream, - /// 14: Errors occurred in the host's network. + /// @nodoc @JsonValue(14) rtmpStreamPublishErrorNetDown, @@ -3513,11 +3510,11 @@ enum RtmpStreamPublishErrorType { @JsonValue(15) rtmpStreamPublishErrorInvalidAppid, - /// 16: Your project does not have permission to use streaming services. Refer to Media Push to enable the Media Push permission. + /// @nodoc @JsonValue(16) rtmpStreamPublishErrorInvalidPrivilege, - /// 100: The streaming has been stopped normally. After you stop the Media Push, the SDK returns this value. + /// @nodoc @JsonValue(100) rtmpStreamUnpublishErrorOk, } diff --git a/lib/src/agora_media_base.dart b/lib/src/agora_media_base.dart index 673dc8895..a6de4ea71 100644 --- a/lib/src/agora_media_base.dart +++ b/lib/src/agora_media_base.dart @@ -126,7 +126,7 @@ enum AudioRoute { @JsonValue(4) routeLoudspeaker, - /// 5: The audio route is a bluetooth headset. + /// @nodoc @JsonValue(5) routeHeadsetbluetooth, @@ -1519,7 +1519,7 @@ extension MediaRecorderStreamTypeExt on MediaRecorderStreamType { /// The current recording state. @JsonEnum(alwaysCreate: true) enum RecorderState { - /// -1: An error occurs during the recording. See RecorderErrorCode for the reason. + /// -1: An error occurs during the recording. See for the reason. @JsonValue(-1) recorderStateError, @@ -1545,26 +1545,26 @@ extension RecorderStateExt on RecorderState { } } -/// The reason for the state change. +/// @nodoc @JsonEnum(alwaysCreate: true) enum RecorderErrorCode { - /// 0: No error. + /// @nodoc @JsonValue(0) recorderErrorNone, - /// 1: The SDK fails to write the recorded data to a file. + /// @nodoc @JsonValue(1) recorderErrorWriteFailed, - /// 2: The SDK does not detect any audio and video streams, or audio and video streams are interrupted for more than five seconds during recording. + /// @nodoc @JsonValue(2) recorderErrorNoStream, - /// 3: The recording duration exceeds the upper limit. + /// @nodoc @JsonValue(3) recorderErrorOverMaxDuration, - /// 4: The recording configuration changes. + /// @nodoc @JsonValue(4) recorderErrorConfigChanged, } diff --git a/lib/src/agora_media_player.dart b/lib/src/agora_media_player.dart index c20e8f6b5..6d0516c1a 100644 --- a/lib/src/agora_media_player.dart +++ b/lib/src/agora_media_player.dart @@ -96,7 +96,7 @@ abstract class MediaPlayer { /// /// Returns /// Returns the current playback progress (ms) if the call succeeds. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future getPlayPosition(); /// Gets the number of the media streams in the media resource. @@ -105,7 +105,7 @@ abstract class MediaPlayer { /// /// Returns /// The number of the media streams in the media resource if the method call succeeds. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future getStreamCount(); /// Gets the detailed information of the media stream. @@ -434,7 +434,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future removeAllCaches(); /// Deletes a cached media file that is the least recently used. @@ -443,7 +443,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future removeOldCache(); /// Deletes a cached media file. @@ -454,7 +454,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future removeCacheByUri(String uri); /// Sets the storage path for the media files that you want to cache. @@ -465,7 +465,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future setCacheDir(String path); /// Sets the maximum number of media files that can be cached. @@ -474,7 +474,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future setMaxCacheFileCount(int count); /// Sets the maximum size of the aggregate storage space for cached media files. @@ -483,7 +483,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future setMaxCacheFileSize(int cacheSize); /// Sets whether to delete cached media files automatically. @@ -494,7 +494,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future enableAutoRemoveCache(bool enable); /// Gets the storage path of the cached media files. @@ -505,7 +505,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// The call succeeds, and the SDK returns the storage path of the cached media files. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future getCacheDir(int length); /// Gets the maximum number of media files that can be cached. @@ -514,7 +514,7 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// > 0: The call succeeds and returns the maximum number of media files that can be cached. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future getMaxCacheFileCount(); /// Gets the maximum size of the aggregate storage space for cached media files. @@ -523,14 +523,14 @@ abstract class MediaPlayerCacheManager { /// /// Returns /// > 0: The call succeeds and returns the maximum size (in bytes) of the aggregate storage space for cached media files. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future getMaxCacheFileSize(); /// Gets the number of media files that are cached. /// /// Returns /// ≥ 0: The call succeeds and returns the number of media files that are cached. - /// < 0: Failure. See MediaPlayerError. + /// < 0: Failure. Future getCacheFileCount(); } diff --git a/lib/src/agora_media_player_source.dart b/lib/src/agora_media_player_source.dart index c55853102..f92633448 100644 --- a/lib/src/agora_media_player_source.dart +++ b/lib/src/agora_media_player_source.dart @@ -22,7 +22,7 @@ class MediaPlayerSourceObserver { /// When the state of the media player changes, the SDK triggers this callback to report the current playback state. /// /// * [state] The playback state. See MediaPlayerState. - /// * [ec] The error code. See MediaPlayerError. + /// * [ec] The error code. final void Function(MediaPlayerState state, MediaPlayerError ec)? onPlayerSourceStateChanged; diff --git a/lib/src/agora_media_player_types.dart b/lib/src/agora_media_player_types.dart index 4bbf71a9e..c8963717b 100644 --- a/lib/src/agora_media_player_types.dart +++ b/lib/src/agora_media_player_types.dart @@ -85,70 +85,70 @@ extension MediaPlayerStateExt on MediaPlayerState { } } -/// Error codes of the media player. +/// @nodoc @JsonEnum(alwaysCreate: true) enum MediaPlayerError { - /// 0: No error. + /// @nodoc @JsonValue(0) playerErrorNone, - /// -1: Invalid arguments. + /// @nodoc @JsonValue(-1) playerErrorInvalidArguments, - /// -2: Internal error. + /// @nodoc @JsonValue(-2) playerErrorInternal, - /// -3: No resource. + /// @nodoc @JsonValue(-3) playerErrorNoResource, - /// -4: Invalid media resource. + /// @nodoc @JsonValue(-4) playerErrorInvalidMediaSource, - /// -5: The media stream type is unknown. + /// @nodoc @JsonValue(-5) playerErrorUnknownStreamType, - /// -6: The object is not initialized. + /// @nodoc @JsonValue(-6) playerErrorObjNotInitialized, - /// -7: The codec is not supported. + /// @nodoc @JsonValue(-7) playerErrorCodecNotSupported, - /// -8: Invalid renderer. + /// @nodoc @JsonValue(-8) playerErrorVideoRenderFailed, - /// -9: An error with the internal state of the player occurs. + /// @nodoc @JsonValue(-9) playerErrorInvalidState, - /// -10: The URL of the media resource cannot be found. + /// @nodoc @JsonValue(-10) playerErrorUrlNotFound, - /// -11: Invalid connection between the player and the Agora Server. + /// @nodoc @JsonValue(-11) playerErrorInvalidConnectionState, - /// -12: The playback buffer is insufficient. + /// @nodoc @JsonValue(-12) playerErrorSrcBufferUnderflow, - /// -13: The playback is interrupted. + /// @nodoc @JsonValue(-13) playerErrorInterrupted, - /// -14: The SDK does not support the method being called. + /// @nodoc @JsonValue(-14) playerErrorNotSupported, - /// -15: The authentication information of the media resource is expired. + /// @nodoc @JsonValue(-15) playerErrorTokenExpired, @@ -156,7 +156,7 @@ enum MediaPlayerError { @JsonValue(-16) playerErrorIpExpired, - /// -17: An unknown error. + /// @nodoc @JsonValue(-17) playerErrorUnknown, } diff --git a/lib/src/agora_rhythm_player.dart b/lib/src/agora_rhythm_player.dart index 3eed312a5..3ee92f335 100644 --- a/lib/src/agora_rhythm_player.dart +++ b/lib/src/agora_rhythm_player.dart @@ -38,26 +38,26 @@ extension RhythmPlayerStateTypeExt on RhythmPlayerStateType { } } -/// Virtual Metronome error message. +/// @nodoc @JsonEnum(alwaysCreate: true) enum RhythmPlayerErrorType { - /// (0): The beat files are played normally without errors. + /// @nodoc @JsonValue(0) rhythmPlayerErrorOk, - /// 1: A general error; no specific reason. + /// @nodoc @JsonValue(1) rhythmPlayerErrorFailed, - /// 801: There is an error when opening the beat files. + /// @nodoc @JsonValue(801) rhythmPlayerErrorCanNotOpen, - /// 802: There is an error when playing the beat files. + /// @nodoc @JsonValue(802) rhythmPlayerErrorCanNotPlay, - /// (803): The duration of the beat file exceeds the limit. The maximum duration is 1.2 seconds. + /// @nodoc @JsonValue(803) rhythmPlayerErrorFileOverDurationLimit, } diff --git a/lib/src/agora_rtc_engine.dart b/lib/src/agora_rtc_engine.dart index 410f2454c..bd64d4aa5 100644 --- a/lib/src/agora_rtc_engine.dart +++ b/lib/src/agora_rtc_engine.dart @@ -283,18 +283,18 @@ extension AudioReverbTypeExt on AudioReverbType { } } -/// @nodoc +/// Stream fallback options. @JsonEnum(alwaysCreate: true) enum StreamFallbackOptions { - /// @nodoc + /// 0: No fallback behavior for the local/remote video stream when the uplink/downlink network conditions are poor. The quality of the stream is not guaranteed. @JsonValue(0) streamFallbackOptionDisabled, - /// @nodoc + /// 1: Under poor downlink network conditions, the remote video stream, to which you subscribe, falls back to the low-quality (low resolution and low bitrate) video stream. This option is only valid for setRemoteSubscribeFallbackOption. @JsonValue(1) streamFallbackOptionVideoStreamLow, - /// @nodoc + /// 2: Under poor uplink network conditions, the published video stream falls back to audio-only. Under poor downlink network conditions, the remote video stream, to which you subscribe, first falls back to the low-quality (low resolution and low bitrate) video stream; and then to an audio-only stream if the network conditions worsen. @JsonValue(2) streamFallbackOptionAudioOnly, } @@ -1874,15 +1874,15 @@ class RtcEngineEventHandler { /// Occurs when the local video stream state changes. /// - /// 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: + /// 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 in the following situations: /// The app switches to the background, and the system gets the camera resource. /// If your app runs in the background on a device running Android 9 or later, you cannot access the camera. - /// If your app runs in the background on a device running Android 6 or later, the camera is occupied by a third-party app. Once the camera is released, the SDK triggers the onLocalVideoStateChanged (localVideoStreamStateCapturing, localVideoStreamErrorOk) callback. - /// 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. + /// If your app runs in the background on a device running Android 6 or later, the camera is occupied by a third-party app. Once the camera is released, the SDK triggers the onLocalVideoStateChanged (localVideoStreamStateCapturing,) callback. + /// 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. 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. /// /// * [source] The type of the video source. See VideoSourceType. /// * [state] The state of the local video, see LocalVideoStreamState. - /// * [error] The detailed error information, see LocalVideoStreamError. + /// * [error] The detailed error information, see. final void Function(VideoSourceType source, LocalVideoStreamState state, LocalVideoStreamError error)? onLocalVideoStateChanged; @@ -2082,7 +2082,7 @@ class RtcEngineEventHandler { /// When the state of the virtual metronome changes, the SDK triggers this callback to report the current state of the virtual metronome. This callback indicates the state of the local audio stream and enables you to troubleshoot issues when audio exceptions occur. This callback is for Android and iOS only. /// /// * [state] For the current virtual metronome status, see RhythmPlayerStateType. - /// * [errorCode] For the error codes and error messages related to virtual metronome errors, see RhythmPlayerErrorType. + /// * [errorCode] For the error codes and error messages related to virtual metronome errors, see. final void Function( RhythmPlayerStateType state, RhythmPlayerErrorType errorCode)? onRhythmPlayerStateChanged; @@ -2202,7 +2202,7 @@ class RtcEngineEventHandler { /// /// * [connection] The connection information. See RtcConnection. /// * [state] The state of the local audio. See LocalAudioStreamState. - /// * [error] Local audio state error codes. See LocalAudioStreamError. + /// * [error] Local audio state error codes. final void Function(RtcConnection connection, LocalAudioStreamState state, LocalAudioStreamError error)? onLocalAudioStateChanged; @@ -2295,7 +2295,7 @@ class RtcEngineEventHandler { /// /// * [url] The URL address where the state of the Media Push changes. /// * [state] The current state of the Media Push. See RtmpStreamPublishState. - /// * [errCode] The detailed error information for the Media Push. See RtmpStreamPublishErrorType. + /// * [errCode] The detailed error information for the Media Push. final void Function(String url, RtmpStreamPublishState state, RtmpStreamPublishErrorType errCode)? onRtmpStreamingStateChanged; @@ -2339,7 +2339,12 @@ class RtcEngineEventHandler { final void Function(bool isFallbackOrRecover)? onLocalPublishFallbackToAudioOnly; - /// @nodoc + /// Occurs when the remote media stream falls back to the audio-only stream due to poor network conditions or switches back to the video stream after the network conditions improve. + /// + /// If you call setRemoteSubscribeFallbackOption and set option as streamFallbackOptionAudioOnly, the SDK triggers this callback when the remote media stream falls back to audio-only mode due to poor uplink conditions, or when the remote media stream switches back to the video after the downlink network condition improves. Once the remote media stream switches to the low-quality stream due to poor network conditions, you can monitor the stream switch between a high-quality and low-quality stream in the onRemoteVideoStats callback. + /// + /// * [uid] The user ID of the remote user. + /// * [isFallbackOrRecover] true : The remotely subscribed media stream falls back to audio-only due to poor network conditions. false : The remotely subscribed media stream switches back to the video stream after the network conditions improved. final void Function(int uid, bool isFallbackOrRecover)? onRemoteSubscribeFallbackToAudioOnly; @@ -2793,30 +2798,30 @@ class Metadata { Map toJson() => _$MetadataToJson(this); } -/// The CDN streaming error. +/// @nodoc @JsonEnum(alwaysCreate: true) enum DirectCdnStreamingError { - /// 0: No error. + /// @nodoc @JsonValue(0) directCdnStreamingErrorOk, - /// 1: A general error; no specific reason. You can try to push the media stream again. + /// @nodoc @JsonValue(1) directCdnStreamingErrorFailed, - /// 2: An error occurs when pushing audio streams. For example, the local audio capture device is not working properly, is occupied by another process, or does not get the permission required. + /// @nodoc @JsonValue(2) directCdnStreamingErrorAudioPublication, - /// 3: An error occurs when pushing video streams. For example, the local video capture device is not working properly, is occupied by another process, or does not get the permission required. + /// @nodoc @JsonValue(3) directCdnStreamingErrorVideoPublication, - /// 4: Fails to connect to the CDN. + /// @nodoc @JsonValue(4) directCdnStreamingErrorNetConnect, - /// 5: The URL is already being used. Use a new URL for streaming. + /// @nodoc @JsonValue(5) directCdnStreamingErrorBadName, } @@ -2923,7 +2928,7 @@ class DirectCdnStreamingEventHandler { /// When the host directly pushes streams to the CDN, if the streaming state changes, the SDK triggers this callback to report the changed streaming state, error codes, and other information. You can troubleshoot issues by referring to this callback. /// /// * [state] The current CDN streaming state. See DirectCdnStreamingState. - /// * [error] The CDN streaming error. See DirectCdnStreamingError. + /// * [error] The CDN streaming error. /// * [message] The information about the changed streaming state. final void Function( DirectCdnStreamingState state, @@ -4875,7 +4880,15 @@ abstract class RtcEngine { /// @nodoc Future setLocalPublishFallbackOption(StreamFallbackOptions option); - /// @nodoc + /// Sets the fallback option for the remotely subscribed video stream based on the network conditions. + /// + /// When the network is not ideal, the quality of live audio and video can be degraded. 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. The SDK monitors the network quality and restores the video stream when the network conditions improve. When the remote video stream falls back to audio-only or when the audio-only stream switches back to the video, the SDK triggers the onRemoteSubscribeFallbackToAudioOnly callback. Ensure that you call this method before joining a channel. + /// + /// * [option] The fallback option for the remotely subscribed video stream. The default value is streamFallbackOptionVideoStreamLow (1). See StreamFallbackOptions. + /// + /// Returns + /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. + /// < 0: Failure. Future setRemoteSubscribeFallbackOption(StreamFallbackOptions option); /// @nodoc diff --git a/lib/src/audio_device_manager.dart b/lib/src/audio_device_manager.dart index 47319d9a8..9d5b15c6b 100644 --- a/lib/src/audio_device_manager.dart +++ b/lib/src/audio_device_manager.dart @@ -69,10 +69,19 @@ abstract class AudioDeviceManager { /// An AudioDeviceInfo object, which contains the ID and device name of the audio devices. Future getPlaybackDeviceInfo(); - /// @nodoc + /// Sets the volume of the audio playback device. + /// + /// * [volume] The volume of the audio playback device. The value ranges between 0 (lowest volume) and 255 (highest volume). + /// + /// Returns + /// When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown; and you need to catch the exception and handle it accordingly. + /// < 0: Failure. Future setPlaybackDeviceVolume(int volume); - /// @nodoc + /// Retrieves the volume of the audio playback device. + /// + /// Returns + /// The volume of the audio playback device. The value range is [0,255]. Future getPlaybackDeviceVolume(); /// Sets the audio capture device. @@ -113,7 +122,10 @@ abstract class AudioDeviceManager { /// < 0: Failure. Future setRecordingDeviceVolume(int volume); - /// @nodoc + /// Retrieves the volume of the audio recording device. + /// + /// Returns + /// The volume of the audio recording device. The value range is [0,255]. Future getRecordingDeviceVolume(); /// Sets the loopback device.