mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-30 06:34:34 +02:00
lower minimum video player height
This commit is contained in:
parent
a965003a9d
commit
ca9e321ef2
@ -750,12 +750,12 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
|||||||
|
|
||||||
if (_lastSourceFit == null || windowWidth != _lastWindowWidth || windowHeight != _lastWindowHeight) {
|
if (_lastSourceFit == null || windowWidth != _lastWindowWidth || windowHeight != _lastWindowHeight) {
|
||||||
val maxHeight = windowHeight * 0.4f
|
val maxHeight = windowHeight * 0.4f
|
||||||
|
val minHeight = windowHeight * 0.1f
|
||||||
|
|
||||||
val aspectRatio = h.toFloat() / w
|
val determinedHeight = windowWidth / w.toFloat() * h.toFloat()
|
||||||
val determinedHeight = (aspectRatio * windowWidth)
|
|
||||||
|
|
||||||
_lastSourceFit = determinedHeight
|
_lastSourceFit = determinedHeight
|
||||||
_lastSourceFit = _lastSourceFit!!.coerceAtLeast(220f)
|
_lastSourceFit = _lastSourceFit!!.coerceAtLeast(minHeight)
|
||||||
_lastSourceFit = _lastSourceFit!!.coerceAtMost(maxHeight)
|
_lastSourceFit = _lastSourceFit!!.coerceAtMost(maxHeight)
|
||||||
|
|
||||||
_desiredResizeModePortrait = if (_lastSourceFit != determinedHeight)
|
_desiredResizeModePortrait = if (_lastSourceFit != determinedHeight)
|
||||||
@ -770,14 +770,13 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
|||||||
|
|
||||||
val marginBottom =
|
val marginBottom =
|
||||||
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 7f, resources.displayMetrics)
|
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 7f, resources.displayMetrics)
|
||||||
.toInt()
|
|
||||||
val height = TypedValue.applyDimension(
|
val height = TypedValue.applyDimension(
|
||||||
TypedValue.COMPLEX_UNIT_DIP,
|
TypedValue.COMPLEX_UNIT_DIP,
|
||||||
_lastSourceFit!!,
|
_lastSourceFit!!,
|
||||||
resources.displayMetrics
|
resources.displayMetrics
|
||||||
)
|
)
|
||||||
val rootParams = LayoutParams(LayoutParams.MATCH_PARENT, (height + marginBottom).toInt())
|
val rootParams = LayoutParams(LayoutParams.MATCH_PARENT, (height + marginBottom).toInt())
|
||||||
rootParams.bottomMargin = marginBottom
|
rootParams.bottomMargin = marginBottom.toInt()
|
||||||
_root.layoutParams = rootParams
|
_root.layoutParams = rootParams
|
||||||
isFitMode = true
|
isFitMode = true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user