From a1f8a4eddd2593f4ce5e23ab0c1eea3f6a93af6f Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Wed, 14 Jun 2017 17:51:57 -0700 Subject: Put the rewind/fastforward fallbacks back for bluetooth buttons and such --- .../github/daneren2005/dsub/service/DownloadService.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/github/daneren2005') diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index 6d11db9b..5ef629d0 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -1209,6 +1209,14 @@ public class DownloadService extends Service { return; } + // If only one song, just skip within song + if(shouldFastForward()) { + rewind(); + return; + } else if(playerState == PREPARING || playerState == PREPARED) { + return; + } + // Restart song if played more than five seconds. if (getPlayerPosition() > 5000 || (index == 0 && getRepeatMode() != RepeatMode.ALL)) { seekTo(0); @@ -1228,7 +1236,11 @@ public class DownloadService extends Service { next(forceCutoff, false); } public synchronized void next(boolean forceCutoff, boolean forceStart) { - if(playerState == PREPARING || playerState == PREPARED) { + // If only one song, just skip within song + if(shouldFastForward()) { + fastForward(); + return; + } else if(playerState == PREPARING || playerState == PREPARED) { return; } -- cgit v1.2.3