diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-02-16 09:43:59 -0800 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-02-16 09:43:59 -0800 |
commit | 8547553fe375e538c716f53ca550746b380b1abd (patch) | |
tree | 251bc33e19bb0590b0bde9c4e8122776dc8e0acb | |
parent | 4b68e01a895217d450f5b85d4f8afbfb742bc616 (diff) | |
download | dsub-8547553fe375e538c716f53ca550746b380b1abd.tar.gz dsub-8547553fe375e538c716f53ca550746b380b1abd.tar.bz2 dsub-8547553fe375e538c716f53ca550746b380b1abd.zip |
Fix pressing next skipping twice
-rw-r--r-- | src/github/daneren2005/dsub/service/ChromeCastController.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/service/ChromeCastController.java b/src/github/daneren2005/dsub/service/ChromeCastController.java index 49f36997..982b7953 100644 --- a/src/github/daneren2005/dsub/service/ChromeCastController.java +++ b/src/github/daneren2005/dsub/service/ChromeCastController.java @@ -62,6 +62,7 @@ public class ChromeCastController extends RemoteController { private double gain = 0.5; public ChromeCastController(DownloadServiceImpl downloadService, CastDevice castDevice) { + downloadService.setPlayerState(PlayerState.PREPARING); this.downloadService = downloadService; this.castDevice = castDevice; @@ -299,7 +300,6 @@ public class ChromeCastController extends RemoteController { @Override public void onStatusUpdated() { MediaStatus mediaStatus = mediaPlayer.getMediaStatus(); - Log.d(TAG, "state: " + mediaStatus.getPlayerState()); switch(mediaStatus.getPlayerState()) { case MediaStatus.PLAYER_STATE_PLAYING: downloadService.setPlayerState(PlayerState.STARTED); @@ -311,8 +311,12 @@ public class ChromeCastController extends RemoteController { downloadService.setPlayerState(PlayerState.PREPARING); break; case MediaStatus.PLAYER_STATE_IDLE: - downloadService.setPlayerState(PlayerState.COMPLETED); - downloadService.next(); + if(mediaStatus.getIdleReason() == MediaStatus.IDLE_REASON_FINISHED) { + downloadService.setPlayerState(PlayerState.COMPLETED); + downloadService.next(); + } else { + downloadService.setPlayerState(PlayerState.IDLE); + } break; } } |