Fixed tracks being skipped.

This commit is contained in:
Felix Ableitner 2014-01-03 14:49:47 +01:00
parent 8d48f73e07
commit b98df87408

View file

@ -188,7 +188,7 @@ public class RemotePlayService extends Service implements RegistryListener {
case NO_MEDIA_PRESENT: case NO_MEDIA_PRESENT:
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_ERROR; mPlaybackState = MediaItemStatus.PLAYBACK_STATE_ERROR;
break; break;
default: default:
} }
} catch (Exception e) { } catch (Exception e) {
@ -247,6 +247,7 @@ public class RemotePlayService extends Service implements RegistryListener {
*/ */
@Override @Override
public void play(String uri, String metadata) throws RemoteException { public void play(String uri, String metadata) throws RemoteException {
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_BUFFERING;
mUpnpService.getControlPoint().execute(new SetAVTransportURI( mUpnpService.getControlPoint().execute(new SetAVTransportURI(
getService(mCurrentRenderer, "AVTransport"), getService(mCurrentRenderer, "AVTransport"),
uri, metadata) { uri, metadata) {
@ -264,6 +265,11 @@ public class RemotePlayService extends Service implements RegistryListener {
new Play(getService(mCurrentRenderer, new Play(getService(mCurrentRenderer,
"AVTransport")) { "AVTransport")) {
@Override
public void success(ActionInvocation invocation) {
mPlaybackState = MediaItemStatus.PLAYBACK_STATE_PLAYING;
}
@Override @Override
public void failure(ActionInvocation invocation, public void failure(ActionInvocation invocation,
UpnpResponse operation, String defaultMessage) { UpnpResponse operation, String defaultMessage) {