Camera and video control with HTML5 form android webview

左心房为你撑大大i 提交于 2021-02-19 08:37:05

问题


I use this guide : Camera and video control with HTML5

This example work excellent on Google Chrome but i can not make it work on Android webview. I also use permission : android.permission.CAMERA.


回答1:


Did you remember to add this to your onCreate

WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setAllowFileAccessFromFileURLs(true);
webSettings.setAllowUniversalAccessFromFileURLs(true);

You are probably missing the last two lines in your code.

Here is a working example




回答2:


Webview/ Android browser till recently support ways to access camera via webview. Thankfully now getUserMedia is supported

http://caniuse.com/#search=Accept http://caniuse.com/#feat=stream



来源:https://stackoverflow.com/questions/39547889/camera-and-video-control-with-html5-form-android-webview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!