openharmony 鸿蒙 arkts-apis-media-e

2026-08-25 浏览 (1)

Enums

NOTE

The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.

AVErrorCode9+

Enumerates the types of Media error codes.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
AVERR_OK0The operation is successful.
AVERR_NO_PERMISSION201No permission to perform the operation.
AVERR_INVALID_PARAMETER401Invalid input parameter.
AVERR_UNSUPPORT_CAPABILITY801Unsupported API.
AVERR_NO_MEMORY5400101The system memory is insufficient or the number of services reaches the upper limit.
AVERR_OPERATE_NOT_PERMIT5400102The operation is not allowed in the current state or you do not have the permission to perform the operation.
AVERR_IO5400103The data stream is abnormal.
AVERR_TIMEOUT5400104The system or network response times out.
AVERR_SERVICE_DIED5400105The service process is dead.
AVERR_UNSUPPORT_FORMAT5400106The format of the media asset is not supported.
AVERR_AUDIO_INTERRUPTED11+5400107The audio focus is interrupted.
AVERR_IO_HOST_NOT_FOUND14+5411001Failed to parse the server address or connect to the server.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_CONNECTION_TIMEOUT14+5411002Network connection times out.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_NETWORK_ABNORMAL14+5411003Data or links are abnormal due to network exceptions.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_NETWORK_UNAVAILABLE14+5411004The network is disabled.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_NO_PERMISSION14+5411005No access permission.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_REQUEST_DENIED14+5411006The client request parameter is incorrect or exceeds the processing capability.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_RESOURCE_NOT_FOUND14+5411007No network resource is available.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_SSL_CLIENT_CERT_NEEDED14+5411008The server fails to verify the client certificate.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_SSL_CONNECTION_FAILED14+5411009The SSL connection fails.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_SSL_SERVER_CERT_UNTRUSTED14+5411010The client fails to verify the server certificate.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_IO_UNSUPPORTED_REQUEST14+5411011The request is not supported due to a network protocol error.
Atomic service API: This API can be used in atomic services since API version 14.
AVERR_SEEK_CONTINUOUS_UNSUPPORTED18+5410002The seek operation in SEEK_CONTINUOUS mode is not supported.
Atomic service API: This API can be used in atomic services since API version 18.
AVERR_SUPER_RESOLUTION_UNSUPPORTED18+5410003Super resolution is not supported.
Atomic service API: This API can be used in atomic services since API version 18.
AVERR_SUPER_RESOLUTION_NOT_ENABLED18+5410004Super resolution is not enabled.
Atomic service API: This API can be used in atomic services since API version 18.
AVERR_PARAMETER_OUT_OF_RANGE20+5400108The parameter value is out of range.
Atomic service API: This API can be used in atomic services since API version 20.
AVERR_IO_CLEARTEXT_NOT_PERMITTED23+5411012HTTP plaintext access is not allowed.
Atomic service API: This API can be used in atomic services since API version 23.

MediaType8+

Enumerates the media types.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
MEDIA_TYPE_UNSUPPORTED20+-1The media type is not supported.
Atomic service API: This API can be used in atomic services since API version 20.
MEDIA_TYPE_AUD0Media.
Atomic service API: This API can be used in atomic services since API version 11.
MEDIA_TYPE_VID1Video.
Atomic service API: This API can be used in atomic services since API version 11.
MEDIA_TYPE_SUBTITLE12+2Subtitle.
Atomic service API: This API can be used in atomic services since API version 12.
MEDIA_TYPE_ATTACHMENT20+3Attachment information (for example, an embedded external file).
Atomic service API: This API can be used in atomic services since API version 20.
MEDIA_TYPE_DATA20+4Data.
Atomic service API: This API can be used in atomic services since API version 20.
MEDIA_TYPE_TIMED_METADATA20+5Metadata with a timestamp.
Atomic service API: This API can be used in atomic services since API version 20.
MEDIA_TYPE_AUXILIARY20+6Auxiliary (track) information.
Atomic service API: This API can be used in atomic services since API version 20.

CodecMimeType8+

Enumerates the codec MIME types.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
VIDEO_H263'video/h263'Video in H.263 format.
VIDEO_AVC'video/avc'Video in AVC format.
Atomic service API: This API can be used in atomic services since API version 22.
VIDEO_MPEG2'video/mpeg2'Video in MPEG-2 format.
VIDEO_MPEG4'video/mp4v-es'Video in MPEG-4 format.
VIDEO_VP8'video/x-vnd.on2.vp8'Video in VP8 format.
VIDEO_HEVC11+'video/hevc'Video in H.265 format.
Atomic service API: This API can be used in atomic services since API version 22.
AUDIO_AAC'audio/mp4a-latm'Audio in MP4A-LATM format.
Atomic service API: This API can be used in atomic services since API version 12.
AUDIO_VORBIS'audio/vorbis'Audio in Vorbis format.
AUDIO_FLAC'audio/flac'Audio in FLAC format.
AUDIO_MP312+'audio/mpeg'Audio in MPEG format.
AUDIO_G711MU12+'audio/g711mu'Audio in G.711 μ-law format.
AUDIO_AMR_NB18+'audio/3gpp'Audio in AMR-NB format.
AUDIO_AMR_WB18+'audio/amr-wb'Audio in AMR-WB format.

AacProfile22+

Enumerates the supported Advanced Audio Coding (AAC) formats.

Atomic service API: This API can be used in atomic services since API version 22.

System capability: SystemCapability.Multimedia.Media.AVRecorder

NameValueDescription
AAC_LC0Standard AAC Low Complexity profile.
AAC_HE1Standard AAC High Efficiency profile.
AAC_HE_V22AAC High Efficiency Version 2 profile (also known as HE-AAC v2).

MediaDescriptionKey8+

Enumerates the media description keys.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
MD_KEY_TRACK_INDEX'track_index'Track index. The corresponding key value type is number.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_TRACK_TYPE'track_type'Track type. The corresponding key value type is number. For details, see MediaType.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_CODEC_MIME'codec_mime'Codec MIME type. The corresponding key value type is string.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_DURATION'duration'Media duration. The corresponding key value type is number, measured in ms.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_BITRATE'bitrate'Bit rate. The corresponding key value type is number, measured in bit/s. If the value is undefined or 0, the bit rate is abnormal.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_WIDTH'width'Video width. The corresponding key value type is number, measured in px.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_HEIGHT'height'Video height. The corresponding key value type is number, measured in px.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_FRAME_RATE'frame_rate'Video frame rate. The corresponding key value type is number, measured in frames per 100 seconds.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_AUD_CHANNEL_COUNT'channel_count'Audio channel count. The corresponding key value type is number.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_AUD_SAMPLE_RATE'sample_rate'Sample rate. The corresponding key value type is number, measured in Hz.
Atomic service API: This API can be used in atomic services since API version 11.
MD_KEY_AUD_SAMPLE_DEPTH12+'sample_depth'Bit depth. The corresponding key value type is number, measured in bits.
Atomic service API: This API can be used in atomic services since API version 12.
MD_KEY_LANGUAGE12+'language'Subtitle language. The corresponding key value type is string.
Atomic service API: This API can be used in atomic services since API version 12.
MD_KEY_TRACK_NAME12+'track_name'Track name. The corresponding key value type is string.
Atomic service API: This API can be used in atomic services since API version 12.
MD_KEY_HDR_TYPE12+'hdr_type'Codec track type. The corresponding key value type is string.
Atomic service API: This API can be used in atomic services since API version 12.
MD_KEY_ORIGINAL_WIDTH21+'original_width'Original video width. The corresponding key value type is number, measured in px.
Atomic service API: This API can be used in atomic services since API version 21.
MD_KEY_ORIGINAL_HEIGHT21+'original_height'Original video height. The corresponding key value type is number, measured in px.
Atomic service API: This API can be used in atomic services since API version 21.
MD_KEY_MIME_TYPE23+'mime_type'MIME type of the track. The corresponding key value type is string. For audio and video tracks, the value is the same as that of MD_KEY_CODEC_MIME.
Atomic service API: This API can be used in atomic services since API version 23.
MD_KEY_REFERENCE_TRACK_IDS23+'ref_track_ids'Reference relationships between this track and other tracks. The corresponding key value type is string, with values separated by commas (,).
Atomic service API: This API can be used in atomic services since API version 23.
MD_KEY_TRACK_REFERENCE_TYPE23+'track_ref_type'Auxiliary type of this track when it acts as a reference track. The corresponding key value type is string.
Atomic service API: This API can be used in atomic services since API version 23.

FetchResult23+

Enumerates the results of obtaining thumbnails in batches.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Media.AVMetadataExtractor

NameValueDescription
FETCH_FAILED0Failed to obtain the thumbnail from the video.
FETCH_SUCCEEDED1Succeeded in obtaining the thumbnail from the video.
FETCH_CANCELED2The operation of obtaining the thumbnail from the video is canceled.

PlaybackInfoKey12+

Enumerates the playback description keys.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
SERVER_IP_ADDRESS'server_ip_address'IP address of the server. The corresponding key value type is string.
AVG_DOWNLOAD_RATE'average_download_rate'Average download rate. The corresponding key value type is number, measured in bit/s.
DOWNLOAD_RATE'download_rate'Download rate in one second. The corresponding key value type is number, measured in bit/s.
IS_DOWNLOADING'is_downloading'Download status. The corresponding key value type is number. The value 1 means that the downloaded is in progress, and 0 means that the download is complete.
BUFFER_DURATION'buffer_duration'Duration that the cached data can be played. The corresponding key value type is number, measured in seconds.

PlaybackMetricsKey23+

Enumerates the playback metric keys.

System capability: SystemCapability.Multimedia.Media.AVPlayer

NameValueDescription
PREPARE_DURATION'prepare_duration'Preparation duration, in milliseconds.
RESOURCE_CONNECTION_DURATION'resource_connection_duration'Duration for establishing a resource connection, in milliseconds.
FIRST_FRAME_DECAPSULATION_DURATION'first_frame_decapsulation_duration'Duration for decapsulating the first frame, in milliseconds.
TOTAL_PLAYING_TIME'total_playback_time'Total playback duration, in milliseconds.
DOWNLOAD_REQUESTS_COUNT'loading_requests_count'Total number of requests.
Model restriction: This API can be used only in the stage model.
TOTAL_DOWNLOAD_TIME'total_loading_time'Total loading duration, in milliseconds.
TOTAL_DOWNLOAD_SIZE'total_loading_bytes'Total loading size, in bytes.
Model restriction: This API can be used only in the stage model.
STALLING_COUNT'stalling_count'Total number of stalling times.
TOTAL_STALLING_TIME'total_stalling_time'Total stalling duration, in milliseconds.

BufferingInfoType8+

Enumerates the buffering event types.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
BUFFERING_START1Buffering starts. When this event is triggered, the player pauses the playback.
Atomic service API: This API can be used in atomic services since API version 12.
BUFFERING_END2Buffering ends. When this event is triggered, the player resumes the playback.
Atomic service API: This API can be used in atomic services since API version 12.
BUFFERING_PERCENT3Buffering percentage. You can use this event to monitor the buffering status.
Atomic service API: This API can be used in atomic services since API version 12.
CACHED_DURATION4Estimated duration, in ms, that the buffered data can be played. This event is triggered once the data change amount in the buffer exceeds 500 ms. You can use this event to develop a progress bar.
Atomic service API: This API can be used in atomic services since API version 12.

SoundInterruptMode23+

Enumerates the interruption modes of the audio files with the same ID in SoundPool.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Media.SoundPool

NameValueDescription
NO_INTERRUPT0If the former audio file is not completely played, the latter audio file with the same ID does not interrupt the former audio file. Two audio files are played concurrently.
SAME_SOUND_INTERRUPT1If the former audio file is not completely played, the latter audio file with the same ID interrupts the former audio file.

StateChangeReason9+

Enumerates the reasons for the state transition of the AVPlayer or AVRecorder instance. The enum value is reported together with state.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
USER1State transition triggered by user behavior. It happens when a user or the client calls an API.
BACKGROUND2State transition caused by background system behavior. For example, if an application does not have the permission of Media Controller, the application is forcibly suspended or stopped by the system when it switches to the background.

SeekMode8+

Enumerates the video playback seek modes, which can be passed in the seek API.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
SEEK_NEXT_SYNC0Seeks to the next key frame at the specified position. You are advised to use this value for the rewind operation.
Atomic service API: This API can be used in atomic services since API version 11.
SEEK_PREV_SYNC1Seeks to the previous key frame at the specified position. You are advised to use this value for the fast-forward operation.
Atomic service API: This API can be used in atomic services since API version 11.
SEEK_CLOSEST12+2Seeks to the frame closest to the specified position. You are advised to use this value for accurate seek.
Atomic service API: This API can be used in atomic services since API version 12.
SEEK_CONTINUOUS18+3Offers a smooth and fluid visual experience for seeking. Applications can use a progress bar component to continuously invoke the seek method, and the AVPlayer will update the video frames smoothly in response to these calls.
Applications can call isSeekContinuousSupported to check whether the video source supports this seeking mode.
If the video source does not support this mode, calling seek will result in an AVERR_SEEK_CONTINUOUS_UNSUPPORTED error (see AVErrorCode), and the smoothness of frame updates will be compromised.
This seek mode does not trigger the on('seekDone') event.
To exit this seeking mode, applications must call seek(-1, SeekMode.SEEK_CONTINUOUS) to end the seeking process.
Atomic service API: This API can be used in atomic services since API version 18.

SwitchMode12+

Enumerates the selectTrack modes for video playback.

SwitchMode can be passed as a parameter through the selectTrack method. Currently, both DASH and HLS video tracks support this extended parameter. (HLS video tracks support this extended parameter since API version 24.)

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
SMOOTH0Smooth playback is ensured after the switching. This mode has a delay, that is, the switching does not take effect immediately.
Atomic service API: This API can be used in atomic services since API version 12.
SEGMENT1The playback starts from the start position of the current segment after the switching. In this mode, the switching takes effect immediately and repeated playback may occur.
Atomic service API: This API can be used in atomic services since API version 12.
CLOSEST2The playback starts from the frame closest to the current playback time. In this mode, the switching takes effect immediately, and the playback is suspended for 3s to 5s and then resumed.
Atomic service API: This API can be used in atomic services since API version 12.

PlaybackSpeed8+

Enumerates the video playback speeds, which can be passed in the setSpeed API.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.Media.VideoPlayer

NameValueDescription
SPEED_FORWARD_0_75_X0Plays the video at 0.75 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_1_00_X1Plays the video at the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_1_25_X2Plays the video at 1.25 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_1_75_X3Plays the video at 1.75 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_2_00_X4Plays the video at 2.00 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_0_50_X12+5Plays the video at 0.50 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_1_50_X12+6Plays the video at 1.50 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_3_00_X13+7Plays the video at 3.00 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 13.
SPEED_FORWARD_0_25_X12+8Plays the video at 0.25 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.
SPEED_FORWARD_0_125_X12+9Plays the video at 0.125 times the normal speed.
Atomic service API: This API can be used in atomic services since API version 12.

VideoScaleType9+

Enumerates the video scale modes.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.Media.VideoPlayer

NameValueDescription
VIDEO_SCALE_TYPE_FIT0Default mode. The video will be stretched to fit the window.
VIDEO_SCALE_TYPE_FIT_CROP1Maintains the video's aspect ratio, and scales to fill the shortest side of the window, with the longer side cropped.
VIDEO_SCALE_TYPE_SCALED_ASPECT20+2Maintains the video's aspect ratio, and scales to fill the longer side of the window, with the shorter side centered and unfilled parts left black.
Atomic service API: This API can be used in atomic services since API version 20.

AudioSourceType9+

Enumerates the audio source types for video recording.

System capability: SystemCapability.Multimedia.Media.AVRecorder

NameValueDescription
AUDIO_SOURCE_TYPE_DEFAULT0Default audio input source.
AUDIO_SOURCE_TYPE_MIC1Microphone audio input source.
Atomic service API: This API can be used in atomic services since API version 12.
AUDIO_SOURCE_TYPE_VOICE_RECOGNITION12+2Audio source in speech recognition scenarios.
AUDIO_SOURCE_TYPE_VOICE_COMMUNICATION12+7Voice communication source.
AUDIO_SOURCE_TYPE_VOICE_MESSAGE12+10Voice message source.
AUDIO_SOURCE_TYPE_CAMCORDER12+13Audio source in camera recording scenarios.

VideoSourceType9+

Enumerates the video source types for video recording.

System capability: SystemCapability.Multimedia.Media.AVRecorder

NameValueDescription
VIDEO_SOURCE_TYPE_SURFACE_YUV0The input surface carries raw data.
VIDEO_SOURCE_TYPE_SURFACE_ES1The input surface carries ES data.

ContainerFormatType8+

Enumerates the container format types (CFTs).

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
CFT_MPEG_4'mp4'Video container format MP4.
Atomic service API: This API can be used in atomic services since API version 22.
CFT_MPEG_4A'm4a'Audio container format M4A.
Atomic service API: This API can be used in atomic services since API version 12.
CFT_MP312+'mp3'Audio container format MP3.
CFT_WAV12+'wav'Audio container format WAV.
CFT_AMR18+'amr'Audio container format AMR.
CFT_AAC20+'aac'Audio container format AAC. The default format is ADTS frame header.

FileGenerationMode12+

Enumerates the modes for creating media files.

System capability: SystemCapability.Multimedia.Media.AVRecorder

NameValueDescription
APP_CREATE0The application creates a media file in the sandbox.
AUTO_CREATE_CAMERA_SCENE1The system creates a media file. Currently, this mode takes effect only in camera recording scenarios. The URL set by the application is ignored.

HdrType12+

Enumerates the HDR types.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
AV_HDR_TYPE_NONE0No HDR.
AV_HDR_TYPE_VIVID1HDR VIVID.

AVImageQueryOptions12+

Enumerates the relationship between the video frame and the time at which the video thumbnail is obtained.

The time passed in for obtaining the thumbnail may be different from the time of the video frame for which the thumbnail is actually obtained. Therefore, you need to specify their relationship.

System capability: SystemCapability.Multimedia.Media.AVImageGenerator

NameValueDescription
AV_IMAGE_QUERY_NEXT_SYNC0The key frame at or next to the specified time is selected.
AV_IMAGE_QUERY_PREVIOUS_SYNC1The key frame at or prior to the specified time is selected.
AV_IMAGE_QUERY_CLOSEST_SYNC2The key frame closest to the specified time is selected.
AV_IMAGE_QUERY_CLOSEST3The frame (not necessarily a key frame) closest to the specified time is selected.

LoadingRequestError18+

Enumerates the reasons for data loading status changes.

Atomic service API: This API can be used in atomic services since API version 18.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
LOADING_ERROR_SUCCESS0Returned by the client to indicate that the end of the resource.
LOADING_ERROR_NOT_READY1Returned by the client to indicate that the resource is not ready for access.
LOADING_ERROR_NO_RESOURCE2Returned by the client to indicate that the requested resource URL does not exist.
LOADING_ERROR_INVAID_HANDLE3Returned by the client to indicate that the ID of the requested resource handle (specified by uuid) is invalid.
LOADING_ERROR_ACCESS_DENIED4Returned by the client to indicate that the client does not have permission to request the resource.
LOADING_ERROR_ACCESS_TIMEOUT5Returned by the client to indicate that the access to the resource times out.
LOADING_ERROR_AUTHORIZE_FAILED6Returned by the client to indicate that authorization fails.

AVMimeTypes12+

Enumerates the MIME type, which is set by using setMimeType.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
APPLICATION_M3U8application/m3u8Local M3U8 file.

AVScreenCaptureRecordPreset12+

Enumerates the encoding and container formats used during screen capture.

System capability: SystemCapability.Multimedia.Media.AVScreenCapture

NameValueDescription
SCREEN_RECORD_PRESET_H264_AAC_MP40The H.264 video encoding format, AAC audio encoding format, and MP4 container format are used.
SCREEN_RECORD_PRESET_H265_AAC_MP41The H.265 video encoding format, AAC audio encoding format, and MP4 container format are used.

AVScreenCaptureStateCode12+

Enumerates the screen capture states used in callbacks.

System capability: SystemCapability.Multimedia.Media.AVScreenCapture

NameValueDescription
SCREENCAPTURE_STATE_STARTED0Screen capture is started.
SCREENCAPTURE_STATE_CANCELED1Screen capture is canceled.
SCREENCAPTURE_STATE_STOPPED_BY_USER2Screen capture is manually stopped by the user.
SCREENCAPTURE_STATE_INTERRUPTED_BY_OTHER3Screen capture is interrupted by another screen capture.
SCREENCAPTURE_STATE_STOPPED_BY_CALL4Screen capture is interrupted by an incoming call.
SCREENCAPTURE_STATE_MIC_UNAVAILABLE5The microphone is unavailable during screen capture.
SCREENCAPTURE_STATE_MIC_MUTED_BY_USER6The microphone is muted by the user.
SCREENCAPTURE_STATE_MIC_UNMUTED_BY_USER7The microphone is unmuted by the user.
SCREENCAPTURE_STATE_ENTER_PRIVATE_SCENE8The system enters a privacy page during screen capture.
SCREENCAPTURE_STATE_EXIT_PRIVATE_SCENE9The system exits a privacy page during screen capture.
SCREENCAPTURE_STATE_STOPPED_BY_USER_SWITCHES10Screen capture is interrupted by system user switchover.
SCREENCAPTURE_STATE_PAUSED_BY_USER11Screen capture is paused by the user.
Since: 26.0.0
Model restriction: This API can be used only in the stage model.
SCREENCAPTURE_STATE_RESUMED_BY_USER12Screen capture is resumed by the user.
Since: 26.0.0
Model restriction: This API can be used only in the stage model.
SCREENCAPTURE_STATE_PAUSED_BY_APP13Screen capture is paused by the application.
Since: 26.0.0
Model restriction: This API can be used only in the stage model.
SCREENCAPTURE_STATE_RESUMED_BY_APP14Screen capture is resumed by the application.
Since: 26.0.0
Model restriction: This API can be used only in the stage model.

AVScreenCaptureFillMode18+

Enumerates the video fill modes during screen capture.

System capability: SystemCapability.Multimedia.Media.AVScreenCapture

NameValueDescription
PRESERVE_ASPECT_RATIO0Keeps the original aspect ratio, matching the aspect ratio of the physical screen.
SCALE_TO_FILL1Stretches the image to fit the specified dimensions.

PickerMode22+

Enumerates the display mode for the screen capture picker.

System capability: SystemCapability.Multimedia.Media.AVScreenCapture

NameValueDescription
WINDOW_ONLY0Displays only a list of windows.
SCREEN_ONLY1Displays only a list of screens.
SCREEN_AND_WINDOW2Displays both screens and windows.

AVMetricsEventType23+

Enumerates the metric events supported by the media service.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
AV_METRICS_EVENT_STALLING1Metric event indicating playback stalling.

PlaylistLoopMode

Enumerates the loop modes of playlist playback.

Since: 26.0.0

Atomic service API: This API can be used in atomic services since API version 26.0.0.

Model restriction: This API can be used only in the stage model.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
PLAYLIST_LOOP_MODE_ALL1Loop all.
PLAYLIST_LOOP_MODE_ONE2Repeat one.
PLAYLIST_LOOP_MODE_SHUFFLE3Shuffle.
PLAYLIST_LOOP_MODE_NONE4Loop off.

AudioEncoder(deprecated)

NOTE This API is supported since API version 6 and deprecated since API version 8. You are advised to use CodecMimeType instead.

Enumerates the audio encoding formats.

System capability: SystemCapability.Multimedia.Media.AudioRecorder

NameValueDescription
DEFAULT0Default encoding format.
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use AUDIO_AAC in CodecMimeType instead.
AMR_NB1AMR-NB.
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use AUDIO_AMR_NB in CodecMimeType instead.
AMR_WB2Adaptive Multi Rate-Wide Band Speech Codec (AMR-WB).
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use AUDIO_AMR_WB in CodecMimeType instead.
AAC_LC3Advanced Audio Coding Low Complexity (AAC-LC).
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use AUDIO_AAC in CodecMimeType instead.
HE_AAC4High-Efficiency Advanced Audio Coding (HE_AAC).
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use AUDIO_AAC in CodecMimeType instead.

AudioOutputFormat(deprecated)

NOTE This API is supported since API version 6 and deprecated since API version 8. You are advised to use ContainerFormatType instead.

Enumerates the audio output formats.

System capability: SystemCapability.Multimedia.Media.AudioRecorder

NameValueDescription
DEFAULT0Default output format.
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to select one from ContainerFormatType as required.
MPEG_42MPEG-4.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use CFT_MPEG_4 in ContainerFormatType instead.
AMR_NB3AMR_NB.
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use CFT_AMR in ContainerFormatType instead. For the encoding format, use AUDIO_AMR_NB in CodecMimeType.
AMR_WB4AMR_WB.
This API is defined but not implemented yet.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use CFT_AMR in ContainerFormatType instead. For the encoding format, use AUDIO_AMR_WB in CodecMimeType.
AAC_ADTS6Audio Data Transport Stream (ADTS), which is a transport stream format of AAC-based audio.
Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use CFT_AAC in ContainerFormatType instead.

MediaErrorCode(deprecated)

Enumerates the media error codes.

NOTE This API is supported since API version 8 and deprecated since API version 11. You are advised to use AVErrorCode instead.

System capability: SystemCapability.Multimedia.Media.Core

NameValueDescription
MSERR_OK0The operation is successful.
MSERR_NO_MEMORY1Failed to allocate memory. The system may have no available memory.
MSERR_OPERATION_NOT_PERMIT2No permission to perform the operation.
MSERR_INVALID_VAL3Invalid input parameter.
MSERR_IO4An I/O error occurs.
MSERR_TIMEOUT5The operation times out.
MSERR_UNKNOWN6An unknown error occurs.
MSERR_SERVICE_DIED7Invalid server.
MSERR_INVALID_STATE8The operation is not allowed in the current state.
MSERR_UNSUPPORTED9The operation is not supported in the current version.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-avrecorder-oh-avrecorder-range

openharmony 鸿蒙 errorcode-media

openharmony 鸿蒙 capi-avplayer

openharmony 鸿蒙 capi-avplayer-base-h

openharmony 鸿蒙 capi-avimage-generator-h

openharmony 鸿蒙 capi-avscreencapture-oh-rect

openharmony 鸿蒙 capi-videoprocessing-videoprocessing-callback

openharmony 鸿蒙 capi-avsinkbase

openharmony 鸿蒙 capi-avmetadataextractor

openharmony 鸿蒙 capi-avscreencapture-oh-multidisplaycapability

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/86l4c0BG