Skip to content

Commit

Permalink
Add documentation for the capture attribute on file inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapp9 committed May 22, 2024
1 parent 4e1ede4 commit 4c6748b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,15 @@ Add permission in AndroidManifest.xml:

If the file input indicates that images or video is desired with [`accept`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept), then the WebView will attempt to provide options to the user to use their camera to take a picture or video.

Additionally, if the user- or environment-facing camera is specified with the [`capture`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#capture) attribute, the following must be added to the AndroidManifest.xml file for the camera to function consistently on some Android versions and devices:
```xml
<queries>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
</queries>
```

Normally, apps that do not have permission to use the camera can prompt the user to use an external app so that the requesting app has no need for permission. However, Android has made a special exception for this around the camera to reduce confusion for users. If an app _can_ request the camera permission because it has been declared, and the user has not granted the permission, it may not fire an intent that would use the camera (`MediaStore.ACTION_IMAGE_CAPTURE` or `MediaStore.ACTION_VIDEO_CAPTURE`). In this scenario, it is up to the developer to request camera permission before a file upload directly using the camera is necessary.

##### Check for File Upload support, with `static isFileUploadSupported()`
Expand Down

0 comments on commit 4c6748b

Please sign in to comment.