Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27138] Android: Add photo/video capture support to WebView

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2020-11-25T15:26:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 9.3.0
ComponentsAndroid
Labelsandoid, media, parity, webView
ReporterNikos Poulios
AssigneeJoshua Quick
Created2019-06-06T13:11:40.000+0000
Updated2020-11-25T15:26:21.000+0000

Description

*Summary:* Android's Ti.UI.WebView does not currently support "capturing" a photo or video when using one of the below input HTML elements. It will display a photo gallery selection activity window instead. * <input type="file" accept="image/*" capture="environment"/> * <input type="file" accept="video/*" capture="environment"/> *To-Do:* When configuring our Intent in [TiWebChromeClient.java](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiWebChromeClient.java), we need to set it to [MediaStore.ACTION_IMAGE_CAPTURE](https://developer.android.com/reference/android/provider/MediaStore#ACTION_IMAGE_CAPTURE) for photo capture support and [MediaStore.ACTION_VIDEO_CAPTURE](https://developer.android.com/reference/android/provider/MediaStore#ACTION_VIDEO_CAPTURE) for video capture support. We also need to show a CAMERA permission request dialog as well. *Note:* We can only add support for Android 5.0 and higher.

Attachments

FileDateSize
WebViewCaptureImageTest.js2020-09-19T02:49:57.000+00001005
WebViewCaptureVideoTest.js2020-09-19T02:49:57.000+00001195

Comments

  1. Joshua Quick 2020-09-19

    PR (master): https://github.com/appcelerator/titanium_mobile/pull/12105
  2. Sohail Saddique 2020-10-08

    FR passed for this part of the PR
  3. Samir Mohammed 2020-11-25

    *Closing ticket*. Fix verified in SDK version 9.3.0.v20201125050632. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/12105

JSON Source