Skip to content

Commit 465979e

Browse files
committed
Do not change the aspectRation if the renderer is disabled
1 parent 7101aec commit 465979e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

app/src/main/java/org/schabi/newpipe/player/ui/VideoPlayerUi.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,11 @@ void onResizeClicked() {
15541554
@Override
15551555
public void onVideoSizeChanged(@NonNull final VideoSize videoSize) {
15561556
super.onVideoSizeChanged(videoSize);
1557+
// Starting with ExoPlayer 2.19.0, the VideoSize will report a width and height of 0
1558+
// if the renderer is disabled. In that case, we skip updating the aspect ratio.
1559+
if (videoSize.width == 0 || videoSize.height == 0) {
1560+
return;
1561+
}
15571562
binding.surfaceView.setAspectRatio(((float) videoSize.width) / videoSize.height);
15581563
}
15591564
//endregion

0 commit comments

Comments
 (0)