diff --git a/.inscode b/.inscode index 70c7853df0c162981ebd7cf119d909c807920531..9fec9576d482baaf90d2f47230ce9133cfce99d4 100644 --- a/.inscode +++ b/.inscode @@ -1,4 +1,5 @@ run = "npm i && npm run dev" +language = "node" [deployment] build = "npm i && npm run build" @@ -8,3 +9,6 @@ run = "npm run preview" PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" XDG_CONFIG_HOME = "/root/.config" npm_config_prefix = "/root/${PROJECT_DIR}/.config/npm/node_global" + +[debugger] +program = "main.js" diff --git a/src/App.vue b/src/App.vue index 633a5dfe4e547c48bfa93740a290ba5ba370930a..d647cb27a20ce7c7ffc7fd5e7abd154d128034bb 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,47 +1,34 @@ - - - - + \ No newline at end of file diff --git a/src/uitls/preview.ts b/src/uitls/preview.ts new file mode 100644 index 0000000000000000000000000000000000000000..b0706c46b7cf953294f1d3e4515a822ab7eb99e1 --- /dev/null +++ b/src/uitls/preview.ts @@ -0,0 +1,38 @@ +//获取本地图片/视频链接 + +async function preview(e: any) { + + const buffer = await e.target.files[0].arrayBuffer(); + + return URL.createObjectURL(new Blob([buffer])); + +} + +/** + + * 截取本地视频第一帧 + + * 需要传入本地视频播放的video + + * @intercpt + +*/ + +//calssname==是渲染视频的video的id + +function intercpt(calssname: HTMLElement) { + + const canvas: any = document.createElement('canvas') + + const ratio = calssname.offsetHeight / 9 / 16 + + canvas.width = Math.ceil(calssname.offsetHeight / 9) * 16 + + canvas.height = calssname.offsetHeight + + canvas.getContext('2d').drawImage(calssname, 0, 0, canvas.width, canvas.height) + + return canvas.toDataURL('image/png', 1.0) + +} +export {preview ,intercpt} \ No newline at end of file