account for when MediaStatus returned from RemoteMediaPlayer is null

This commit is contained in:
Domingos Lopes 2016-03-27 20:01:15 -04:00
parent f79369a9ad
commit c915366c7b
1 changed files with 5 additions and 0 deletions

View File

@ -81,6 +81,11 @@ public class RemotePSMP extends PlaybackServiceMediaPlayer {
@Override
public void onRemoteMediaPlayerStatusUpdated() {
MediaStatus status = castMgr.getMediaStatus();
if (status == null) {
setBuffering(false);
setPlayerStatus(PlayerStatus.INDETERMINATE, null);
return;
}
Playable currentMedia = localVersion(status.getMediaInfo());
long position = status.getStreamPosition();
if (position > 0 && currentMedia.getPosition()==0) {