Skip to content

Commit

Permalink
Fixed Video full-screen not working
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonycr committed Jul 22, 2014
1 parent ae40af0 commit 60574c0
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions src/acr/browser/lightning/LightningView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1005,21 +1005,22 @@ public void onHideCustomView() {

@Override
public void onShowCustomView(View view, CustomViewCallback callback) {

if (view instanceof FrameLayout) {
FrameLayout frame = (FrameLayout) view;
if (frame.getFocusedChild() instanceof VideoView) {
VideoView video = (VideoView) frame.getFocusedChild();
video.stopPlayback();
frame.removeView(video);
video.setVisibility(View.GONE);
}
} else {
// While these lines might look like they work, in practive,
// Full-screen videos won't work correctly. I may test this out some more
// if (view instanceof FrameLayout) {
// FrameLayout frame = (FrameLayout) view;
// if (frame.getFocusedChild() instanceof VideoView) {
// VideoView video = (VideoView) frame.getFocusedChild();
// video.stopPlayback();
// frame.removeView(video);
// video.setVisibility(View.GONE);
// }
// } else {
Activity activity = mBrowserController.getActivity();
mBrowserController.onShowCustomView(view,
activity.getRequestedOrientation(), callback);

}
// }

super.onShowCustomView(view, callback);
}
Expand All @@ -1028,20 +1029,21 @@ public void onShowCustomView(View view, CustomViewCallback callback) {
@Deprecated
public void onShowCustomView(View view, int requestedOrientation,
CustomViewCallback callback) {

if (view instanceof FrameLayout) {
FrameLayout frame = (FrameLayout) view;
if (frame.getFocusedChild() instanceof VideoView) {
VideoView video = (VideoView) frame.getFocusedChild();
video.stopPlayback();
frame.removeView(video);
video.setVisibility(View.GONE);
}
} else {
// While these lines might look like they work, in practive,
// Full-screen videos won't work correctly. I may test this out some more
// if (view instanceof FrameLayout) {
// FrameLayout frame = (FrameLayout) view;
// if (frame.getFocusedChild() instanceof VideoView) {
// VideoView video = (VideoView) frame.getFocusedChild();
// video.stopPlayback();
// frame.removeView(video);
// video.setVisibility(View.GONE);
// }
// } else {
mBrowserController.onShowCustomView(view, requestedOrientation,
callback);

}
// }

super.onShowCustomView(view, requestedOrientation, callback);
}
Expand Down

0 comments on commit 60574c0

Please sign in to comment.