diff --git a/src/App.vue b/src/App.vue index 26ec4aca47be26073887862bfbcb7c08e31cd2ec..2dd63e028d7c87fd3fe3b50ba03a9307bb2a1c5e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,15 +1,17 @@ \ No newline at end of file diff --git a/src/uitls/preview.ts b/src/uitls/preview.ts index be9189d59b16e10ab225d183faee131c89eaf6ff..9f9c0e5ae622ee459e8bb433ea456aa70f49f259 100644 --- a/src/uitls/preview.ts +++ b/src/uitls/preview.ts @@ -1,11 +1,11 @@ //获取本地图片/视频链接 async function preview(e: any) { - const buffer = await e.target.files[0].arrayBuffer(); - + return URL.createObjectURL(new Blob([buffer])); + } /** @@ -39,10 +39,10 @@ function intercpt(calssname: HTMLElement) { * 截取本地视频某一帧 * @ramerate */ -function ramerate(url: string, width: string, height: string) { +function ramerate(url: string, width: string, height: string,mun:number) { return new Promise(function (resolve, reject) { const video = document.createElement('video') - video.currentTime = 8 // 指定帧数 + video.currentTime =mun|| 8 // 指定帧数 video.setAttribute('mut', 'true') video.setAttribute('crossOrigin', 'anonymous') // 处理跨域 video.setAttribute('crossOrigin', 'anonymous') // 处理跨域 @@ -82,4 +82,4 @@ function convert(url: any, name: string) { return new File([u8arr], name || 'png', { type: mime }) } -export {preview ,intercpt,convert,ramerate} \ No newline at end of file +export { preview, intercpt, convert, ramerate } \ No newline at end of file