Workaround for SurfaceView not being hidden properly

This appears to be fixed in Oreo, but given how harmless
the workaround is we can probably just apply it on all
API levels to be sure.

Issue: #3160

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167709070
This commit is contained in:
olly 2017-09-06 05:40:33 -07:00 committed by Oliver Woodman
parent 17232f58a3
commit 013379fd3e

View File

@ -428,6 +428,15 @@ public final class SimpleExoPlayerView extends FrameLayout {
}
}
@Override
public void setVisibility(int visibility) {
super.setVisibility(visibility);
if (surfaceView instanceof SurfaceView) {
// Work around https://github.com/google/ExoPlayer/issues/3160
surfaceView.setVisibility(visibility);
}
}
/**
* Sets the resize mode.
*