Add a delay after starting a new track when we won't move onto the next track. Fixes #1
This commit is contained in:
parent
b27be9ee66
commit
4501cdd14a
1 changed files with 8 additions and 2 deletions
|
@ -105,6 +105,8 @@ public class MediaRouterPlayService extends Service {
|
|||
|
||||
private boolean mPollingStatus = false;
|
||||
|
||||
private int mStartingTrack = 0;
|
||||
|
||||
private boolean mBound;
|
||||
|
||||
/**
|
||||
|
@ -270,6 +272,7 @@ public class MediaRouterPlayService extends Service {
|
|||
return;
|
||||
|
||||
mCurrentTrack = trackNumber;
|
||||
mStartingTrack = 3;
|
||||
Item track = mPlaylist.get(trackNumber);
|
||||
DIDLParser parser = new DIDLParser();
|
||||
DIDLContent didl = new DIDLContent();
|
||||
|
@ -483,10 +486,13 @@ public class MediaRouterPlayService extends Service {
|
|||
stopForeground(true);
|
||||
}
|
||||
|
||||
if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED ||
|
||||
status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_CANCELED) {
|
||||
if ((status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED ||
|
||||
status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_CANCELED) &&
|
||||
(mStartingTrack == 0)) {
|
||||
playNext();
|
||||
}
|
||||
if (mStartingTrack > 0)
|
||||
mStartingTrack--;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Reference in a new issue