From ab7e02e4538c97340f13fb052b1cad94408b48fa Mon Sep 17 00:00:00 2001 From: Krzysztof Moch Date: Thu, 18 Jul 2024 10:51:57 +0200 Subject: [PATCH] fix(android): fix backward compatibility (#4020) --- .../main/java/com/brentvatne/exoplayer/ExoPlayerView.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java b/android/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java index d1ac522706..a57b91f940 100644 --- a/android/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java +++ b/android/src/main/java/com/brentvatne/exoplayer/ExoPlayerView.java @@ -238,12 +238,11 @@ private void updateForCurrentTrackSelections(Tracks tracks) { // There are weird cases when video height and width did not change with rotation so we need change aspect ration to fix it switch (format.rotationDegrees) { // update aspect ratio ! - case 90, 270 -> { + case 90: + case 270: layout.setVideoAspectRatio(format.width == 0 ? 1 : (format.height * format.pixelWidthHeightRatio) / format.width); - } - default -> { + default: layout.setVideoAspectRatio(format.height == 0 ? 1 : (format.width * format.pixelWidthHeightRatio) / format.height); - } } return; }