未验证 提交 3a6afa09 编写于 作者: O openharmony_ci 提交者: Gitee

!3435 Done! 3331:【轻量级 PR】:update api6

Merge pull request !3435 from wusongqing/TR3331
...@@ -458,9 +458,9 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -458,9 +458,9 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
``` ```
let option = { let option = {
src : "file:///data/data/ohos.xxx.yyy/files/image.png", src : "/data/storage/el2/base/haps/entry/image.png",
mimeType : "image/jpeg", mimeType : "image/*",
relativePath : "imageDir/image2/" relativePath : "Pictures/"
}; };
mediaLibrary.getMediaLibrary().storeMediaAsset(option, (err, value) => { mediaLibrary.getMediaLibrary().storeMediaAsset(option, (err, value) => {
if (err) { if (err) {
...@@ -499,9 +499,9 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -499,9 +499,9 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
``` ```
let option = { let option = {
src : "file:///data/data/ohos.xxx.yyy/files/image.jpg", src : "/data/storage/el2/base/haps/entry/image.png",
mimeType : "image/jpeg", mimeType : "image/*",
relativePath : "imageDir/image2/" relativePath : "Pictures/"
}; };
mediaLibrary.getMediaLibrary().storeMediaAsset(option).then((value) => { mediaLibrary.getMediaLibrary().storeMediaAsset(option).then((value) => {
console.log("Media asset stored."); console.log("Media asset stored.");
...@@ -534,8 +534,8 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -534,8 +534,8 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
``` ```
let images = [ let images = [
"dataability:///media/external/images/media/50", "dataability:///media/xxxx/2",
"dataability:///media/external/images/media/55" "dataability:///media/xxxx/3"
]; ];
/* Online image usage mode /* Online image usage mode
let images = [ let images = [
...@@ -575,8 +575,8 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -575,8 +575,8 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
``` ```
let images = [ let images = [
"dataability:///media/external/images/media/50", "dataability:///media/xxxx/2",
"dataability:///media/external/images/media/55" "dataability:///media/xxxx/3"
]; ];
/* Online image usage mode /* Online image usage mode
let images = [ let images = [
...@@ -621,8 +621,8 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -621,8 +621,8 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
``` ```
let images = [ let images = [
"dataability:///media/external/images/media/50", "dataability:///media/xxxx/2",
"dataability:///media/external/images/media/55" "dataability:///media/xxxx/3"
]; ];
/* Online image usage mode /* Online image usage mode
let images = [ let images = [
...@@ -720,7 +720,7 @@ Provides APIs for encapsulating file asset attributes. ...@@ -720,7 +720,7 @@ Provides APIs for encapsulating file asset attributes.
**System capability**: SystemCapability.Multimedia.MediaLibrary.Core **System capability**: SystemCapability.Multimedia.MediaLibrary.Core
| Name | Type | Readable| Writable| Description | | Name | Type | Readable | Writable | Description |
| ------------------------- | ------------------------ | ---- | ---- | ------------------------------------------------------ | | ------------------------- | ------------------------ | ---- | ---- | ------------------------------------------------------ |
| id | number | Yes | No | File asset ID. | | id | number | Yes | No | File asset ID. |
| uri | string | Yes | No | File asset URI, for example, dataability:///media/image/2. | | uri | string | Yes | No | File asset URI, for example, dataability:///media/image/2. |
...@@ -738,7 +738,7 @@ Provides APIs for encapsulating file asset attributes. ...@@ -738,7 +738,7 @@ Provides APIs for encapsulating file asset attributes.
| audioAlbum<sup>8+</sup> | string | Yes | No | Audio album. | | audioAlbum<sup>8+</sup> | string | Yes | No | Audio album. |
| width | number | Yes | No | Image width, in pixels. | | width | number | Yes | No | Image width, in pixels. |
| height | number | Yes | No | Image height, in pixels. | | height | number | Yes | No | Image height, in pixels. |
| orientation | number | Yes | Yes | Image display direction (clockwise rotation angle, for example, 0, 90, or 180, in degrees).| | orientation | number | Yes | Yes | Image display direction (clockwise rotation angle, for example, 0, 90, or 180, in degrees). |
| duration<sup>8+</sup> | number | Yes | No | Duration, in seconds. | | duration<sup>8+</sup> | number | Yes | No | Duration, in seconds. |
| albumId | number | Yes | No | ID of the album to which the file belongs. | | albumId | number | Yes | No | ID of the album to which the file belongs. |
| albumUri<sup>8+</sup> | string | Yes | No | URI of the album to which the file belongs. | | albumUri<sup>8+</sup> | string | Yes | No | URI of the album to which the file belongs. |
...@@ -757,9 +757,9 @@ Checks whether this file asset is a directory. This API uses an asynchronous cal ...@@ -757,9 +757,9 @@ Checks whether this file asset is a directory. This API uses an asynchronous cal
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Parameter | Type | Mandatory | Description |
| -------- | ---------------------------- | ---- | ------------------- | | -------- | ---------------------------- | ---- | ------------------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the file asset is a directory.| | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the file asset is a directory. |
**Example** **Example**
...@@ -2229,9 +2229,9 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2229,9 +2229,9 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------ | ------ | ---- | ---------------------------------------- | | ------------ | ------ | ---- | ---------------------------------------- |
| src | string | Yes | URI of the media library. | | src | string | Yes | Absolute path of the local file of the application. |
| mimeType | string | Yes | Multipurpose Internet Mail Extensions (MIME) type of the media.<br>Example: 'image/\*' and 'video/\*'.| | mimeType | string | Yes | Multipurpose Internet Mail Extensions (MIME) type of the media.<br>The value can be 'image/\*', 'video/\*', 'audio/\*' or 'file\*'.|
| relativePath | string | No | Custom path for storing media assets. If this parameter is unspecified, media assets are stored in the default path. For example, if you set this parameter to **imageDir/image2/**, the media assets will be stored in **default/imageDir/image2/**, where **default** represents the default path.| | relativePath | string | No | Custom path for storing media assets, for example, 'Pictures/'. If this parameter is unspecified, media assets are stored in the default path.<br> Default path of images: 'Pictures/'<br> Default path of videos: 'Videos/'<br> Default path of audios: 'Audios/'<br> Default path of files: 'Documents/'|
## MediaSelectOption ## MediaSelectOption
...@@ -2243,5 +2243,5 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2243,5 +2243,5 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----- | ------ | ---- | -------------------- | | ----- | ------ | ---- | -------------------- |
| type | string | Yes | Media type, which can be **image** and **video**.| | type | string | Yes | Media type, which can be **image**, **media**, or **video**. Currently, only **media** is supported.|
| count | number | Yes | Maximum number of media assets that can be selected. | | count | number | Yes | Number of media assets selected. If **count** is set to **1**, one media asset can be selected. If **count** is greater than **1**, multiple media assets can be selected. |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册