file-preview-xylink
v1.1.41
Published
preview
Downloads
222
Readme
使用
// 安装
yarn add -D file-preview --registry http://10.80.84.176:4873/
// 引入
import FilePreview from "file-preview"
<FilePreview
url={props.url}
type={props.type}
name={props.name}
host={"testqa.xylinkedu.com"}
token={getSk()}
resourceType={props.resourceType}
size={props.size}
resourceId={props.resourceId}
businessId={props.businessId}
/>
参数
1. type // 文件后缀名(mp4,jpg...)
2. name // 文件名
3. size // 文件大小(大于100兆不支持预览)
4. url // 文件地址
5. resourceId // 资源id
6. businessId // 资源中心传storageId 同步备课传prepareLessonId
7. token // 教学平台的token标识符
8. host // 域名
使用
<h3>使用<h3>
<h2>import VideoPlayer from "file-preview-xylink" <h2>
<pre>
< FilePreview
url={'https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1906469856,4113625838&fm=26&gp=0.jpg'}
type={'jpg' || ""}
name={'test' || ""}
host={'vip.xylinkedu.com'}
token={'0ab3ff0f-b16d-4c8a-b2be-e3c88a81bc6a'}
resourceType={"STORAGE_CENTER"}
size={100 * 1024 * 1024}
/>
</pre>