fix(android): fix backward compatibility (#4020)

This commit is contained in:
Krzysztof Moch 2024-07-18 10:51:57 +02:00 committed by GitHub
parent 76d5e93c17
commit ab7e02e453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -238,13 +238,12 @@ public final class ExoPlayerView extends FrameLayout implements AdViewProvider {
// There are weird cases when video height and width did not change with rotation so we need change aspect ration to fix it // 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) { switch (format.rotationDegrees) {
// update aspect ratio ! // update aspect ratio !
case 90, 270 -> { case 90:
case 270:
layout.setVideoAspectRatio(format.width == 0 ? 1 : (format.height * format.pixelWidthHeightRatio) / format.width); 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); layout.setVideoAspectRatio(format.height == 0 ? 1 : (format.width * format.pixelWidthHeightRatio) / format.height);
} }
}
return; return;
} }
} }