未验证 提交 999b47b7 编写于 作者: O openharmony_ci 提交者: Gitee

!21629 [翻译完成】#I7JJWF

Merge pull request !21629 from Annie_wang/PR20613
......@@ -3,9 +3,7 @@
> **NOTE**
>
> - The APIs of this module are supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
> - The APIs of this module are deprecated since API version 9 and will be retained until API version 13.
> - Some APIs are changed as system APIs and can be used only by system applications. Use [@ohos.filemanagement.userFileManager](js-apis-userFileManager.md) instead.
> - The APIs for selecting and storing media assets are still open to common applications. Use [@ohos.file.picker](js-apis-file-picker.md) instead.
> - The APIs of this module are deprecated since API version 9. For details about the substitute APIs, see the API description.
## Modules to Import
......@@ -21,6 +19,9 @@ Obtains a **MediaLibrary** instance, which is used to access and modify personal
This API can be used only in the stage model.
> **NOTE**
> This API is deprecated since API Version 9. Use [getPhotoAccessHelper](js-apis-photoAccessHelper.md#photoaccesshelpergetphotoaccesshelper) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -33,7 +34,7 @@ This API can be used only in the stage model.
| Type | Description |
| ----------------------------- | :---- |
| [MediaLibrary](#medialibrary) | **MediaLibrary** instance.|
| [MediaLibrary](#medialibrary) | **MediaLibrary** instance obtained.|
**Example (from API version 9)**
......@@ -60,13 +61,16 @@ Obtains a **MediaLibrary** instance, which is used to access and modify personal
This API can be used only in the FA model.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
| Type | Description |
| ----------------------------- | :--------- |
| [MediaLibrary](#medialibrary) | **MediaLibrary** instance.|
| [MediaLibrary](#medialibrary) | **MediaLibrary** instance obtained.|
**Example**
......@@ -83,7 +87,9 @@ getFileAssets(options: MediaFetchOptions, callback: AsyncCallback<FetchFileRe
Obtains file assets (also called files). This API uses an asynchronous callback to return the result.
> **NOTE**
> From API version 10, the albums represented by physical directories are replaced by logical albums, which allows multiple files in an album and presence of a file in multiple albums. This design, however, makes **parent**, **albumId**, **albumUri**, and **albumName** incompatible. They cannot be used as parameters of **MediaFetchOptions** in **getFileAssets()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [getAssets](js-apis-photoAccessHelper.md#getassets) instead.
> - From API version 10, the albums represented by physical directories are replaced by logical albums, which allows multiple files in an album and presence of a file in multiple albums. This design, however, makes **parent**, **albumId**, **albumUri**, and **albumName** incompatible. They cannot be used as parameters of **MediaFetchOptions** in **getFileAssets()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -154,7 +160,9 @@ getFileAssets(options: MediaFetchOptions): Promise<FetchFileResult>
Obtains file assets. This API uses a promise to return the result.
> **NOTE**
> From API version 10, the albums represented by physical directories are replaced by logical albums, which allows multiple files in an album and presence of a file in multiple albums. This design, however, makes **parent**, **albumId**, **albumUri**, and **albumName** incompatible. They cannot be used as parameters of **MediaFetchOptions** in **getFileAssets()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [getAssets](js-apis-photoAccessHelper.md#getassets-1) instead.
> - From API version 10, the albums represented by physical directories are replaced by logical albums, which allows multiple files in an album and presence of a file in multiple albums. This design, however, makes **parent**, **albumId**, **albumUri**, and **albumName** incompatible. They cannot be used as parameters of **MediaFetchOptions** in **getFileAssets()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -225,6 +233,9 @@ on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'
Subscribes to the media library changes. This API uses a callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [registerChange](js-apis-photoAccessHelper.md#registerchange) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -248,6 +259,9 @@ off(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange
Unsubscribes from the media library changes. This API uses a callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [unRegisterChange](js-apis-photoAccessHelper.md#unregisterchange) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -272,7 +286,9 @@ createAsset(mediaType: MediaType, displayName: string, relativePath: string, cal
Creates a media asset. This API uses an asynchronous callback to return the result.
> **NOTE**
> From the SDK of API version 10, **relativePath** is no longer associated with an album. After a file is created, the last-level directory of **relativePath** is not displayed. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [createAsset](js-apis-photoAccessHelper.md#createasset) instead.
> - From the SDK of API version 10, **relativePath** is no longer associated with an album. After a file is created, the last-level directory of **relativePath** is not displayed. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
......@@ -312,7 +328,9 @@ createAsset(mediaType: MediaType, displayName: string, relativePath: string): Pr
Creates a media asset. This API uses a promise to return the result.
> **NOTE**
> From the SDK of API version 10, **relativePath** is no longer associated with an album. After a file is created, the last-level directory of **relativePath** is not displayed. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [createAsset](js-apis-photoAccessHelper.md#createasset-1) instead.
> - From the SDK of API version 10, **relativePath** is no longer associated with an album. After a file is created, the last-level directory of **relativePath** is not displayed. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
......@@ -354,6 +372,11 @@ deleteAsset(uri: string): Promise\<void>
Deletes a file asset. This API uses a promise to return the result.
Before calling this API, call [FileAsset.trash](#trash8) to move the file to the trash. Otherwise, the file fails to be deleted.
> **NOTE**
> This API is deprecated since API Version 9. Use [deleteAssets](js-apis-photoAccessHelper.md#deleteassets-3) instead.
**System API**: This is a system API.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
......@@ -403,6 +426,11 @@ deleteAsset(uri: string, callback: AsyncCallback\<void>): void
Deletes a file asset. This API uses an asynchronous callback to return the result.
Before calling this API, call [FileAsset.trash](#trash8) to move the file to the trash. Otherwise, the file fails to be deleted.
> **NOTE**
> This API is deprecated since API Version 9. Use [deleteAssets](js-apis-photoAccessHelper.md#deleteassets-2) instead.
**System API**: This is a system API.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
......@@ -449,6 +477,9 @@ getPublicDirectory(type: DirectoryType, callback: AsyncCallback&lt;string&gt;):
Obtains a user directory. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -477,6 +508,9 @@ getPublicDirectory(type: DirectoryType): Promise&lt;string&gt;
Obtains a user directory. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -515,7 +549,9 @@ getAlbums(options: MediaFetchOptions, callback: AsyncCallback&lt;Array&lt;Album&
Obtains albums. This API uses an asynchronous callback to return the result.
> **NOTE**
> From the SDK of API version 10, **relativePath** is no longer associated with an album. Therefore, **relativePath** cannot be used as a search criterion in **getAlbums**. Currently, only **Camera** and **ScreenShots** albums are supported. For more details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [getAlbums](js-apis-photoAccessHelper.md#getalbums) instead.
> - From the SDK of API version 10, **relativePath** is no longer associated with an album. Therefore, **relativePath** cannot be used as a search criterion in **getAlbums**. Currently, only **Camera** and **ScreenShots** albums are supported. For more details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -553,7 +589,9 @@ getAlbums(options: MediaFetchOptions): Promise&lt;Array&lt;Album&gt;&gt;
Obtains albums. This API uses a promise to return the result.
> **NOTE**
> From the SDK of API version 10, **relativePath** is no longer associated with an album. Therefore, **relativePath** cannot be used as a search criterion in **getAlbums**. Currently, only **Camera** and **ScreenShots** albums are supported. For more details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [getAlbums](js-apis-photoAccessHelper.md#getalbums-2) instead.
> - From the SDK of API version 10, **relativePath** is no longer associated with an album. Therefore, **relativePath** cannot be used as a search criterion in **getAlbums**. Currently, only **Camera** and **ScreenShots** albums are supported. For more details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -594,6 +632,9 @@ release(callback: AsyncCallback&lt;void&gt;): void
Releases this **MediaLibrary** instance.
Call this API when you no longer need to use the APIs in the **MediaLibrary** instance.
> **NOTE**
> This API is deprecated since API Version 9. Use [release](js-apis-photoAccessHelper.md#release) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -617,6 +658,9 @@ release(): Promise&lt;void&gt;
Releases this **MediaLibrary** instance.
Call this API when you no longer need to use the APIs in the **MediaLibrary** instance.
> **NOTE**
> This API is deprecated since API Version 9. Use [release](js-apis-photoAccessHelper.md#release-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
......@@ -637,7 +681,10 @@ storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback&lt;string&gt;)
Stores a media asset. This API uses an asynchronous callback to return the URI of the media asset.
> **NOTE**<br>This API is supported since API version 6 and can be used only in the FA model.
> **NOTE**
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. Use [save](js-apis-file-picker.md#save-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -672,7 +719,10 @@ storeMediaAsset(option: MediaAssetOption): Promise&lt;string&gt;
Stores a media asset. This API uses a promise to return the URI of the media asset.
> **NOTE**<br>This API is supported since API version 6 and can be used only in the FA model.
> **NOTE**
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. Use [save](js-apis-file-picker.md#save) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -711,8 +761,9 @@ startImagePreview(images: Array&lt;string&gt;, index: number, callback: AsyncCal
Starts image preview, with the first image to preview specified. This API can be used to preview local images whose URIs start with **datashare://** or online images whose URIs start with **https://**. It uses an asynchronous callback to return the result.
> **NOTE**
> This API is supported since API version 6 and can be used only in the FA model.
> You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead.<br>The **\<Image>** component can be used to render and display local and online images.
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead. <br>The **\<Image>** component can be used to render and display local and online images.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -754,8 +805,9 @@ startImagePreview(images: Array&lt;string&gt;, callback: AsyncCallback&lt;void&g
Starts image preview. This API can be used to preview local images whose URIs start with **datashare://** or online images whose URIs start with **https://**. It uses an asynchronous callback to return the result.
> **NOTE**
> This API is supported since API version 6 and can be used only in the FA model.
> You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead.<br>The **\<Image>** component can be used to render and display local and online images.
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead. <br>The **\<Image>** component can be used to render and display local and online images.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -795,8 +847,9 @@ startImagePreview(images: Array&lt;string&gt;, index?: number): Promise&lt;void&
Starts image preview, with the first image to preview specified. This API can be used to preview local images whose URIs start with **datashare://** or online images whose URIs start with **https://**. It uses a promise to return the execution result.
> **NOTE**
> This API is supported since API version 6 and can be used only in the FA model.
> You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead.<br>The **\<Image>** component can be used to render and display local and online images.
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. You are advised to use the **\<[Image](../arkui-ts/ts-basic-components-image.md)>** component instead. <br>The **\<Image>** component can be used to render and display local and online images.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -841,8 +894,9 @@ startMediaSelect(option: MediaSelectOption, callback: AsyncCallback&lt;Array&lt;
Starts media selection. This API uses an asynchronous callback to return the URIs of the selected media assets.
> **NOTE**
> This API is supported since API version 6 and can be used only in the FA model.
> You are advised to use the system app Gallery instead. Gallery is a built-in visual resource access application that provides features such as image and video management and browsing. For details about how to use Gallery, see [OpenHarmony/applications_photos](https://gitee.com/openharmony/applications_photos).
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. Use [select](js-apis-file-picker.md#select-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -877,8 +931,9 @@ startMediaSelect(option: MediaSelectOption): Promise&lt;Array&lt;string&gt;&gt;
Starts media selection. This API uses a promise to return the URIs of the selected media assets.
> **NOTE**
> This API is supported since API version 6 and can be used only in the FA model.
> You are advised to use the system app Gallery instead. Gallery is a built-in visual resource access application that provides features such as image and video management and browsing. For details about how to use Gallery, see [OpenHarmony/applications_photos](https://gitee.com/openharmony/applications_photos).
>
> - This API is supported since API version 6 and can be used only in the FA model.
> - This API is deprecated since API Version 9. Use [select](js-apis-file-picker.md#select) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -915,6 +970,9 @@ getActivePeers(): Promise\<Array\<PeerInfo>>;
Obtains information about online peer devices. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System API**: This is a system API.
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -949,6 +1007,9 @@ getActivePeers(callback: AsyncCallback\<Array\<PeerInfo>>): void;
Obtains information about online peer devices. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System API**: This is a system API.
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -981,6 +1042,9 @@ getAllPeers(): Promise\<Array\<PeerInfo>>;
Obtains information about all peer devices. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System API**: This is a system API.
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -1015,6 +1079,9 @@ getAllPeers(callback: AsyncCallback\<Array\<PeerInfo>>): void;
Obtains information about all peer devices. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System API**: This is a system API.
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -1047,8 +1114,9 @@ Provides APIs for encapsulating file asset attributes.
> **NOTE**
>
> 1. The system attempts to parse the file content if the file is an audio or video file. The actual field values will be restored from the passed values during scanning on some devices.
> 2. Some devices may not support the modification of **orientation**. You are advised to use [ModifyImageProperty](js-apis-image.md#modifyimageproperty9) of the **image** module.
> - The system attempts to parse the file content if the file is an audio or video file. The actual field values will be restored from the passed values during scanning on some devices.
> - Some devices may not support the modification of **orientation**. You are advised to use [ModifyImageProperty](js-apis-image.md#modifyimageproperty9) of the **image** module.
> - This API is deprecated since API Version 9. Use [PhotoAsset](js-apis-photoAccessHelper.md#photoasset) instead.
### Attributes
......@@ -1084,6 +1152,9 @@ isDirectory(callback: AsyncCallback&lt;boolean&gt;): void
Checks whether this file asset is a directory. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1124,6 +1195,9 @@ isDirectory():Promise&lt;boolean&gt;
Checks whether this file asset is a directory. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1163,7 +1237,9 @@ commitModify(callback: AsyncCallback&lt;void&gt;): void
Commits the modification on the file metadata to the database. This API uses an asynchronous callback to return the result.
> **NOTE**
> Since the SDK of API version 10, **audio** does not have the **orientation** attribute. Therefore, the **orientation** attribute of the audio resource cannot be modified by **commitModify()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
>
> - This API is deprecated since API Version 9. Use [commitModify](js-apis-photoAccessHelper.md#commitmodify) instead.
> - Since the SDK of API version 10, **audio** does not have the **orientation** attribute. Therefore, the **orientation** attribute of the audio resource cannot be modified by **commitModify()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
......@@ -1203,6 +1279,8 @@ commitModify(): Promise&lt;void&gt;
Commits the modification on the file asset to the database. This API uses a promise to return the result.
> **NOTE**
>
> - This API is deprecated since API Version 9. Use [commitModify](js-apis-photoAccessHelper.md#commitmodify-1) instead.
> Since the SDK of API version 10, **audio** does not have the **orientation** attribute. Therefore, the **orientation** attribute of the audio resource cannot be modified by **commitModify()**. For details, see [changelogs-mediaLibrary.md](../../../release-notes/changelogs/OpenHarmony_4.0.8.2/changelogs-mediaLibrary.md).
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
......@@ -1240,6 +1318,9 @@ open(mode: string, callback: AsyncCallback&lt;number&gt;): void
Opens this file asset. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [open](js-apis-photoAccessHelper.md#open) instead.
**NOTE**<br>If a file is opened in 'w' mode, the returned file descriptor (FD) cannot be used to read the file. However, due to the implementation differences of file systems, some user-mode files opened in 'w' mode can be read by using FD. To perform the read or write operation on a file by using FD, you are advised to open the file in 'rw' mode. The write operations are mutually exclusive. After a write operation is complete, you must call **close** to close the file.
**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA
......@@ -1277,6 +1358,9 @@ open(mode: string): Promise&lt;number&gt;
Opens this file asset. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [open](js-apis-photoAccessHelper.md#open-1) instead.
**NOTE**<br>If a file is opened in 'w' mode, the returned FD cannot be used to read the file. However, due to the implementation differences of file systems, some user-mode files opened in 'w' mode can be read by using FD. To perform the read or write operation on a file by using FD, you are advised to open the file in 'rw' mode. The write operations are mutually exclusive. After a write operation is complete, you must call **close** to close the file.
**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA
......@@ -1317,6 +1401,9 @@ close(fd: number, callback: AsyncCallback&lt;void&gt;): void
Closes a file. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [close](js-apis-photoAccessHelper.md#close) instead.
**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1363,6 +1450,9 @@ close(fd: number): Promise&lt;void&gt;
Closes a file. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [close](js-apis-photoAccessHelper.md#close-1) instead.
**Required permissions**: ohos.permission.READ_MEDIA or ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1412,6 +1502,9 @@ getThumbnail(callback: AsyncCallback&lt;image.PixelMap&gt;): void
Obtains the thumbnail of this file asset. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [close](js-apis-photoAccessHelper.md#getThumbnail) instead.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1452,6 +1545,9 @@ getThumbnail(size: Size, callback: AsyncCallback&lt;image.PixelMap&gt;): void
Obtains the file thumbnail of the given size. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [close](js-apis-photoAccessHelper.md#getThumbnail-1) instead.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1494,6 +1590,9 @@ getThumbnail(size?: Size): Promise&lt;image.PixelMap&gt;
Obtains the file thumbnail of the given size. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [close](js-apis-photoAccessHelper.md#getThumbnail-2) instead.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1539,6 +1638,9 @@ favorite(isFavorite: boolean, callback: AsyncCallback&lt;void&gt;): void
Favorites or unfavorites this file asset. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [setFavorite](js-apis-photoAccessHelper.md#setfavorite) instead.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1580,6 +1682,9 @@ favorite(isFavorite: boolean): Promise&lt;void&gt;
Favorites or unfavorites this file asset. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [setFavorite](js-apis-photoAccessHelper.md#setfavorite-1) instead.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1624,6 +1729,9 @@ isFavorite(callback: AsyncCallback&lt;boolean&gt;): void
Checks whether this file asset is favorited. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1664,6 +1772,9 @@ isFavorite():Promise&lt;boolean&gt;
Checks whether this file asset is favorited. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1704,6 +1815,9 @@ Moves this file asset to the trash. This API uses an asynchronous callback to re
Files in the trash are not actually deleted. You can set **isTrash** to **false** to restore the files from the trash.
> **NOTE**
> This API is deprecated since API Version 9. Use [deleteAssets](js-apis-photoAccessHelper.md#deleteAssets) instead.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1747,6 +1861,9 @@ Moves this file asset to the trash. This API uses a promise to return the result
Files in the trash are not actually deleted. You can set **isTrash** to **false** to restore the files from the trash.
> **NOTE**
> This API is deprecated since API Version 9. Use [deleteAssets](js-apis-photoAccessHelper.md#deleteAssets-1) instead.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1791,6 +1908,9 @@ isTrash(callback: AsyncCallback&lt;boolean&gt;): void
Checks whether this file asset is in the trash. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1831,6 +1951,9 @@ isTrash():Promise&lt;boolean&gt;
Checks whether this file asset is in the trash. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -1867,12 +1990,18 @@ async function example() {
Provides APIs to manage the file retrieval result.
> **NOTE**
> This API is deprecated since API Version 9. Use [FetchResult](js-apis-photoAccessHelper.md#fetchresult) instead.
### getCount<sup>7+</sup>
getCount(): number
Obtains the total number of files in the result set.
> **NOTE**
> This API is deprecated since API Version 9. Use [getCount](js-apis-photoAccessHelper.md#getcount) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
......@@ -1905,6 +2034,9 @@ isAfterLast(): boolean
Checks whether the cursor is in the last row of the result set.
> **NOTE**
> This API is deprecated since API Version 9. Use [isAfterLast](js-apis-photoAccessHelper.md#isafterlast) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
......@@ -1945,6 +2077,9 @@ close(): void
Releases and invalidates this **FetchFileResult** instance. After this instance is released, the APIs in this instance cannot be invoked.
> **NOTE**
> This API is deprecated since API Version 9. Use [close](js-apis-photoAccessHelper.md#close) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Example**
......@@ -1969,6 +2104,9 @@ getFirstObject(callback: AsyncCallback&lt;FileAsset&gt;): void
Obtains the first file asset in the result set. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getFirstObject](js-apis-photoAccessHelper.md#getfirstobject) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -2006,6 +2144,9 @@ getFirstObject(): Promise&lt;FileAsset&gt;
Obtains the first file asset in the result set. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getFirstObject](js-apis-photoAccessHelper.md#getfirstobject-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
......@@ -2041,7 +2182,10 @@ getNextObject(callback: AsyncCallback&lt;FileAsset&gt;): void
Obtains the next file asset in the result set. This API uses an asynchronous callback to return the result.
> **NOTE**<br>Before using this API, you must use [getFirstObject](#getfirstobject7) to obtain the first file asset and then use [isAfterLast](#isafterlast7) to ensure that the cursor does not point to the last file asset in the result set.
> **NOTE**
>
> - Before using this API, you must use [getFirstObject](#getfirstobject7) to obtain the first file asset and then use [isAfterLast](#isafterlast7) to check that the cursor does not point to the last file asset in the result set.
> - This API is deprecated since API Version 9. Use [getNextObject](js-apis-photoAccessHelper.md#getnextobject) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2085,7 +2229,10 @@ getNextObject(): Promise&lt;FileAsset&gt;
Obtains the next file asset in the result set. This API uses a promise to return the result.
> **NOTE**<br>Before using this API, you must use [getFirstObject](#getfirstobject7) to obtain the first file asset and then use [isAfterLast](#isafterlast7) to ensure that the cursor does not point to the last file asset in the result set.
> **NOTE**
>
> - Before using this API, you must use [getFirstObject](#getfirstobject7) to obtain the first file asset and then use [isAfterLast](#isafterlast7) to check that the cursor does not point to the last file asset in the result set.
> - This API is deprecated since API Version 9. Use [getNextObject](js-apis-photoAccessHelper.md#getnextobject-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2126,6 +2273,9 @@ getLastObject(callback: AsyncCallback&lt;FileAsset&gt;): void
Obtains the last file asset in the result set. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getLastObject](js-apis-photoAccessHelper.md#getlastobject) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -2163,6 +2313,9 @@ getLastObject(): Promise&lt;FileAsset&gt;
Obtains the last file asset in the result set. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getLastObject](js-apis-photoAccessHelper.md#getlastobject-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
......@@ -2198,6 +2351,9 @@ getPositionObject(index: number, callback: AsyncCallback&lt;FileAsset&gt;): void
Obtains a file asset with the specified index in the result set. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getObjectByPosition](js-apis-photoAccessHelper.md#getobjectbyposition) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -2236,6 +2392,9 @@ getPositionObject(index: number): Promise&lt;FileAsset&gt;
Obtains a file asset with the specified index in the result set. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getObjectByPosition](js-apis-photoAccessHelper.md#getobjectbyposition-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -2277,6 +2436,9 @@ getAllObject(callback: AsyncCallback&lt;Array&lt;FileAsset&gt;&gt;): void
Obtains all the file assets in the result set. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getAllObjects](js-apis-photoAccessHelper.md#getallobjects) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Parameters**
......@@ -2316,6 +2478,9 @@ getAllObject(): Promise&lt;Array&lt;FileAsset&gt;&gt;
Obtains all the file assets in the result set. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getAllObjects](js-apis-photoAccessHelper.md#getallobjects-1) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
**Return value**
......@@ -2351,6 +2516,9 @@ async function example() {
Provides APIs to manage albums.
> **NOTE**
> This API is deprecated since API Version 9. Use [Album](js-apis-photoAccessHelper.md#album) instead.
### Attributes
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2371,6 +2539,9 @@ commitModify(callback: AsyncCallback&lt;void&gt;): void
Commits the modification on the album attributes to the database.
> **NOTE**
> This API is deprecated since API Version 9. Use [commitModify](js-apis-photoAccessHelper.md#commitmodify-2) instead.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2409,6 +2580,9 @@ commitModify(): Promise&lt;void&gt;
Commits the modification on the album attributes to the database.
> **NOTE**
> This API is deprecated since API Version 9. Use [commitModify](js-apis-photoAccessHelper.md#commitmodify-3) instead.
**Required permissions**: ohos.permission.READ_MEDIA and ohos.permission.WRITE_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2445,6 +2619,9 @@ getFileAssets(callback: AsyncCallback&lt;FetchFileResult&gt;): void
Obtains the file assets in this album. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getAssets](js-apis-photoAccessHelper.md#getassets) instead.
**Required permissions**: ohos.permission.READ_MEDIA
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2484,7 +2661,10 @@ async function example() {
getFileAssets(options: MediaFetchOptions, callback: AsyncCallback&lt;FetchFileResult&gt;): void
Obtains the file assets in this album. This API uses an asynchronous callback to return the result.
Obtains the file assets in this album based on specified conditions. This API uses an asynchronous callback to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getAssets](js-apis-photoAccessHelper.md#getassets) instead.
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -2530,7 +2710,10 @@ async function example() {
getFileAssets(options?: MediaFetchOptions): Promise&lt;FetchFileResult&gt;
Obtains the file assets in this album. This API uses a promise to return the result.
Obtains the file assets in this album based on specified conditions. This API uses a promise to return the result.
> **NOTE**
> This API is deprecated since API Version 9. Use [getAssets](js-apis-photoAccessHelper.md#getassets-1) instead.
**Required permissions**: ohos.permission.READ_MEDIA
......@@ -2579,6 +2762,9 @@ async function example() {
Defines information about a registered device.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.DistributedCore
......@@ -2594,6 +2780,9 @@ Defines information about a registered device.
Enumerates media types.
> **NOTE**
> This API is deprecated since API Version 9. Use [PhotoType](js-apis-photoAccessHelper.md#phototype) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Value| Description|
......@@ -2608,7 +2797,9 @@ Enumerates media types.
Enumerates key file information.
> **NOTE**
> The **bucket_id** field may change after file rename or movement. Therefore, you must obtain the field again before using it.
>
> - The **bucket_id** field may change after file rename or movement. Therefore, you must obtain the field again before using it.
> - This API is deprecated since API Version 9. Use [PhotoKeys](js-apis-photoAccessHelper.md#photokeys) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......@@ -2638,6 +2829,9 @@ Enumerates key file information.
Enumerates directory types.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Value| Description |
......@@ -2653,6 +2847,9 @@ Enumerates directory types.
Enumerates the device types.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System API**: This is a system API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.DistributedCore
......@@ -2671,6 +2868,9 @@ Enumerates the device types.
Defines the options for fetching media files.
> **NOTE**
> This API is deprecated since API Version 9. Use [FetchOptions](js-apis-photoAccessHelper.md#fetchoptions) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Type | Readable| Writable| Description |
......@@ -2686,6 +2886,9 @@ Defines the options for fetching media files.
Defines the image size.
> **NOTE**
> This API is deprecated since API Version 9. Use [image.Size](js-apis-image.md#size) instead.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Type | Readable | Writable | Description |
......@@ -2697,6 +2900,9 @@ Defines the image size.
Defines the media asset option.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Type | Readable| Writable| Description |
......@@ -2707,7 +2913,10 @@ Defines the media asset option.
## MediaSelectOption
Defines media selection option.
Defines the media selection option.
> **NOTE**
> This API is deprecated since API Version 9. There is no substitute API.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册