• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Enums
2<!--Kit: Media Kit-->
3<!--Subsystem: Multimedia-->
4<!--Owner: @wang-haizhou6-->
5<!--Designer: @HmQQQ-->
6<!--Tester: @xchaosioda-->
7<!--Adviser: @zengyawen-->
8
9> **NOTE**
10>
11> 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.
12
13## AVErrorCode<sup>9+</sup>
14
15Enumerates the [media error codes](errorcode-media.md).
16
17**Atomic service API**: This API can be used in atomic services since API version 11.
18
19**System capability**: SystemCapability.Multimedia.Media.Core
20
21| Name                                 | Value     | Description                                |
22| :------------------------------------ | ------- | ------------------------------------ |
23| AVERR_OK                              | 0       | The operation is successful.                      |
24| AVERR_NO_PERMISSION                   | 201     | No permission to perform the operation.              |
25| AVERR_INVALID_PARAMETER               | 401     | Invalid input parameter.                  |
26| AVERR_UNSUPPORT_CAPABILITY            | 801     | Unsupported API.       |
27| AVERR_NO_MEMORY                       | 5400101 | The system memory is insufficient or the number of services reaches the upper limit.|
28| AVERR_OPERATE_NOT_PERMIT              | 5400102 | The operation is not allowed in the current state or you do not have the permission to perform the operation.|
29| AVERR_IO                              | 5400103 | The data stream is abnormal.                |
30| AVERR_TIMEOUT                         | 5400104 | The system or network response times out.            |
31| AVERR_SERVICE_DIED                    | 5400105 | The service process is dead.                  |
32| AVERR_UNSUPPORT_FORMAT                | 5400106 | The format of the media asset is not supported.      |
33| AVERR_AUDIO_INTERRUPTED<sup>11+</sup> | 5400107 | The audio focus is interrupted.                  |
34| AVERR_SESSION_NOT_EXIST<sup>20+</sup> | 5400109 | The session ID does not exist.                  |
35| AVERR_IO_HOST_NOT_FOUND<sup>14+</sup> | 5411001 | Failed to parse the server address or connect to the server.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
36| AVERR_IO_CONNECTION_TIMEOUT<sup>14+</sup> | 5411002 | Network connection times out.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
37| AVERR_IO_NETWORK_ABNORMAL<sup>14+</sup> | 5411003 | Data or links are abnormal due to network exceptions.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
38| AVERR_IO_NETWORK_UNAVAILABLE<sup>14+</sup> | 5411004 | The network is disabled.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
39| AVERR_IO_NO_PERMISSION<sup>14+</sup> | 5411005 | No access permission.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
40| AVERR_IO_REQUEST_DENIED<sup>14+</sup> | 5411006 | The client request parameter is incorrect or exceeds the processing capability.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
41| AVERR_IO_RESOURCE_NOT_FOUND<sup>14+</sup> | 5411007 | No network resource is available.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
42| AVERR_IO_SSL_CLIENT_CERT_NEEDED<sup>14+</sup> | 5411008 | The server fails to verify the client certificate.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
43| AVERR_IO_SSL_CONNECTION_FAILED<sup>14+</sup> | 5411009 | The SSL connection fails.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
44| AVERR_IO_SSL_SERVER_CERT_UNTRUSTED<sup>14+</sup> | 5411010 | The client fails to verify the server certificate.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
45| AVERR_IO_UNSUPPORTED_REQUEST<sup>14+</sup> | 5411011 | The request is not supported due to a network protocol error.<br>**Atomic service API**: This API can be used in atomic services since API version 14.       |
46| AVERR_SEEK_CONTINUOUS_UNSUPPORTED<sup>18+</sup> | 5410002 | The seek operation in SEEK_CONTINUOUS mode is not supported.<br>**Atomic service API**: This API can be used in atomic services since API version 18.       |
47| AVERR_SUPER_RESOLUTION_UNSUPPORTED<sup>18+</sup> | 5410003 | Super resolution is not supported.<br>**Atomic service API**: This API can be used in atomic services since API version 18.       |
48| AVERR_SUPER_RESOLUTION_NOT_ENABLED<sup>18+</sup> | 5410004 | Super resolution is not enabled.<br>**Atomic service API**: This API can be used in atomic services since API version 18.       |
49| AVERR_PARAMETER_OUT_OF_RANGE<sup>20+</sup> | 5400108 | The parameter value is out of range.<br>**Atomic service API**: This API can be used in atomic services since API version 20.       |
50
51## MediaType<sup>8+</sup>
52
53Enumerates the media types.
54
55**System capability**: SystemCapability.Multimedia.Media.Core
56
57| Name          | Value                   | Description                |
58| -------------- | --------------------- | ------------------- |
59| MEDIA_TYPE_UNSUPPORTED<sup>20+</sup> | -1                     | The media type is not supported.<br>**Atomic service API**: This API can be used in atomic services since API version 20.
60| MEDIA_TYPE_AUD | 0                     | Media.<br>**Atomic service API**: This API can be used in atomic services since API version 11.          |
61| MEDIA_TYPE_VID | 1                     | Video.<br>**Atomic service API**: This API can be used in atomic services since API version 11.         |
62| MEDIA_TYPE_SUBTITLE<sup>12+</sup> | 2    | Subtitle.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
63| MEDIA_TYPE_ATTACHMENT<sup>20+</sup> | 3    | Attachment information (for example, an embedded external file).<br>**Atomic service API**: This API can be used in atomic services since API version 20.|
64| MEDIA_TYPE_DATA<sup>20+</sup> | 4    | Data.<br>**Atomic service API**: This API can be used in atomic services since API version 20.|
65| MEDIA_TYPE_TIMED_METADATA<sup>20+</sup> | 5    | Metadata with a timestamp.<br>**Atomic service API**: This API can be used in atomic services since API version 20.|
66| MEDIA_TYPE_AUXILIARY<sup>20+</sup> | 6    | Auxiliary (track) information.<br>**Atomic service API**: This API can be used in atomic services since API version 20.|
67
68## CodecMimeType<sup>8+</sup>
69
70Enumerates the codec MIME types.
71
72**System capability**: SystemCapability.Multimedia.Media.Core
73
74| Name        | Value                   | Description                    |
75| ------------ | --------------------- | ------------------------ |
76| VIDEO_H263   | 'video/h263'          | Video in H.263 format.     |
77| VIDEO_AVC    | 'video/avc'           | Video in AVC format.      |
78| VIDEO_MPEG2  | 'video/mpeg2'         | Video in MPEG-2 format.    |
79| VIDEO_MPEG4  | 'video/mp4v-es'         | Video in MPEG-4 format.    |
80| VIDEO_VP8    | 'video/x-vnd.on2.vp8' | Video in VP8 format.      |
81| VIDEO_HEVC<sup>11+</sup>   | 'video/hevc'          | Video in H.265 format.|
82| AUDIO_AAC    | 'audio/mp4a-latm'     | Audio in MP4A-LATM format.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
83| AUDIO_VORBIS | 'audio/vorbis'        | Audio in Vorbis format.   |
84| AUDIO_FLAC   | 'audio/flac'          | Audio in FLAC format.     |
85| AUDIO_MP3<sup>12+</sup>   | 'audio/mpeg'          | Audio in MPEG format.     |
86| AUDIO_G711MU<sup>12+</sup>   | 'audio/g711mu'     | Audio in G.711 μ-law format.|
87| AUDIO_AMR_NB<sup>18+</sup>   | 'audio/3gpp'     | Audio in AMR-NB format.|
88| AUDIO_AMR_WB<sup>18+</sup>   | 'audio/amr-wb'     | Audio in AMR-WB format.|
89
90## MediaDescriptionKey<sup>8+</sup>
91
92Enumerates the media description keys.
93
94**System capability**: SystemCapability.Multimedia.Media.Core
95
96| Name                    | Value             | Description                                                        |
97| ------------------------ | --------------- | ------------------------------------------------------------ |
98| MD_KEY_TRACK_INDEX       | 'track_index'   | Track index, which is a number.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
99| MD_KEY_TRACK_TYPE        | 'track_type'    | Track type, which is a number. For details, see [MediaType](#mediatype8).<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
100| MD_KEY_CODEC_MIME        | 'codec_mime'    | Codec MIME type, which is a string.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
101| MD_KEY_DURATION          | 'duration'      | Media duration, which is a number, in units of ms.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
102| MD_KEY_BITRATE           | 'bitrate'       | Bit rate, which is a number, in units of bit/s.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
103| MD_KEY_WIDTH             | 'width'         | Video width, which is a number, in units of pixel.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
104| MD_KEY_HEIGHT            | 'height'        | Video height, which is a number, in units of pixel.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
105| MD_KEY_FRAME_RATE        | 'frame_rate'    | Video frame rate, which is a number, measured in frames per 100 seconds.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
106| MD_KEY_AUD_CHANNEL_COUNT | 'channel_count' | Audio channel count, which is a number.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
107| MD_KEY_AUD_SAMPLE_RATE   | 'sample_rate'   | Sample rate, which is a number, in units of Hz.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
108| MD_KEY_AUD_SAMPLE_DEPTH<sup>12+</sup>  | 'sample_depth'  | Bit depth, which is a number, in units of bits.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
109| MD_KEY_LANGUAGE<sup>12+</sup>  | 'language'  | Subtitle language, which is a string.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
110| MD_KEY_TRACK_NAME<sup>12+</sup>  | 'track_name'  | Track name, which is a string.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
111| MD_KEY_HDR_TYPE<sup>12+</sup>  | 'hdr_type'  | Codec track type, which is a string.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
112
113## PlaybackInfoKey<sup>12+</sup>
114
115Enumerates the playback description keys.
116
117**System capability**: SystemCapability.Multimedia.Media.Core
118
119| Name                    | Value             | Description                                                        |
120| ------------------------ | --------------- | ------------------------------------------------------------ |
121| SERVER_IP_ADDRESS        | 'server_ip_address'    | IP address of the server, which is a string. |
122| AVG_DOWNLOAD_RATE        | 'average_download_rate'| Average download rate, which is a number, in units of bit/s.|
123| DOWNLOAD_RATE            | 'download_rate'        | Download rate in one second, which is a number, in units of bit/s.|
124| IS_DOWNLOADING           | 'is_downloading'       | Download status, which is a number. The value **1** means that the downloaded is in progress, and **0** means that the download is complete.|
125| BUFFER_DURATION          | 'buffer_duration'      | Duration that the cached data can be played, which is a number, in units of seconds.|
126
127## BufferingInfoType<sup>8+</sup>
128
129Enumerates the buffering event types.
130
131**Atomic service API**: This API can be used in atomic services since API version 12.
132
133**System capability**: SystemCapability.Multimedia.Media.Core
134
135| Name             | Value  | Description                            |
136| ----------------- | ---- | -------------------------------- |
137| BUFFERING_START   | 1    | Buffering starts. When this event is triggered, the player pauses the playback.<br>**Atomic service API**: This API can be used in atomic services since API version 12.                  |
138| BUFFERING_END     | 2    | Buffering ends. When this event is triggered, the player resumes the playback.<br>**Atomic service API**: This API can be used in atomic services since API version 12.                  |
139| BUFFERING_PERCENT | 3    | Buffering percentage. You can use this event to monitor the buffering status.<br>**Atomic service API**: This API can be used in atomic services since API version 12.                |
140| CACHED_DURATION   | 4    | Estimated 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12. |
141
142## StateChangeReason<sup>9+</sup>
143
144Enumerates the reasons for the state transition of the AVPlayer or AVRecorder instance. The enum value is reported together with **state**.
145
146**Atomic service API**: This API can be used in atomic services since API version 11.
147
148**System capability**: SystemCapability.Multimedia.Media.Core
149
150| Name      | Value  | Description                                                        |
151| ---------- | ---- | ------------------------------------------------------------ |
152| USER       | 1    | State transition triggered by user behavior. It happens when a user or the client calls an API.|
153| BACKGROUND | 2    | State 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.|
154
155## SeekMode<sup>8+</sup>
156
157Enumerates the video playback seek modes, which can be passed in the **seek** API.
158
159**System capability**: SystemCapability.Multimedia.Media.Core
160
161| Name          | Value  | Description                                                        |
162| -------------- | ---- | ------------------------------------------------------------ |
163| SEEK_NEXT_SYNC | 0    | Seeks to the next key frame at the specified position. You are advised to use this value for the rewind operation.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
164| SEEK_PREV_SYNC | 1    | Seeks to the previous key frame at the specified position. You are advised to use this value for the fast-forward operation.<br>**Atomic service API**: This API can be used in atomic services since API version 11.|
165| SEEK_CLOSEST<sup>12+</sup> | 2    | Seeks to the frame closest to the specified position. You are advised to use this value for accurate seek.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
166| SEEK_CONTINUOUS<sup>18+</sup> | 3    | Offers 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.<br>Applications can call [isSeekContinuousSupported](arkts-apis-media-AVPlayer.md#isseekcontinuoussupported18) to check whether the video source supports this seeking mode.<br>If the video source does not support this mode, calling **seek** will result in an **AVERR_SEEK_CONTINUOUS_UNSUPPORTED** error (see [Media Error Codes](#averrorcode9)), and the smoothness of frame updates will be compromised.<br>This seeking mode does not trigger the [seekDone event](arkts-apis-media-AVPlayer.md#onseekdone9).<br>To exit this seeking mode, applications must call **seek(-1, SeekMode.SEEK_CONTINUOUS)** to end the seeking process.<br>**Atomic service API**: This API can be used in atomic services since API version 18.|
167
168## SwitchMode<sup>12+</sup>
169
170Enumerates the track switching modes for video playback. The mode can be passed in to **selectTrack**. Currently, this enum is valid only for DASH video tracks.
171
172**System capability**: SystemCapability.Multimedia.Media.Core
173
174| Name          | Value  | Description                                                        |
175| -------------- | ---- | ------------------------------------------------------------ |
176| SMOOTH | 0    | Smooth playback is ensured after the switching. This mode has a delay, that is, the switching does not take effect immediately.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
177| SEGMENT | 1    | The 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
178| CLOSEST | 2    | The 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.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
179
180## PlaybackSpeed<sup>8+</sup>
181
182Enumerates the video playback speeds, which can be passed in the **setSpeed** API.
183
184**Atomic service API**: This API can be used in atomic services since API version 12.
185
186**System capability**: SystemCapability.Multimedia.Media.VideoPlayer
187
188| Name                | Value  | Description                          |
189| -------------------- | ---- | ------------------------------ |
190| SPEED_FORWARD_0_75_X | 0    | Plays the video at 0.75 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
191| SPEED_FORWARD_1_00_X | 1    | Plays the video at the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.        |
192| SPEED_FORWARD_1_25_X | 2    | Plays the video at 1.25 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
193| SPEED_FORWARD_1_75_X | 3    | Plays the video at 1.75 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
194| SPEED_FORWARD_2_00_X | 4    | Plays the video at 2.00 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
195| SPEED_FORWARD_0_50_X<sup>12+</sup> | 5    | Plays the video at 0.50 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
196| SPEED_FORWARD_1_50_X<sup>12+</sup> | 6    | Plays the video at 1.50 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
197| SPEED_FORWARD_3_00_X<sup>13+</sup> | 7    | Plays the video at 3.00 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 13.|
198| SPEED_FORWARD_0_25_X<sup>12+</sup> | 8    | Plays the video at 0.25 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
199| SPEED_FORWARD_0_125_X<sup>12+</sup> | 9    | Plays the video at 0.125 times the normal speed.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
200
201## VideoScaleType<sup>9+</sup>
202
203Enumerates the video scale modes.
204
205**Atomic service API**: This API can be used in atomic services since API version 12.
206
207**System capability**: SystemCapability.Multimedia.Media.VideoPlayer
208
209| Name                       | Value  | Description                                             |
210| ----------------------------| ---- | ------------------------------------------------ |
211| VIDEO_SCALE_TYPE_FIT        | 0    | Default mode. The video will be stretched to fit the window.               |
212| VIDEO_SCALE_TYPE_FIT_CROP   | 1    | Maintains the video's aspect ratio, and scales to fill the shortest side of the window, with the longer side cropped.    |
213| VIDEO_SCALE_TYPE_SCALED_ASPECT<sup>20+</sup> | 2    | Maintains 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.<br>**Atomic service API**: This API can be used in atomic services since API version 20. |
214
215## AudioSourceType<sup>9+</sup>
216
217Enumerates the audio source types for video recording.
218
219**System capability**: SystemCapability.Multimedia.Media.AVRecorder
220
221| Name                     | Value  | Description                  |
222| ------------------------- | ---- | ---------------------- |
223| AUDIO_SOURCE_TYPE_DEFAULT | 0    | Default audio input source.|
224| AUDIO_SOURCE_TYPE_MIC     | 1    | Microphone audio input source.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
225| AUDIO_SOURCE_TYPE_VOICE_RECOGNITION<sup>12+</sup> | 2    | Audio source in speech recognition scenarios.|
226| AUDIO_SOURCE_TYPE_VOICE_COMMUNICATION<sup>12+</sup>     | 7    | Voice communication source.|
227| AUDIO_SOURCE_TYPE_VOICE_MESSAGE<sup>12+</sup> | 10    | Voice message source.|
228| AUDIO_SOURCE_TYPE_CAMCORDER<sup>12+</sup>     | 13    | Audio source in camera recording scenarios.|
229
230## VideoSourceType<sup>9+</sup>
231
232Enumerates the video source types for video recording.
233
234**System capability**: SystemCapability.Multimedia.Media.AVRecorder
235
236| Name                         | Value  | Description                           |
237| ----------------------------- | ---- | ------------------------------- |
238| VIDEO_SOURCE_TYPE_SURFACE_YUV | 0    | The input surface carries raw data.|
239| VIDEO_SOURCE_TYPE_SURFACE_ES  | 1    | The input surface carries ES data. |
240
241## ContainerFormatType<sup>8+</sup>
242
243Enumerates the container format types (CFTs).
244
245**System capability**: SystemCapability.Multimedia.Media.Core
246
247| Name       | Value   | Description                 |
248| ----------- | ----- | --------------------- |
249| CFT_MPEG_4  | 'mp4' | Video container format MP4.|
250| CFT_MPEG_4A | 'm4a' | Audio container format M4A.<br>**Atomic service API**: This API can be used in atomic services since API version 12.|
251| CFT_MP3<sup>12+</sup>  | 'mp3' | Audio container format MP3.|
252| CFT_WAV<sup>12+</sup>  | 'wav' | Audio container format WAV.|
253| CFT_AMR<sup>18+</sup>  | 'amr' | Audio container format AMR.|
254| CFT_AAC<sup>20+</sup>  | 'aac' | Audio container format AAC. The default format is ADTS frame header.|
255
256## FileGenerationMode<sup>12+</sup>
257
258Enumerates the modes for creating media files.
259
260**System capability**: SystemCapability.Multimedia.Media.AVRecorder
261
262| Name                         | Value  | Description                           |
263| ----------------------------- | ---- | ------------------------------- |
264| APP_CREATE  | 0    | The application creates a media file in the sandbox.|
265| AUTO_CREATE_CAMERA_SCENE  | 1    | The system creates a media file. Currently, this mode takes effect only in camera recording scenarios. The URL set by the application is ignored.|
266
267## HdrType<sup>12+</sup>
268
269Enumerates the HDR types.
270
271**System capability**: SystemCapability.Multimedia.Media.Core
272
273| Name                     | Value  | Description                  |
274| ------------------------- | ---- | ---------------------- |
275| AV_HDR_TYPE_NONE          | 0    | No HDR.|
276| AV_HDR_TYPE_VIVID         | 1    | HDR VIVID.|
277
278## AVImageQueryOptions<sup>12+</sup>
279
280Enumerates the relationship between the video frame and the time at which the video thumbnail is obtained.
281
282The 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.
283
284**System capability**: SystemCapability.Multimedia.Media.AVImageGenerator
285
286| Name                    | Value             | Description                                                        |
287| ------------------------ | --------------- | ------------------------------------------------------------ |
288| AV_IMAGE_QUERY_NEXT_SYNC       | 0   | The key frame at or next to the specified time is selected.                      |
289| AV_IMAGE_QUERY_PREVIOUS_SYNC        | 1    | The key frame at or prior to the specified time is selected.|
290| AV_IMAGE_QUERY_CLOSEST_SYNC        | 2    | The key frame closest to the specified time is selected.                |
291| AV_IMAGE_QUERY_CLOSEST             | 3    | The frame (not necessarily a key frame) closest to the specified time is selected.|
292
293## LoadingRequestError<sup>18+</sup>
294
295Enumerates the reasons for data loading status changes.
296
297**Atomic service API**: This API can be used in atomic services since API version 18.
298
299**System capability**: SystemCapability.Multimedia.Media.Core
300
301| Name                | Value  | Description                          |
302| -------------------- | ---- | ------------------------------ |
303| LOADING_ERROR_SUCCESS | 0    | Returned by the client to indicate that the end of the resource.|
304| LOADING_ERROR_NOT_READY | 1    | Returned by the client to indicate that the resource is not ready for access.|
305| LOADING_ERROR_NO_RESOURCE | 2    | Returned by the client to indicate that the requested resource URL does not exist.|
306| LOADING_ERROR_INVAID_HANDLE | 3    | Returned by the client to indicate that the ID of the requested resource handle (specified by **uuid**) is invalid.|
307| LOADING_ERROR_ACCESS_DENIED | 4    | Returned by the client to indicate that the client does not have permission to request the resource.|
308| LOADING_ERROR_ACCESS_TIMEOUT | 5    | Returned by the client to indicate that the access to the resource times out.|
309| LOADING_ERROR_AUTHORIZE_FAILED | 6    | Returned by the client to indicate that authorization fails.|
310
311## AVMimeTypes<sup>12+</sup>
312
313Enumerates the MIME type, which is set by using [setMimeType](arkts-apis-media-MediaSource.md#setmimetype12).
314
315**Atomic service API**: This API can be used in atomic services since API version 12.
316
317**System capability**: SystemCapability.Multimedia.Media.Core
318
319| Name      | Value  | Description                                                        |
320| ---------- | ---- | ------------------------------------------------------------ |
321| APPLICATION_M3U8       | application/m3u8    | Local M3U8 file.|
322
323## AVScreenCaptureRecordPreset<sup>12+</sup>
324
325Enumerates the encoding and container formats used during screen capture.
326
327**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
328
329| Name                             | Value  | Description                                        |
330| --------------------------------- | ---- | -------------------------------------------- |
331| SCREEN_RECORD_PRESET_H264_AAC_MP4 | 0    | The H.264 video encoding format, AAC audio encoding format, and MP4 container format are used.|
332| SCREEN_RECORD_PRESET_H265_AAC_MP4 | 1    | The H.265 video encoding format, AAC audio encoding format, and MP4 container format are used.|
333
334## AVScreenCaptureStateCode<sup>12+</sup>
335
336Enumerates the screen capture states used in callbacks.
337
338**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
339
340| Name                                    | Value  | Description                    |
341| ---------------------------------------- | ---- | ------------------------ |
342| SCREENCAPTURE_STATE_STARTED              | 0    | Screen capture is started.            |
343| SCREENCAPTURE_STATE_CANCELED             | 1    | Screen capture is canceled.            |
344| SCREENCAPTURE_STATE_STOPPED_BY_USER      | 2    | Screen capture is manually stopped by the user.    |
345| SCREENCAPTURE_STATE_INTERRUPTED_BY_OTHER | 3    | Screen capture is interrupted by another screen capture.    |
346| SCREENCAPTURE_STATE_STOPPED_BY_CALL      | 4    | Screen capture is interrupted by an incoming call.        |
347| SCREENCAPTURE_STATE_MIC_UNAVAILABLE      | 5    | The microphone is unavailable during screen capture.|
348| SCREENCAPTURE_STATE_MIC_MUTED_BY_USER    | 6    | The microphone is muted by the user.      |
349| SCREENCAPTURE_STATE_MIC_UNMUTED_BY_USER  | 7    | The microphone is unmuted by the user.      |
350| SCREENCAPTURE_STATE_ENTER_PRIVATE_SCENE  | 8    | The system enters a privacy page during screen capture.      |
351| SCREENCAPTURE_STATE_EXIT_PRIVATE_SCENE   | 9    | The system exits a privacy page during screen capture.      |
352| SCREENCAPTURE_STATE_STOPPED_BY_USER_SWITCHES   | 10    | Screen capture is interrupted by system user switchover.      |
353
354## AVScreenCaptureFillMode<sup>18+</sup>
355
356Enumerates the video fill modes during screen capture.
357
358**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
359
360| Name                             | Value  | Description                                        |
361| --------------------------------- | ---- | -------------------------------------------- |
362| PRESERVE_ASPECT_RATIO | 0    | Keeps the original aspect ratio, matching the aspect ratio of the physical screen.|
363| SCALE_TO_FILL | 1    | Stretches the image to fit the specified dimensions.|
364
365## AudioEncoder<sup>(deprecated)</sup>
366
367> **NOTE**
368>
369> This API is supported since API version 6 and deprecated since API version 8. You are advised to use [CodecMimeType](#codecmimetype8) instead.
370
371Enumerates the audio encoding formats.
372
373**System capability**: SystemCapability.Multimedia.Media.AudioRecorder
374
375| Name   | Value  | Description                                                        |
376| ------- | ---- | ------------------------------------------------------------ |
377| DEFAULT | 0    | Default encoding format.<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **AUDIO_AAC** in [CodecMimeType](#codecmimetype8) instead.|
378| AMR_NB  | 1    | AMR-NB.<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **AUDIO_AMR_NB** in [CodecMimeType](#codecmimetype8) instead.|
379| AMR_WB  | 2    | Adaptive Multi Rate-Wide Band Speech Codec (AMR-WB).<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **AUDIO_AMR_WB** in [CodecMimeType](#codecmimetype8) instead.|
380| AAC_LC  | 3    | Advanced Audio Coding Low Complexity (AAC-LC).<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **AUDIO_AAC** in [CodecMimeType](#codecmimetype8) instead.|
381| HE_AAC  | 4    | High-Efficiency Advanced Audio Coding (HE_AAC).<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **AUDIO_AAC** in [CodecMimeType](#codecmimetype8) instead.|
382
383## AudioOutputFormat<sup>(deprecated)</sup>
384
385> **NOTE**
386>
387> This API is supported since API version 6 and deprecated since API version 8. You are advised to use [ContainerFormatType](#containerformattype8) instead.
388
389Enumerates the audio output formats.
390
391**System capability**: SystemCapability.Multimedia.Media.AudioRecorder
392
393| Name    | Value  | Description                                                        |
394| -------- | ---- | ------------------------------------------------------------ |
395| DEFAULT  | 0    | Default output format.<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to select one from [ContainerFormatType](#containerformattype8) as required.|
396| MPEG_4   | 2    | MPEG-4.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **CFT_MPEG_4** in [ContainerFormatType](#containerformattype8) instead.|
397| AMR_NB   | 3    | AMR_NB.<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **CFT_AMR** in [ContainerFormatType](#containerformattype8) instead. For the encoding format, use **AUDIO_AMR_NB** in [CodecMimeType](#codecmimetype8).|
398| AMR_WB   | 4    | AMR_WB.<br>This API is defined but not implemented yet.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **CFT_AMR** in [ContainerFormatType](#containerformattype8) instead. For the encoding format, use **AUDIO_AMR_WB** in [CodecMimeType](#codecmimetype8).|
399| AAC_ADTS | 6    | Audio Data Transport Stream (ADTS), which is a transport stream format of AAC-based audio.<br>Note: It is supported since API version 6 and deprecated since API version 8. You are advised to use **CFT_AAC** in [ContainerFormatType](#containerformattype8) instead.|
400
401## MediaErrorCode<sup>(deprecated)</sup>
402
403Enumerates the media error codes.
404
405> **NOTE**
406>
407> This enum is supported since API version 8 and deprecated since API version 11. You are advised to use [Media Error Codes](#averrorcode9) instead.
408
409**System capability**: SystemCapability.Multimedia.Media.Core
410
411| Name                      | Value  | Description                                  |
412| -------------------------- | ---- | -------------------------------------- |
413| MSERR_OK                   | 0    | The operation is successful.                        |
414| MSERR_NO_MEMORY            | 1    | Failed to allocate memory. The system may have no available memory.|
415| MSERR_OPERATION_NOT_PERMIT | 2    | No permission to perform the operation.                |
416| MSERR_INVALID_VAL          | 3    | Invalid input parameter.                    |
417| MSERR_IO                   | 4    | An I/O error occurs.                      |
418| MSERR_TIMEOUT              | 5    | The operation times out.                        |
419| MSERR_UNKNOWN              | 6    | An unknown error occurs.                        |
420| MSERR_SERVICE_DIED         | 7    | Invalid server.                      |
421| MSERR_INVALID_STATE        | 8    | The operation is not allowed in the current state.  |
422| MSERR_UNSUPPORTED          | 9    | The operation is not supported in the current version.      |
423