未验证 提交 5c1d5a17 编写于 作者: O openharmony_ci 提交者: Gitee

!22201 [翻译完成】#I7NOOK

Merge pull request !22201 from Annie_wang/PR21298
......@@ -42,7 +42,7 @@ let fetchOptions = {
};
```
Call **PhotoAccessHelper.getAssets** to obtain the image asset.
Call **PhotoAccessHelper.getAssets** to obtain image assets.
```ts
try {
......@@ -55,7 +55,7 @@ try {
}
```
### Obtaining an Image or Video by URI
### Obtaining an Image or Video Asset by URI
Example: Obtain the image with the file URI **file://media/Photo/1**.
......@@ -70,7 +70,7 @@ let fetchOptions = {
};
```
Call **PhotoAccessHelper.getAssets** to obtain the image asset.
Call **PhotoAccessHelper.getAssets** to obtain image assets.
```ts
try {
......@@ -103,7 +103,7 @@ let fetchOptions = {
};
```
Call **PhotoAccessHelper.getAssets** to obtain the image assets.
Call **PhotoAccessHelper.getAssets** to obtain image assets.
```ts
try {
......@@ -250,7 +250,7 @@ The files moved to the trash will be retained for 30 days, and deleted permanent
**Prerequisites**
- A **photoAccessHelper** instance is obtained
- A **photoAccessHelper** instance is obtained.
- The application has the **ohos.permission.WRITE_IMAGEVIDEO** and **ohos.permission.READ_IMAGEVIDEO** permissions.
Example: Move the first file in the result set to the trash.
......
......@@ -5,7 +5,7 @@ The **photoAccessHelper** module provides APIs for managing system albums, inclu
> **NOTE**
>
> Before you start, refer to [photoAccessHelper Overview](photoAccessHelper-overview.md) to learn how to obtain a **photoAccessHelper** instance and apply for permissions required.
> By default, the **photoAccessHelper** instance obtained in [photoAccessHelper Overview](photoAccessHelper-overview.md) is used when **photoAccessHelper** APIs are used. If the code for obtaining the **photoAccessHelper** instance is not added, an error indicating that **photoAccessHelper** is not defined is reported.
> By default, the **PhotoAccessHelper** instance obtained in [photoAccessHelper Overview](photoAccessHelper-overview.md) is used when **PhotoAccessHelper** APIs are used. If the code for obtaining the **PhotoAccessHelper** instance is not added, an error indicating that **PhotoAccessHelper** is not defined is reported.
To ensure application running efficiency, most **photoAccessHelper** calls are asynchronous in callback or promise mode. The following code samples use promise-based APIs. For details about the APIs, see [Album Management](../reference/apis/js-apis-photoAccessHelper.md).
Unless otherwise specified, all the media assets to be obtained in this document exist in the database. If no media asset is obtained when the sample code is executed, check whether the media assets exist in the database.
......@@ -133,8 +133,8 @@ Example: Unfavorite an image.
**How to Develop**
1. [Obtain the image and videos in **Favorites**](#obtaining-images-and-videos-in-favorites).
2. Set **isFavorite** to **false**.
3. Use **FileAsset.favorite** to remove the image from **Favorites**.
2. Set **favoriteState** to **false**.
3. Use **FileAsset.setFavorite** to remove the image from **Favorites**.
```ts
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册