parent
17676c0a60
commit
a5189eb4fa
2 changed files with 12 additions and 1 deletions
|
@ -1230,6 +1230,11 @@ class MPVPlayer(
|
||||||
throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.")
|
throw IllegalArgumentException("You should use global volume controls. Check out AUDIO_SERVICE.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun updateZoomMode(enabled: Boolean) {
|
||||||
|
val level = if (enabled) "1" else "0"
|
||||||
|
MPVLib.setOptionString("panscan", level)
|
||||||
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
/**
|
/**
|
||||||
* Fraction to which audio volume is ducked on loss of audio focus
|
* Fraction to which audio volume is ducked on loss of audio focus
|
||||||
|
|
|
@ -11,6 +11,7 @@ import android.view.WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_OFF
|
||||||
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
import com.google.android.exoplayer2.ui.AspectRatioFrameLayout
|
||||||
import com.google.android.exoplayer2.ui.StyledPlayerView
|
import com.google.android.exoplayer2.ui.StyledPlayerView
|
||||||
import dev.jdtech.jellyfin.PlayerActivity
|
import dev.jdtech.jellyfin.PlayerActivity
|
||||||
|
import dev.jdtech.jellyfin.mpv.MPVPlayer
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
|
|
||||||
|
@ -199,7 +200,12 @@ class PlayerGestureHelper(
|
||||||
}).apply { isQuickScaleEnabled = false }
|
}).apply { isQuickScaleEnabled = false }
|
||||||
|
|
||||||
private fun updateZoomMode(enabled: Boolean) {
|
private fun updateZoomMode(enabled: Boolean) {
|
||||||
playerView.resizeMode = if (enabled) AspectRatioFrameLayout.RESIZE_MODE_ZOOM else AspectRatioFrameLayout.RESIZE_MODE_FIT
|
if (playerView.player is MPVPlayer) {
|
||||||
|
(playerView.player as MPVPlayer).updateZoomMode(enabled)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
playerView.resizeMode = if (enabled) AspectRatioFrameLayout.RESIZE_MODE_ZOOM else AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun releaseAction(event: MotionEvent) {
|
private fun releaseAction(event: MotionEvent) {
|
||||||
|
|
Loading…
Reference in a new issue