# FilePreviewer
**Repository Path**: meowtechopensource/FilePreviewer
## Basic Information
- **Project Name**: FilePreviewer
- **Description**: 🪟 一个OpenHarmony的文件预览App
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 3
- **Forks**: 0
- **Created**: 2023-08-15
- **Last Updated**: 2025-01-03
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# 文件预览
## 项目介绍
一个OpenHarmony的文件预览App
文件预览无法直接打开
### 目前支持以下应用程序调用
- FileManager (org.ohosdev.filemanager)
### 在您的应用程序中调用文件预览
```
let wantInfo = {
deviceId: '', // deviceId为空表示本设备
// 指定使用文件预览
bundleName: 'org.ohosdev.ohpreview',
action: 'ohos.want.action.viewData',
entities: ['entity.system.default'],
//fileUrl: 文件的存储URI (Datashare://, file:// ...)
//type: 文件格式(必须全部大写) (HAP,TXT,JPG,MP4 ...)
//filename: 文件的纯文件名 (example.hap, Screenshot-91.jpg, test.txt, video.mp4 ...)
parameters : {'fileUrl':this.fileItem.uri,'type':this.fileItem.suffix,'fileName':this.fileItem.fileName}
}
var context = getContext(this) as common.UIAbilityContext
context.startAbility(wantInfo)
```
### 支持以下文件格式:
#### 文字
- TXT
- SRT
- ASS
- CSV
- XML
- HTML
#### 影像
- APNG
- PNG
- JPG
- SVG
- WEBP
- ICO
- JPEG
- GIF
#### 视频
- MP4
- MKV
- WMV
- WEBM
- AVI
- M4V
- MPG
- MPEG
- FLV
#### 音频
- MP3(即将推出,开发中)
- ...
#### HTML
- 渲染 HTML 文件 (即将推出,开发中)
#### HAP
- 安装HAP (1.1.0+)
## 开发环境
- DevEco Studio 4.0 Beta2
- SDK API9 3.2.13.5 Release
## 截图预览
