I'm building an app that relies on being able to play Flash within a WebView and have after found everything works as expected up until the flash video is put into full screen. When request full screen, the screen goes black and the audio continues for about 5 seconds.
I initially was finding that the screen was going white, but adapted the solution in the article below, which has moved the goal post. Android ICS 4.0 Placing Flash WebView into full screen calls hideAll Method?
final WebView mWebView = (WebView)findViewById(R.id.webview);
WebSettings webSettings = mWebView.getSettings();
webSettings.setPluginState(WebSettings.PluginState.ON);
webSettings.setJavaScriptEnabled(true);
mWebView.requestFocusFromTouch();
mWebView.setWebViewClient(new WebViewClient());
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) {
mWebView.addView(view, new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
Gravity.CENTER));
mWebView.setVisibility(View.VISIBLE);
}
}
}
});
When the full screen flash video starts I see the following in logcat.
08-11 15:09:47.435: V/VideoSurfaceView(23871): surfaceCreated
08-11 15:09:47.435: V/VideoSurfaceView(23871): surfaceChanged format=842094169, width=480, height=690
The following answer makes reference to implementing onShowCustomView similar to the BaseUI class from the browser. There is a very similar method called showCustomView, I made an attempt to hack around my code to add the contents of the BaseUI class and surprising I managed to make my code compile and run, but it did not make a blind bit of difference.
flash player crashes when trying to enter fullscreen mode android 4.0
Thanks in advance for ideas and help....