I have a VideoView which is set up like this:
Jobbert's answer in Kotlin, in case anyone needs it:
val max = if (videoView.height > videoView.width) videoView.height else videoView.width videoView.layoutParams = ConstraintLayout.LayoutParams(max, max)