zoukankan      html  css  js  c++  java
  • vue项目html5调取手机摄像头录像并上传

    <video id="video" autoplay width="300" height="300" controls></video>
    <x-button class="video-btn" type="primary"  @click.native="upBtnFileFace">刷脸验证</x-button>
    <input class="file" ref="videoFace" name="file" type="file" accept="video/*" @change="updateFace" style="display: none" />
        
    methods: {
      updateFace(e) {
        const file = e.target.files[0] || e.dataTransfer.files[0]
        if (file) {
          // 本地预览
          const reader = new FileReader()
          const myVideo = document.querySelector('#video')
          reader.onloadend = (evt) => {
            myVideo.src = evt.target.result
          }
          reader.readAsDataURL(file)
          myVideo.play()
              
          // 上传
          const fd = new FormData()          
        fd.append(
    'file', file) ocrIdCard(fd).then(response => { if (response) { console.log(response) } }).catch(() => { }) } } }
  • 相关阅读:
    POJ2352
    POJ 2524 并查集
    A POJ1611
    树状dp--B
    spring mvc实现文件上传与下载
    Joda-Time
    JAVA对象与JSON之间的转换
    jackson-databind注解
    JPA注解
    springMVC、spring、jpa、springData整合配置
  • 原文地址:https://www.cnblogs.com/jackjo/p/9642137.html
Copyright © 2011-2022 走看看