Skip to content

Instantly share code, notes, and snippets.

@nkenna
Last active June 21, 2018 08:31
Show Gist options
  • Save nkenna/592876b09accaa4c773baf215233d750 to your computer and use it in GitHub Desktop.
Save nkenna/592876b09accaa4c773baf215233d750 to your computer and use it in GitHub Desktop.
Code snippet on webview video streaming
private WebView webSurface;
String vidAddress = "http://192.168.43.25/view";
........
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
..........
webSurface = (WebView) findViewById(R.id.webView);
webSurface.setWebChromeClient(new WebChromeClient());
webSurface.getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND);
webSurface.getSettings().setJavaScriptEnabled(true);
webSurface.loadUrl(vidAddress);
.............
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment