Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
416af425
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
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看板
提交
416af425
编写于
6月 15, 2022
作者:
W
wusongqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
updated docs against 5324
Signed-off-by:
N
wusongqing
<
wusongqing@huawei.com
>
上级
188c64ed
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
7 deletion
+7
-7
en/application-dev/reference/apis/js-apis-medialibrary.md
en/application-dev/reference/apis/js-apis-medialibrary.md
+7
-7
未找到文件。
en/application-dev/reference/apis/js-apis-medialibrary.md
浏览文件 @
416af425
# Media Library Management
# Media Library Management
> **NOTE**<br>
> **NOTE**
>
> This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
> This component is supported since API version 6. Updates will be marked with a superscript to indicate their earliest API version.
## Modules to Import
## Modules to Import
...
@@ -93,7 +94,7 @@ let imagesfetchOp = {
...
@@ -93,7 +94,7 @@ let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
selectionArgs: [imageType.toString()],
};
};
media
Library
.getFileAssets(imagesfetchOp, (error, fetchFileResult) => {
media.getFileAssets(imagesfetchOp, (error, fetchFileResult) => {
if (fetchFileResult != undefined) {
if (fetchFileResult != undefined) {
console.info('mediaLibraryTest : ASSET_CALLBACK fetchFileResult success');
console.info('mediaLibraryTest : ASSET_CALLBACK fetchFileResult success');
fetchFileResult.getAllObject((err, fileAssetList) => {
fetchFileResult.getAllObject((err, fileAssetList) => {
...
@@ -135,7 +136,7 @@ let imagesfetchOp = {
...
@@ -135,7 +136,7 @@ let imagesfetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [imageType.toString()],
selectionArgs: [imageType.toString()],
};
};
media
Library
.getFileAssets(imagesfetchOp).then(function(fetchFileResult){
media.getFileAssets(imagesfetchOp).then(function(fetchFileResult){
console.info("getFileAssets successfully:"+ JSON.stringify(dir));
console.info("getFileAssets successfully:"+ JSON.stringify(dir));
}).catch(function(err){
}).catch(function(err){
console.info("getFileAssets failed with error:"+ err);
console.info("getFileAssets failed with error:"+ err);
...
@@ -182,7 +183,7 @@ Unsubscribes from the media library changes. This API uses an asynchronous callb
...
@@ -182,7 +183,7 @@ Unsubscribes from the media library changes. This API uses an asynchronous callb
**Example**
**Example**
```
```
media
Library
.off('imageChange', () => {
media.off('imageChange', () => {
// stop listening success
// stop listening success
})
})
```
```
...
@@ -350,7 +351,7 @@ let AlbumNoArgsfetchOp = {
...
@@ -350,7 +351,7 @@ let AlbumNoArgsfetchOp = {
selections: '',
selections: '',
selectionArgs: [],
selectionArgs: [],
};
};
media
Library
.getAlbums(AlbumNoArgsfetchOp, (err, albumList) => {
media.getAlbums(AlbumNoArgsfetchOp, (err, albumList) => {
if (albumList != undefined) {
if (albumList != undefined) {
const album = albumList[0];
const album = albumList[0];
console.info('album.albumName = ' + album.albumName);
console.info('album.albumName = ' + album.albumName);
...
@@ -390,7 +391,7 @@ let AlbumNoArgsfetchOp = {
...
@@ -390,7 +391,7 @@ let AlbumNoArgsfetchOp = {
selections: '',
selections: '',
selectionArgs: [],
selectionArgs: [],
};
};
media
Library
.getAlbums(AlbumNoArgsfetchOp).then(function(albumList){
media.getAlbums(AlbumNoArgsfetchOp).then(function(albumList){
console.info("getAlbums successfully:"+ JSON.stringify(albumList));
console.info("getAlbums successfully:"+ JSON.stringify(albumList));
}).catch(function(err){
}).catch(function(err){
console.info("getAlbums failed with error:"+ err);
console.info("getAlbums failed with error:"+ err);
...
@@ -439,7 +440,6 @@ Call this API when you no longer need to use the APIs in the **MediaLibrary** in
...
@@ -439,7 +440,6 @@ Call this API when you no longer need to use the APIs in the **MediaLibrary** in
**Example**
**Example**
```
```
var media = mediaLibrary.getMediaLibrary(context);
media.release()
media.release()
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录