Compatibility problem of calling camera and uploading files in photo albums in the front-end web page

now you need to develop a mobile project. One function is to click the button to call the camera, take and upload pictures, click button 2, call photo albums, and select photos to upload. The examples given on the Internet are basically

.
    <input type="file" accept="image/*" capture="camera">
    <input type="file" accept="video/*" capture="camcorder">
    <input type="file" accept="audio/*" capture="microphone">

after testing, it is no problem to open it in qq and Wechat. You can access the camera or photo album, but click unresponsive after some browsers are opened, and ask the bosses for a solution.

Mar.16,2021

I don't know which browsers don't work, but try changing accept to a specific format
such as

.
<input type="file" accept="image/jpeg,image/x-png" capture="camera" name="" id="" value="" />

I remember that a previous version of chrome on the computer side stuck when using "image/*". If it is really not supported by the browser, then there is really no way

Menu