Skip to content

Commit f7f110e

Browse files
authored
Revert "Allow video players in Android WebView to maximize from Widget mode"
1 parent 2f9b2cd commit f7f110e

File tree

1 file changed

+0
-51
lines changed

1 file changed

+0
-51
lines changed

android/src/main/java/com/flutter_webview_plugin/WebviewManager.java

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -244,60 +244,9 @@ public void onProgressChanged(WebView view, int progress) {
244244
FlutterWebviewPlugin.channel.invokeMethod("onProgressChanged", args);
245245
}
246246

247-
// Allow switching to fullscreen e.g when playing a video
248-
249-
private View customView;
250-
private CustomViewCallback customViewCallback;
251-
252-
@Override
253-
public void onShowCustomView(View view, int requestedOrientation, CustomViewCallback callback) {
254-
onShowCustomView(view, callback);
255-
}
256-
257-
@Override
258-
public void onShowCustomView(View view, CustomViewCallback callback) {
259-
// if a view already exists then immediately terminate the new one
260-
if (customView != null) {
261-
callback.onCustomViewHidden();
262-
return;
263-
}
264-
265-
// add custom view to container and save reference
266-
customView = view;
267-
customViewCallback = callback;
268-
269-
FrameLayout rootView = (FrameLayout)webView.getRootView();
270-
rootView.addView(customView);
271-
272-
// hide webview and show custom view
273-
customView.setVisibility(View.VISIBLE);
274-
FrameLayout contentView = (FrameLayout)rootView.findViewById(android.R.id.content);
275-
contentView.setVisibility(View.GONE);
276-
}
277-
278-
@Override
279-
public void onHideCustomView() {
280-
super.onHideCustomView();
281-
if (customView == null)
282-
return;
283-
284-
// Hide the custom view and show Webview
285-
FrameLayout rootView = (FrameLayout)webView.getRootView();
286-
FrameLayout contentView = (FrameLayout)rootView.findViewById(android.R.id.content);
287-
contentView.setVisibility(View.VISIBLE);
288-
customView.setVisibility(View.GONE);
289-
290-
// Remove the custom view from its container and clear reference
291-
rootView.removeView(customView);
292-
customViewCallback.onCustomViewHidden();
293-
customView = null;
294-
}
295-
296247
public void onGeolocationPermissionsShowPrompt(String origin, GeolocationPermissions.Callback callback) {
297248
callback.invoke(origin, true, false);
298-
299249
}
300-
301250
});
302251
}
303252

0 commit comments

Comments
 (0)