How do I allow recording video as an option in Android Chrome when using <input type="file" />?

23 Views Asked by At

I have a React application that uses an input tag like the following:

<input
    ref={inputRef}
    type="file"
    style={{ display: "none" }}
    multiple={false}
    accept="video/*,image/jpeg,image/png,image/webp"
    onChange={onFileSelected} />

The native experience provided by this code works well on all devices and browsers except for Chrome on Android. The native experience here allows me to upload existing images and videos, upload new images directly from the camera, but it does not allow me to record new videos from the camera (as seen in the pictures below).

The images below are from a OnePlus device, but I have verified that the problem exists on Samsung devices also.

first upload screen

Tapping "Camera" displays this screen.

second upload screen

Is there some way I can inform the native experience that I'd also like to be able to record video? I am aware of the capture attribute but would ideally like to avoid opening straight in to the user's camera experience, if possible.

0

There are 0 best solutions below