mirror of
https://github.com/recloudstream/cloudstream.git
synced 2024-08-15 01:53:11 +00:00
make it production level, lol
This commit is contained in:
parent
647bd415a5
commit
bb5f831146
1 changed files with 12 additions and 25 deletions
|
@ -80,7 +80,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
protected open var isTv = false
|
protected open var isTv = false
|
||||||
protected var playerBinding: PlayerCustomLayoutBinding? = null
|
protected var playerBinding: PlayerCustomLayoutBinding? = null
|
||||||
|
|
||||||
private var durationMode : Int by UserPreferenceDelegate("duration_mode", 0)
|
private var durationMode : Boolean by UserPreferenceDelegate("duration_mode", false)
|
||||||
// state of player UI
|
// state of player UI
|
||||||
protected var isShowing = false
|
protected var isShowing = false
|
||||||
protected var isLocked = false
|
protected var isLocked = false
|
||||||
|
@ -1422,11 +1422,11 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
exoDuration.setOnClickListener {
|
exoDuration.setOnClickListener {
|
||||||
startUpdatingRemainingTime()
|
setRemainingTimeCounter(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
timeLeft.setOnClickListener {
|
timeLeft.setOnClickListener {
|
||||||
stopUpdatingRemainingTime()
|
setRemainingTimeCounter(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
skipChapterButton.setOnClickListener {
|
skipChapterButton.setOnClickListener {
|
||||||
|
@ -1514,18 +1514,17 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
return@setOnTouchListener false
|
return@setOnTouchListener false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// cs3 is peak media center
|
||||||
|
playerBinding?.exoPosition?.doOnTextChanged { _, _, _, _ ->
|
||||||
|
updateRemainingTime()
|
||||||
|
setRemainingTimeCounter(durationMode || SettingsFragment.isTrueTvSettings())
|
||||||
|
}
|
||||||
// init UI
|
// init UI
|
||||||
try {
|
try {
|
||||||
uiReset()
|
uiReset()
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
logError(e)
|
logError(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SettingsFragment.isTrueTvSettings()) {
|
|
||||||
startUpdatingRemainingTime() // cs3 is a bleeding edge media center itself
|
|
||||||
} else if (durationMode == 1 && !SettingsFragment.isTrueTvSettings()) {
|
|
||||||
startUpdatingRemainingTime()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SourceLockedOrientationActivity")
|
@SuppressLint("SourceLockedOrientationActivity")
|
||||||
|
@ -1541,7 +1540,6 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateRemainingTime() {
|
private fun updateRemainingTime() {
|
||||||
|
|
||||||
val duration = player.getDuration()
|
val duration = player.getDuration()
|
||||||
val position = player.getPosition()
|
val position = player.getPosition()
|
||||||
|
|
||||||
|
@ -1553,21 +1551,10 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun startUpdatingRemainingTime() {
|
private fun setRemainingTimeCounter(showRemaining: Boolean) {
|
||||||
|
durationMode = showRemaining
|
||||||
playerBinding?.exoPosition?.doOnTextChanged { _, _, _, _ ->
|
playerBinding?.exoDuration?.isInvisible= showRemaining
|
||||||
updateRemainingTime()
|
playerBinding?.timeLeft?.isVisible = showRemaining
|
||||||
}
|
|
||||||
|
|
||||||
playerBinding?.exoDuration?.isInvisible = true
|
|
||||||
playerBinding?.timeLeft?.isVisible = true
|
|
||||||
durationMode = 1
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun stopUpdatingRemainingTime() {
|
|
||||||
playerBinding?.timeLeft?.isInvisible = true
|
|
||||||
playerBinding?.exoDuration?.isVisible = true
|
|
||||||
durationMode = 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun dynamicOrientation(): Int {
|
private fun dynamicOrientation(): Int {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue