diff options
| author | Teng-Hui Zhu <ztenghui@google.com> | 2011-06-10 17:45:39 -0700 |
|---|---|---|
| committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-06-13 10:10:51 -0700 |
| commit | 592b2a65b00f699f133e6fc898cbe76dd91e03ac (patch) | |
| tree | 47a02a0b6d1ab58959bebcb922db7adab84bbfb5 /core/java/android/webkit/HTML5VideoFullScreen.java | |
| parent | 622d5441975fa16636d3304d42d27659af14cb49 (diff) | |
Fix a NPE if the Chrome Client is not setup
This can happen when applications are using WebView to show HTML5 video in
full screen mode while not setting up WebChromeClient correctly.
Change-Id: I6575e3364f04f6eaf800f854d60992fe6c3be651
Diffstat (limited to 'core/java/android/webkit/HTML5VideoFullScreen.java')
| -rw-r--r-- | core/java/android/webkit/HTML5VideoFullScreen.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/core/java/android/webkit/HTML5VideoFullScreen.java b/core/java/android/webkit/HTML5VideoFullScreen.java index 44229a42be9a..4cae9d80d614 100644 --- a/core/java/android/webkit/HTML5VideoFullScreen.java +++ b/core/java/android/webkit/HTML5VideoFullScreen.java @@ -253,18 +253,19 @@ public class HTML5VideoFullScreen extends HTML5VideoView mLayout.setVisibility(View.VISIBLE); WebChromeClient client = webView.getWebChromeClient(); - client.onShowCustomView(mLayout, mCallback); - // Plugins like Flash will draw over the video so hide - // them while we're playing. - if (webView.getViewManager() != null) - webView.getViewManager().hideAll(); - - mProgressView = client.getVideoLoadingProgressView(); - if (mProgressView != null) { - mLayout.addView(mProgressView, layoutParams); - mProgressView.setVisibility(View.VISIBLE); + if (client != null) { + client.onShowCustomView(mLayout, mCallback); + // Plugins like Flash will draw over the video so hide + // them while we're playing. + if (webView.getViewManager() != null) + webView.getViewManager().hideAll(); + + mProgressView = client.getVideoLoadingProgressView(); + if (mProgressView != null) { + mLayout.addView(mProgressView, layoutParams); + mProgressView.setVisibility(View.VISIBLE); + } } - } /** |
