提交 c7430029 编写于 作者: P panqiangbiao

fix code issue

Signed-off-by: Npanqiangbiao <panqiangbiao@huawei.com>
上级 5f2b7556
...@@ -19,7 +19,7 @@ function getMediaLibrary(context: Context): MediaLibrary; ...@@ -19,7 +19,7 @@ function getMediaLibrary(context: Context): MediaLibrary;
**系统能力**:SystemCapability.Multimedia.MediaLibrary.Core **系统能力**:SystemCapability.Multimedia.MediaLibrary.Core
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------- | ------- | ---- | -------------------- | | ------- | ------- | ---- | -------------------- |
...@@ -44,7 +44,7 @@ var mediaLibrary = mediaLibrary.getMediaLibrary(context); ...@@ -44,7 +44,7 @@ var mediaLibrary = mediaLibrary.getMediaLibrary(context);
## medialibrary.getFileAssets ## medialibrary.getFileAssets
getFileAssets(options: MediaFetchOptions, callback: AsyncCallback&lt;FetchFileResult&gt;): void; getFileAssets(options: MediaFetchOptions, callback: AsyncCallback&lt;FetchFileResult&gt;): void;
获取文件资源,使用callback方式返回异步结果。 获取文件资源,使用callback方式返回异步结果。
...@@ -137,7 +137,7 @@ on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'| ...@@ -137,7 +137,7 @@ on(type: 'deviceChange'|'albumChange'|'imageChange'|'audioChange'|'videoChange'|
``` ```
medialibrary.on('imageChange', () => { medialibrary.on('imageChange', () => {
// image file had changed, do something // image file had changed, do something
}) })
``` ```
## medialibrary.off ## medialibrary.off
...@@ -240,7 +240,7 @@ medialibrary.createAsset(mediaType, "image01.jpg", path).then (function (asset) ...@@ -240,7 +240,7 @@ medialibrary.createAsset(mediaType, "image01.jpg", path).then (function (asset)
## medialibrary.getPublicDirectory ## medialibrary.getPublicDirectory
getPublicDirectory(type: DirectoryType, callback: AsyncCallback<string>): void; getPublicDirectory(type: DirectoryType, callback: AsyncCallback&lt;string&gt;): void;
获取公共目录路径 获取公共目录路径
...@@ -271,7 +271,7 @@ media.getPublicDirectory(DIR_CAMERA,(err, dicResult) => { ...@@ -271,7 +271,7 @@ media.getPublicDirectory(DIR_CAMERA,(err, dicResult) => {
## medialibrary.getPublicDirectory ## medialibrary.getPublicDirectory
getPublicDirectory(type: DirectoryType): Promise<string>; getPublicDirectory(type: DirectoryType): Promise&lt;string&gt;;
获取公共目录路径 获取公共目录路径
...@@ -297,7 +297,7 @@ getPublicDirectory(type: DirectoryType): Promise<string>; ...@@ -297,7 +297,7 @@ getPublicDirectory(type: DirectoryType): Promise<string>;
let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA; let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA;
const dicResult = await media.getPublicDirectory(DIR_CAMERA); const dicResult = await media.getPublicDirectory(DIR_CAMERA);
if (dicResult == 'camera/') { if (dicResult == 'camera/') {
console.info('MediaLibraryTest : getPublicDirectory'); console.info('MediaLibraryTest : getPublicDirectory');
} else { } else {
console.info('MediaLibraryTest : getPublicDirectory failed'); console.info('MediaLibraryTest : getPublicDirectory failed');
} }
...@@ -518,7 +518,7 @@ const fetchFileResult = await media.getFileAssets(getImageOp); ...@@ -518,7 +518,7 @@ const fetchFileResult = await media.getFileAssets(getImageOp);
const asset = await fetchFileResult.getFirstObject(); const asset = await fetchFileResult.getFirstObject();
asset.title = ‘newtitle'; asset.title = ‘newtitle';
asset.commitModify(() => { asset.commitModify(() => {
console.info('commitModify success'); console.info('commitModify success');
} }
``` ```
...@@ -1186,7 +1186,7 @@ for (var i = 1; i < fetchCount; i++) { ...@@ -1186,7 +1186,7 @@ for (var i = 1; i < fetchCount; i++) {
console.info('MediaLibraryTest : isAfterLast:' + result); console.info('MediaLibraryTest : isAfterLast:' + result);
console.info('MediaLibraryTest : isAfterLast end'); console.info('MediaLibraryTest : isAfterLast end');
fetchFileResult.close(); fetchFileResult.close();
} }
} }
``` ```
...@@ -1814,7 +1814,7 @@ DirectoryType ...@@ -1814,7 +1814,7 @@ DirectoryType
| DIR_DOCUMENTS | 4 | 表示文档路径 | | DIR_DOCUMENTS | 4 | 表示文档路径 |
| DIR_DOWNLOAD | 5 | 表示下载路径 | | DIR_DOWNLOAD | 5 | 表示下载路径 |
DeviceType DeviceType
----------- -----------
枚举,设备类型。 枚举,设备类型。
...@@ -1829,7 +1829,7 @@ DeviceType ...@@ -1829,7 +1829,7 @@ DeviceType
| TYPE_CAR | 5 | 车载设备 | | TYPE_CAR | 5 | 车载设备 |
| TYPE_TV | 6 | 电视设备 | | TYPE_TV | 6 | 电视设备 |
## MediaFetchOptions ## MediaFetchOptions
检索条件。 检索条件。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册