mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-19 09:23:59 +00:00
reset watch position if nearly done with episode
This commit is contained in:
@@ -1404,7 +1404,7 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
||||
exoPlayer.addAnalyticsListener(EventLogger())
|
||||
isInitialized = true
|
||||
}
|
||||
/*private fun selectSubtitleTrack() {
|
||||
/*private fun selectSubtitleTrack() { saving this for later
|
||||
// Get the current track groups
|
||||
val trackGroups = exoPlayer.currentTrackGroups
|
||||
|
||||
@@ -1544,6 +1544,12 @@ class ExoplayerView : AppCompatActivity(), Player.Listener {
|
||||
if (exoPlayer.duration < playbackPosition)
|
||||
exoPlayer.seekTo(0)
|
||||
|
||||
//if playbackPosition is within 90% of the episode length, reset it to 0
|
||||
if (playbackPosition > episodeLength * 0.9) {
|
||||
playbackPosition = 0
|
||||
exoPlayer.seekTo(0)
|
||||
}
|
||||
|
||||
if (!isTimeStampsLoaded && settings.timeStampsEnabled) {
|
||||
val dur = exoPlayer.duration
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
|
||||
Reference in New Issue
Block a user