I want to display video of IP camera in android application. For this I am using a webview. In the navigator of my smartphone I can see and control the web camera but in the webview video is always black and controls don't work.
This is the source code of my activity :
public class MainActivity extends Activity {
private WebView webView;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_main);
webView = (WebView) findViewById(R.id.vision);
webView.setWebChromeClient(new WebChromeClient());
webView.setWebViewClient(new myWebViewClient());
webView.setHttpAuthUsernamePassword("http://192.168.1.2/", null, "admin", null);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setPluginState(PluginState.ON);
webView.loadUrl("http://192.168.1.2/");
}
public class myWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return true;
}
}
}
I got this error in the log ![enter image description here][1] web console uncaught reference error resolution is not defined.