Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
cf8034d0
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cf8034d0
编写于
7月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!7085 modify js-apis-medialibrary.md
Merge pull request !7085 from 胡伟奇/modify_medialibrary_md
上级
7a1126ce
90f4f897
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
17 deletion
+12
-17
zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
+12
-17
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-medialibrary.md
浏览文件 @
cf8034d0
...
...
@@ -136,7 +136,7 @@ let imagesfetchOp = {
selectionArgs: [imageType.toString()],
};
media.getFileAssets(imagesfetchOp).then(function(fetchFileResult){
console.info("getFileAssets successfully:
"+ JSON.stringify(dir
));
console.info("getFileAssets successfully:
image number is "+ fetchFileResult.getCount(
));
}).catch(function(err){
console.info("getFileAssets failed with error:"+ err);
});
...
...
@@ -900,7 +900,7 @@ open(mode: string, callback: AsyncCallback<number>): void
**注意**
:当前写操作是互斥的操作,写操作完成后需要调用close进行释放
**需要权限**
:ohos.permission.READ_MEDIA
('r'模式打开),ohos.permission.WRITE_MEDIA('w'模式打开)
**需要权限**
:ohos.permission.READ_MEDIA
or ohos.permission.WRITE_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
...
...
@@ -937,7 +937,7 @@ open(mode: string): Promise<number>
**注意**
:当前写操作是互斥的操作,写操作完成后需要调用close进行释放
**需要权限**
:ohos.permission.READ_MEDIA
('r'模式打开),ohos.permission.WRITE_MEDIA('w'模式打开)
**需要权限**
:ohos.permission.READ_MEDIA
or ohos.permission.WRITE_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
...
...
@@ -977,7 +977,7 @@ close(fd: number, callback: AsyncCallback<void>): void
关闭当前文件,使用callback方式返回异步结果。
**需要权限**
:ohos.permission.READ_MEDIA
('r'模式打开),ohos.permission.WRITE_MEDIA('w'模式打开)
**需要权限**
:ohos.permission.READ_MEDIA
or ohos.permission.WRITE_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
...
...
@@ -1018,7 +1018,7 @@ close(fd: number): Promise<void>
关闭当前文件,使用promise方式返回异步结果。
**需要权限**
:ohos.permission.READ_MEDIA
('r'模式打开),ohos.permission.WRITE_MEDIA('w'模式打开)
**需要权限**
:ohos.permission.READ_MEDIA
or ohos.permission.WRITE_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
...
...
@@ -1671,8 +1671,6 @@ async function example() {
获取文件检索结果中的下一个文件资产。此方法使用callback形式返回结果。
**需要权限**
:ohos.permission.READ_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
**参数**
:
...
...
@@ -1709,8 +1707,6 @@ async function example() {
获取文件检索结果中的下一个文件资产。此方法使用promise方式来异步返回FileAsset。
**需要权限**
:ohos.permission.READ_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
**返回值**
:
...
...
@@ -1846,8 +1842,6 @@ getPositionObject(index: number): Promise<FileAsset>
获取文件检索结果中具有指定索引的文件资产。此方法使用Promise形式返回文件Asset。
**需要权限**
:ohos.permission.READ_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
**参数**
:
...
...
@@ -1890,8 +1884,6 @@ getAllObject(callback: AsyncCallback<Array<FileAsset>>): void
获取文件检索结果中的所有文件资产。此方法使用Callback回调来返回FileAsset结果集。
**需要权限**
:ohos.permission.READ_MEDIA
**系统能力**
:SystemCapability.Multimedia.MediaLibrary.Core
**参数**
:
...
...
@@ -2119,8 +2111,9 @@ async function example() {
## PeerInfo<sup>8+</sup>
注册设备的信息。
此接口为系统接口。
**系统能力:**
以下各项对应的系统能力均为SystemCapability.Multimedia.MediaLibrary.Core
**系统能力:**
以下各项对应的系统能力均为SystemCapability.Multimedia.MediaLibrary.
Distributed
Core
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ---------- | -------------------------- | ---- | ---- | ---------------- |
...
...
@@ -2165,7 +2158,7 @@ async function example() {
| TITLE | title | 文件标题 |
| ARTIST | artist | 作者 |
| AUDIOALBUM | audio_album | 专辑 |
| DURATION | duration | 持续时间(单位:秒) |
| DURATION | duration | 持续时间(单位:
毫
秒) |
| WIDTH | width | 图片宽度(单位:像素) |
| HEIGHT | height | 图片高度(单位:像素) |
| ORIENTATION | orientation | 图片显示方向,即顺时针旋转角度,如0,90,180。(单位:度) |
...
...
@@ -2190,8 +2183,9 @@ async function example() {
## DeviceType<sup>8+</sup>
枚举,设备类型。
此接口为系统接口。
**系统能力:**
以下各项对应的系统能力均为SystemCapability.Multimedia.MediaLibrary.Core
**系统能力:**
以下各项对应的系统能力均为SystemCapability.Multimedia.MediaLibrary.
Distributed
Core
| 名称 | 说明 |
| ------------ | ---------- |
...
...
@@ -2221,6 +2215,7 @@ async function example() {
## Size<sup>8+</sup>
图片尺寸。
系统能力: 以下各项对应的系统能力均为SystemCapability.Multimedia.MediaLibrary.Core
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------ | ------ | ---- | ---- | -------- |
...
...
@@ -2253,4 +2248,4 @@ async function example() {
| 名称 | 类型 | 必填 | 描述 |
| ----- | ------ | ---- | -------------------- |
| type | string | 是 | 媒体类型,包括:image, video, media,当前仅支持media类型 |
| count | number | 是 | 媒体选择,count = 1表示单选,count大于1表示多选。 |
\ No newline at end of file
| count | number | 是 | 媒体选择,count = 1表示单选,count大于1表示多选。 |
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录