Fix bug where PlayerView distorts video when video size is unknown

PiperOrigin-RevId: 541640959
(cherry picked from commit 8d8c514d1220904a8d2df3f9bc3176877df9f553)
This commit is contained in:
bachinger 2023-06-19 15:42:34 +01:00 committed by Marc Baechinger
parent 3631e1c6f3
commit e53796fc25

View File

@ -1603,7 +1603,8 @@ public class PlayerView extends FrameLayout implements AdViewProvider {
@Override
public void onVideoSizeChanged(VideoSize videoSize) {
if (videoSize.equals(VideoSize.UNKNOWN)
&& (player == null || player.getPlaybackState() == Player.STATE_IDLE)) {
|| player == null
|| player.getPlaybackState() == Player.STATE_IDLE) {
return;
}
updateAspectRatio();