aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2017-06-14 17:51:57 -0700
committerScott Jackson <daneren2005@gmail.com>2017-06-14 17:51:57 -0700
commita1f8a4eddd2593f4ce5e23ab0c1eea3f6a93af6f (patch)
tree7baaebe076235db2481dac8a0573986b0644f514 /app/src/main
parent807af83a4be6870daf3feb9de6273696d3a68587 (diff)
downloaddsub-a1f8a4eddd2593f4ce5e23ab0c1eea3f6a93af6f.tar.gz
dsub-a1f8a4eddd2593f4ce5e23ab0c1eea3f6a93af6f.tar.bz2
dsub-a1f8a4eddd2593f4ce5e23ab0c1eea3f6a93af6f.zip
Put the rewind/fastforward fallbacks back for bluetooth buttons and such
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/DownloadService.java14
1 files changed, 13 insertions, 1 deletions
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;
}