Try exoplayer reload on player error

This commit is contained in:
CappielloAntonio 2021-07-17 18:42:10 +02:00
parent a6ef60a0e7
commit 7e2ba5a71a

View file

@ -72,6 +72,9 @@ public class MultiPlayer implements Playback {
public void onPlayerError(ExoPlaybackException error) { public void onPlayerError(ExoPlaybackException error) {
Log.i(TAG, String.format("onPlayerError: %s", error.getMessage())); Log.i(TAG, String.format("onPlayerError: %s", error.getMessage()));
Toast.makeText(context, context.getResources().getString(R.string.unplayable_file), Toast.LENGTH_SHORT).show(); Toast.makeText(context, context.getResources().getString(R.string.unplayable_file), Toast.LENGTH_SHORT).show();
exoPlayer.clearMediaItems();
exoPlayer.prepare();
} }
}; };