This commit is contained in:
Page Asgardius 2022-12-26 15:51:16 -07:00
parent 53afbd0acc
commit 7521067d3f

View file

@ -267,7 +267,7 @@ public class VideoPlayer extends AppCompatActivity {
playerView.setUseController(false); playerView.setUseController(false);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if(player.getVideoFormat() != null) { if(player.getVideoFormat() != null) {
ratio = new Rational(player.getVideoFormat().width, player.getVideoFormat().height); ratio = new Rational(Math.round(player.getVideoFormat().width*20*player.getVideoSize().pixelWidthHeightRatio), Math.round(player.getVideoFormat().height*20));
} else if(player.getAudioFormat() != null) { } else if(player.getAudioFormat() != null) {
ratio = new Rational(player.getAudioFormat().width, player.getAudioFormat().height); ratio = new Rational(player.getAudioFormat().width, player.getAudioFormat().height);
} else { } else {