Fixed playback stopping after first track of new playlist, fixed notification not showing.
This commit is contained in:
parent
b06d889c10
commit
6cab4b4d32
2 changed files with 3 additions and 10 deletions
|
@ -394,7 +394,8 @@ public class MediaRouterPlayService extends Service {
|
||||||
status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PLAYING)
|
status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PLAYING)
|
||||||
stopForeground(true);
|
stopForeground(true);
|
||||||
|
|
||||||
if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED)
|
if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED ||
|
||||||
|
status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_CANCELED)
|
||||||
playNext();
|
playNext();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -73,8 +73,6 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub {
|
||||||
|
|
||||||
private int mPlaybackState;
|
private int mPlaybackState;
|
||||||
|
|
||||||
private boolean mManuallyStopped;
|
|
||||||
|
|
||||||
SubscriptionCallback mSubscriptionCallback;
|
SubscriptionCallback mSubscriptionCallback;
|
||||||
|
|
||||||
private RemotePlayService mRps;
|
private RemotePlayService mRps;
|
||||||
|
@ -134,11 +132,6 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub {
|
||||||
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_PAUSED;
|
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_PAUSED;
|
||||||
break;
|
break;
|
||||||
case STOPPED:
|
case STOPPED:
|
||||||
if (mManuallyStopped) {
|
|
||||||
mManuallyStopped = false;
|
|
||||||
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_CANCELED;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_FINISHED;
|
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_FINISHED;
|
||||||
break;
|
break;
|
||||||
case TRANSITIONING:
|
case TRANSITIONING:
|
||||||
|
@ -291,7 +284,6 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void stop(String sessionId) throws RemoteException {
|
public void stop(String sessionId) throws RemoteException {
|
||||||
mManuallyStopped = true;
|
|
||||||
mRps.mUpnpService.getControlPoint().execute(
|
mRps.mUpnpService.getControlPoint().execute(
|
||||||
new Stop(mRps.getService(mRps.mDevices.get(sessionId), "AVTransport")) {
|
new Stop(mRps.getService(mRps.mDevices.get(sessionId), "AVTransport")) {
|
||||||
|
|
||||||
|
|
Reference in a new issue