Commit 74e7f6b2 authored by Geoffrey Métais's avatar Geoffrey Métais

Fix crash on playback error

parent cd55bb56
......@@ -520,9 +520,6 @@ public class PlaybackService extends MediaBrowserServiceCompat{
executeUpdateProgress();
break;
case MediaPlayer.Event.EncounteredError:
showToast(getString(
R.string.invalid_location,
playlistManager.getCurrentMedia().getLocation()), Toast.LENGTH_SHORT);
executeUpdate();
executeUpdateProgress();
break;
......
......@@ -665,7 +665,12 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
next()
}
}
MediaPlayer.Event.EncounteredError -> next()
MediaPlayer.Event.EncounteredError -> {
service.showToast(service.getString(
R.string.invalid_location,
getCurrentMedia()?.getLocation() ?: ""), Toast.LENGTH_SHORT)
next()
}
}
service.onMediaPlayerEvent(event)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment