This happens in ICS because the show()
method in android.webkit.PluginFullScreenHolder
gets called when trying to go to fullscreen mode. This method does the following:
WebChromeClient client = mWebView.getWebChromeClient();
client.onShowCustomView(mLayout, mOrientation, mCallback);
If you do not set the WebChromeClient
on your WebView
, you will get an NPE.
This fixed our crash, however the WebView disappears and the fullscreen video is not shown.
See: Android ICS 4.0 Placing Flash WebView into full screen calls hideAll Method?
*** Update:
Ultimately, in order to get my WebView
to play flash videos in full screen mode I had to implement the onShowCustomView()
method in my WebChromeClient
in a fashion similar to what was done in the source code for the Android browser. The implementation of that method that I used for inspiration was in the BaseUI class:
https://github.com/android/platform_packages_apps_browser/blob/master/src/com/android/browser/BaseUi.java
I don't fully understand exactly what is happening here. I also wish I understood why the developers on ICS decided to require this method to be implemented. I wish I knew the value, or what problem this solved. In past versions, this fullscreen mode "just worked" now it requires a lot of digging.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…