Browse Source

Fixed Video full-screen not working

master v3.2.0.1a-beta
Anthony Restaino 10 years ago
parent
commit
60574c0db9
  1. 46
      src/acr/browser/lightning/LightningView.java

46
src/acr/browser/lightning/LightningView.java

@ -1005,21 +1005,22 @@ public class LightningView {
@Override @Override
public void onShowCustomView(View view, CustomViewCallback callback) { public void onShowCustomView(View view, CustomViewCallback callback) {
// While these lines might look like they work, in practive,
if (view instanceof FrameLayout) { // Full-screen videos won't work correctly. I may test this out some more
FrameLayout frame = (FrameLayout) view; // if (view instanceof FrameLayout) {
if (frame.getFocusedChild() instanceof VideoView) { // FrameLayout frame = (FrameLayout) view;
VideoView video = (VideoView) frame.getFocusedChild(); // if (frame.getFocusedChild() instanceof VideoView) {
video.stopPlayback(); // VideoView video = (VideoView) frame.getFocusedChild();
frame.removeView(video); // video.stopPlayback();
video.setVisibility(View.GONE); // frame.removeView(video);
} // video.setVisibility(View.GONE);
} else { // }
// } else {
Activity activity = mBrowserController.getActivity(); Activity activity = mBrowserController.getActivity();
mBrowserController.onShowCustomView(view, mBrowserController.onShowCustomView(view,
activity.getRequestedOrientation(), callback); activity.getRequestedOrientation(), callback);
} // }
super.onShowCustomView(view, callback); super.onShowCustomView(view, callback);
} }
@ -1028,20 +1029,21 @@ public class LightningView {
@Deprecated @Deprecated
public void onShowCustomView(View view, int requestedOrientation, public void onShowCustomView(View view, int requestedOrientation,
CustomViewCallback callback) { CustomViewCallback callback) {
// While these lines might look like they work, in practive,
if (view instanceof FrameLayout) { // Full-screen videos won't work correctly. I may test this out some more
FrameLayout frame = (FrameLayout) view; // if (view instanceof FrameLayout) {
if (frame.getFocusedChild() instanceof VideoView) { // FrameLayout frame = (FrameLayout) view;
VideoView video = (VideoView) frame.getFocusedChild(); // if (frame.getFocusedChild() instanceof VideoView) {
video.stopPlayback(); // VideoView video = (VideoView) frame.getFocusedChild();
frame.removeView(video); // video.stopPlayback();
video.setVisibility(View.GONE); // frame.removeView(video);
} // video.setVisibility(View.GONE);
} else { // }
// } else {
mBrowserController.onShowCustomView(view, requestedOrientation, mBrowserController.onShowCustomView(view, requestedOrientation,
callback); callback);
} // }
super.onShowCustomView(view, requestedOrientation, callback); super.onShowCustomView(view, requestedOrientation, callback);
} }

Loading…
Cancel
Save