In this flow, we first try the inline camera that uses the MediaStream
API. If that camera fails for some reason (e.g., the user does not give us
permission to use the camera), we fall back to <input type="file">.
If the browser supports input capture mode (see inputCaptureSupported()),
this will use the system camera. The user will not be allowed to upload an
arbitrary file from their camera roll.
If the browser does not support image capture mode (e.g., on desktop), it
falls back to an upload file dialog.
NOTE: This unfortunately introduces a few new material-ui components in
order to render progress bars. I suggest that we commit this and then
figure out how to remove/replace those components. Let me know if you
disagree.
In this flow, we first try the inline camera that uses the
MediaStream
API. If that camera fails for some reason (e.g., the user does not give us permission to use the camera), we fall back to<input type="file">
.If the browser supports input capture mode (see
inputCaptureSupported()
), this will use the system camera. The user will not be allowed to upload an arbitrary file from their camera roll.If the browser does not support image capture mode (e.g., on desktop), it falls back to an upload file dialog.
NOTE: This unfortunately introduces a few new material-ui components in order to render progress bars. I suggest that we commit this and then figure out how to remove/replace those components. Let me know if you disagree.