Skip to content

Commit

Permalink
Changed the previous button behavior (FossifyOrg#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aga-C committed Apr 10, 2024
1 parent 2288aa7 commit e396456
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class MyWidgetProvider : AppWidgetProvider() {
} else {
when (action) {
NEXT -> player.seekToNextMediaItem()
PREVIOUS -> player.seekToPreviousMediaItem()
PREVIOUS -> if (player.contentPosition > 5000) player.seekTo(0) else player.seekToPreviousMediaItem()
PLAYPAUSE -> player.togglePlayback()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class SimpleMusicPlayer(private val exoPlayer: ExoPlayer) : ForwardingPlayer(exo

override fun seekToPrevious() {
play()
if (!maybeForcePrevious()) {
if (currentPosition > 5000) {
seekTo(0)
} else if (!maybeForcePrevious()) {
seekToPreviousCount += 1
seekWithDelay()
}
Expand Down

0 comments on commit e396456

Please sign in to comment.