diff --git a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java index 1488719..af7ccea 100644 --- a/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java +++ b/src/com/github/nutomic/controldlna/mediarouter/MediaRouterPlayService.java @@ -227,6 +227,9 @@ public class MediaRouterPlayService extends Service { mSessionId = data.getString(MediaControlIntent.EXTRA_SESSION_ID); mItemId = data.getString(MediaControlIntent.EXTRA_ITEM_ID); mPollingStatus = true; + + new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack) + .getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class)); } }); } @@ -306,16 +309,14 @@ public class MediaRouterPlayService extends Service { new ControlRequestCallback() { @Override public void onResult(Bundle data) { - MediaItemStatus status = MediaItemStatus.fromBundle(data); + MediaItemStatus status = MediaItemStatus.fromBundle(data); + if (mRouterFragment.get() != null) mRouterFragment.get().receivePlaybackStatus(status); if (status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PENDING && status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_BUFFERING && status.getPlaybackState() != MediaItemStatus.PLAYBACK_STATE_PLAYING) stopForeground(true); - else - new CreateNotificationTask().execute(mPlaylist.get(mCurrentTrack) - .getFirstPropertyValue(DIDLObject.Property.UPNP.ALBUM_ART_URI.class)); if (status.getPlaybackState() == MediaItemStatus.PLAYBACK_STATE_FINISHED) { if (mCurrentTrack + 1 < mPlaylist.size())