From f7f110edf67bfdb103c46fa20454df2af9add5fa Mon Sep 17 00:00:00 2001 From: Rafal Wachol Date: Thu, 15 Aug 2019 13:22:08 +0100 Subject: [PATCH] Revert "Allow video players in Android WebView to maximize from Widget mode" --- .../WebviewManager.java | 51 ------------------- 1 file changed, 51 deletions(-) diff --git a/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java b/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java index 92889829..35b9d659 100644 --- a/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java +++ b/android/src/main/java/com/flutter_webview_plugin/WebviewManager.java @@ -244,60 +244,9 @@ public void onProgressChanged(WebView view, int progress) { FlutterWebviewPlugin.channel.invokeMethod("onProgressChanged", args); } - // Allow switching to fullscreen e.g when playing a video - - private View customView; - private CustomViewCallback customViewCallback; - - @Override - public void onShowCustomView(View view, int requestedOrientation, CustomViewCallback callback) { - onShowCustomView(view, callback); - } - - @Override - public void onShowCustomView(View view, CustomViewCallback callback) { - // if a view already exists then immediately terminate the new one - if (customView != null) { - callback.onCustomViewHidden(); - return; - } - - // add custom view to container and save reference - customView = view; - customViewCallback = callback; - - FrameLayout rootView = (FrameLayout)webView.getRootView(); - rootView.addView(customView); - - // hide webview and show custom view - customView.setVisibility(View.VISIBLE); - FrameLayout contentView = (FrameLayout)rootView.findViewById(android.R.id.content); - contentView.setVisibility(View.GONE); - } - - @Override - public void onHideCustomView() { - super.onHideCustomView(); - if (customView == null) - return; - - // Hide the custom view and show Webview - FrameLayout rootView = (FrameLayout)webView.getRootView(); - FrameLayout contentView = (FrameLayout)rootView.findViewById(android.R.id.content); - contentView.setVisibility(View.VISIBLE); - customView.setVisibility(View.GONE); - - // Remove the custom view from its container and clear reference - rootView.removeView(customView); - customViewCallback.onCustomViewHidden(); - customView = null; - } - public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) { callback.invoke(origin, true, false); - } - }); }