Fixes #5
This commit is contained in:
parent
1e2b56b4e5
commit
6960fc0c18
1 changed files with 12 additions and 5 deletions
|
@ -380,11 +380,18 @@ public class RemotePlayServiceBinder extends IRemotePlayService.Stub {
|
||||||
Message msg = Message.obtain(null, Provider.MSG_STATUS_INFO, 0, 0);
|
Message msg = Message.obtain(null, Provider.MSG_STATUS_INFO, 0, 0);
|
||||||
Builder status = null;
|
Builder status = null;
|
||||||
|
|
||||||
if (positionInfo.getTrackURI() != null && positionInfo.getTrackURI().equals(itemId))
|
if (positionInfo.getTrackURI() != null && positionInfo.getTrackURI().equals(itemId)) {
|
||||||
status = new MediaItemStatus.Builder(mPlaybackState)
|
try {
|
||||||
.setContentPosition(positionInfo.getTrackElapsedSeconds() * 1000)
|
status = new MediaItemStatus.Builder(mPlaybackState)
|
||||||
.setContentDuration(positionInfo.getTrackDurationSeconds() * 1000)
|
.setContentPosition(positionInfo.getTrackElapsedSeconds() * 1000)
|
||||||
.setTimestamp(positionInfo.getAbsCount());
|
.setContentDuration(positionInfo.getTrackDurationSeconds() * 1000)
|
||||||
|
.setTimestamp(positionInfo.getAbsCount());
|
||||||
|
}
|
||||||
|
catch (NumberFormatException e) {
|
||||||
|
status = new MediaItemStatus.Builder(mPlaybackState);
|
||||||
|
Log.d(TAG, "Failed to read track position or duration", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
status = new MediaItemStatus.Builder(mPlaybackState);
|
status = new MediaItemStatus.Builder(mPlaybackState);
|
||||||
|
|
||||||
|
|
Reference in a new issue