flash player crashes when trying to enter fullscreen mode android 4.0

前端 未结 3 1556
执念已碎
执念已碎 2020-12-21 17:37

So I\'ve created an android app that plays video from blip.tv and various other flash-enabled websites. I use a Webview to display the video. Here is my code:

3条回答
  •  悲哀的现实
    2020-12-21 17:50

    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.

提交回复
热议问题