mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Merge pull request #7045 from Bnyro/master
fix: crash when seeking backwards to negative time
This commit is contained in:
commit
cde9bc33e5
@ -327,7 +327,7 @@ abstract class AbstractPlayerService : MediaLibraryService(), MediaLibrarySessio
|
||||
}
|
||||
|
||||
private fun saveWatchPosition() {
|
||||
if (isTransitioning || !watchPositionsEnabled) return
|
||||
if (isTransitioning || !watchPositionsEnabled || !::videoId.isInitialized) return
|
||||
|
||||
exoPlayer?.let { PlayerHelper.saveWatchPosition(it, videoId) }
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ import androidx.activity.BackEventCompat
|
||||
import androidx.activity.OnBackPressedCallback
|
||||
import androidx.constraintlayout.motion.widget.MotionLayout
|
||||
import androidx.constraintlayout.motion.widget.TransitionAdapter
|
||||
import androidx.core.math.MathUtils.clamp
|
||||
import androidx.core.os.bundleOf
|
||||
import androidx.core.view.isGone
|
||||
import androidx.core.view.isVisible
|
||||
@ -397,8 +398,9 @@ class AudioPlayerFragment : Fragment(R.layout.fragment_audio_player), AudioPlaye
|
||||
|
||||
// update the time bar current value and maximum value
|
||||
binding.timeBar.valueTo = (duration / 1000).toFloat()
|
||||
binding.timeBar.value = minOf(
|
||||
binding.timeBar.value = clamp(
|
||||
currentPosition / 1000,
|
||||
binding.timeBar.valueFrom,
|
||||
binding.timeBar.valueTo
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user