Using Simon as a base, I got him to work. I have a FrameLayout as the parent element of a WebView . This is the base in Simon's answer. in onCreate I create a webview and add it to my FrameLayout called mWebContainer .
mWebView.setWebChromeClient(new WebChromeClient(){ public void onShowCustomView(View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback){ super.onShowCustomView(view, callback); if(Build.VERSION.SDK_INT >=14) { if (view instanceof FrameLayout) { mWebContainer.addView(view, new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER)); mWebContainer.setVisibility(View.VISIBLE); } } } });
elBradford
source share