Programming Tips - Android MediaPlayer.setVideoScalingMode() does not work
Date: 2021apr21
OS: Android
Language: Java
Q. Android MediaPlayer.setVideoScalingMode() does not work
A. Its supposed to control the scaling, accepting parameters
VIDEO_SCALING_MODE_SCALE_TO_FIT
VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING
In Android 16+ but it doesn't work for me.
Sorry, most articles here are solutions.
At least we'll saving you some time.
I was able to do this by using size change listener and
then setting the layout params in there. Having to change the
size and position of the view isn't ideal because you have to undo
it for the next video you might play.