forked from recloudstream/cloudstream
fixed resize
This commit is contained in:
parent
a194cae245
commit
e349339b5a
2 changed files with 2 additions and 11 deletions
|
@ -310,20 +310,12 @@ abstract class AbstractPlayerFragment(
|
||||||
fun resize(resize: PlayerResize, showToast: Boolean) {
|
fun resize(resize: PlayerResize, showToast: Boolean) {
|
||||||
setKey(RESIZE_MODE_KEY, resize.ordinal)
|
setKey(RESIZE_MODE_KEY, resize.ordinal)
|
||||||
val type = when (resize) {
|
val type = when (resize) {
|
||||||
PlayerResize.Fill -> AspectRatioFrameLayout.RESIZE_MODE_FIT
|
PlayerResize.Fill -> AspectRatioFrameLayout.RESIZE_MODE_FILL
|
||||||
PlayerResize.Fit -> AspectRatioFrameLayout.RESIZE_MODE_FILL
|
PlayerResize.Fit -> AspectRatioFrameLayout.RESIZE_MODE_FIT
|
||||||
PlayerResize.Zoom -> AspectRatioFrameLayout.RESIZE_MODE_ZOOM
|
PlayerResize.Zoom -> AspectRatioFrameLayout.RESIZE_MODE_ZOOM
|
||||||
}
|
}
|
||||||
player_view?.resizeMode = type
|
player_view?.resizeMode = type
|
||||||
|
|
||||||
exo_play?.setOnClickListener {
|
|
||||||
player.handleEvent(CSPlayerEvent.Play)
|
|
||||||
}
|
|
||||||
|
|
||||||
exo_pause?.setOnClickListener {
|
|
||||||
player.handleEvent(CSPlayerEvent.Pause)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (showToast)
|
if (showToast)
|
||||||
showToast(activity, resize.nameRes, Toast.LENGTH_SHORT)
|
showToast(activity, resize.nameRes, Toast.LENGTH_SHORT)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ import com.lagradost.cloudstream3.utils.UIHelper.popCurrentPage
|
||||||
import kotlinx.android.synthetic.main.fragment_player.*
|
import kotlinx.android.synthetic.main.fragment_player.*
|
||||||
import kotlinx.android.synthetic.main.player_custom_layout.*
|
import kotlinx.android.synthetic.main.player_custom_layout.*
|
||||||
|
|
||||||
// TODO Auto select subtitles
|
|
||||||
class GeneratorPlayer : FullScreenPlayer() {
|
class GeneratorPlayer : FullScreenPlayer() {
|
||||||
companion object {
|
companion object {
|
||||||
private var lastUsedGenerator: IGenerator? = null
|
private var lastUsedGenerator: IGenerator? = null
|
||||||
|
|
Loading…
Reference in a new issue