diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-11-11 17:13:33 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-11-11 17:13:33 -0800 |
commit | 06500928e64adc048bf22a26acbb8af06341828e (patch) | |
tree | bc420f3c647d9af345f97ea93d762c10b4d4df1b /app/src/main | |
parent | f11605422ea06a83347b72bfa8cb867847cb49cd (diff) | |
download | dsub-06500928e64adc048bf22a26acbb8af06341828e.tar.gz dsub-06500928e64adc048bf22a26acbb8af06341828e.tar.bz2 dsub-06500928e64adc048bf22a26acbb8af06341828e.zip |
#591 Don't pass a position at all if we are going to next song
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java b/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java index 2f6ecd90..7d2b0a07 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java +++ b/app/src/main/java/github/daneren2005/dsub/service/ChromeCastController.java @@ -362,7 +362,7 @@ public class ChromeCastController extends RemoteController { ignoreNextPaused = true; } - mediaPlayer.load(apiClient, mediaInfo, autoStart, position * 1000L).setResultCallback(new ResultCallback<RemoteMediaPlayer.MediaChannelResult>() { + ResultCallback callback = new ResultCallback<RemoteMediaPlayer.MediaChannelResult>() { @Override public void onResult(RemoteMediaPlayer.MediaChannelResult result) { if (result.getStatus().isSuccess()) { @@ -372,7 +372,13 @@ public class ChromeCastController extends RemoteController { failedLoad(); } } - }); + }; + + if(position > 0) { + mediaPlayer.load(apiClient, mediaInfo, autoStart, position * 1000L).setResultCallback(callback); + } else { + mediaPlayer.load(apiClient, mediaInfo, autoStart).setResultCallback(callback); + } } catch (IllegalStateException e) { Log.e(TAG, "Problem occurred with media during loading", e); failedLoad(); |