possible fix for exoplayer errors
This commit is contained in:
parent
5d3977e4b6
commit
113c2a8481
1 changed files with 4 additions and 0 deletions
|
|
@ -70,6 +70,10 @@ public class LocalPlayer implements Playback {
|
||||||
@Override
|
@Override
|
||||||
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()));
|
||||||
|
|
||||||
|
exoPlayer.clearMediaItems();
|
||||||
|
exoPlayer.prepare();
|
||||||
|
|
||||||
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();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue