Home  >  Q&A  >  body text

javascript - It is possible to call the photo album or take pictures or record short videos and upload them on the mobile webpage. Has anyone done related functions? Please let me know. It can be used for projects. Urgent! ! !

Are there any related plug-ins or demos? My project was developed using VUE

欧阳克欧阳克2675 days ago1073

reply all(7)I'll reply

  • 代言

    代言2017-06-22 11:55:47

    You can check this out: http://blog.csdn.net/jwzhangj...

    reply
    0
  • 滿天的星座

    滿天的星座2017-06-22 11:55:47

    JS can’t control this. It’s decided by the browser. When you click input.type=file to upload a file, the browser decides where to select the file to upload.

    reply
    0
  • 欧阳克

    欧阳克2017-06-22 11:55:47

    html:

    <input type="file" @change="upload($event)">
    

    js:

    let vm=new Vue({
     el:'#app',
     data:{
    imageList:[]
    },
    methods:{
     upload(event){
     let files=event.target.files;
    //然后使用html5的文件函数进行 FileReader,在使用image函数和canvas的toDataUrl,把base64数据存入imageList
    }
    }
    })

    reply
    0
  • ringa_lee

    ringa_lee2017-06-22 11:55:47

    If you are a hybrid app, you need to call the native api interface. For example, the native api interface gives you an interface for shooting videos. You call it, and then after shooting the video, you will get a callback function, which will have what you need. The video address can then be uploaded. By the way, it is best to write it natively. In this way, you are only responsible for calling the interface. There is no way for js to directly call the mobile phone camera, you must go through the native one

    reply
    0
  • 習慣沉默

    習慣沉默2017-06-22 11:55:47

    http://blog.csdn.net/qq727013...

    Take a look at this, it can be cropped, but video is not supported currently, you can change it

    reply
    0
  • 黄舟

    黄舟2017-06-22 11:55:47

    Use the <input> accept attribute, such as <input type="file" accept="audio/,video/,image/*" />
    Reference

    reply
    0
  • 扔个三星炸死你

    扔个三星炸死你2017-06-22 11:55:47

    /a/11...
    There is a girl who used a PC browser to call the camera, take photos, and add watermarks. Please refer to it or ask her for advice.

    reply
    0
  • Cancelreply