reset watch position if nearly done with episode
This commit is contained in:
parent
e77ab2800a
commit
2b77b7578c
1 changed files with 7 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue