问题
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