Set up a single place in your application in which to perform error handling in response to the ERROR state.
When the MediaPlayer object is in the ERROR state, it cannot exit this state until you either reset the MediaPlayer object (via the MediaPlayer.reset method) or load a new media resource (MediaPlayer.replaceCurrentItemMediaPlayer.ReplaceCurrentItem).
mediaPlayer.addEventListener(MediaPlayer.Event.PLAYBACK, new MediaPlayer.PlaybackEventListener() {
@Override
public void onStateChanged(MediaPlayer.PlayerState state, MediaPlayerNotification notification) {
if (state == MediaPlayer.PlayerState.ERROR) {
// handle PSDK error here
}
}
}