Fix bug in code to skip error items on Android.
This commit is contained in:
parent
d6e14ae9d6
commit
e977949d46
3 changed files with 11 additions and 7 deletions
|
@ -248,12 +248,10 @@ public class AudioPlayer implements MethodCallHandler, Player.EventListener, Met
|
|||
}
|
||||
sendError(String.valueOf(error.type), error.getMessage());
|
||||
errorCount++;
|
||||
if (player.hasNext()) {
|
||||
if (errorCount <= 5) {
|
||||
int nextIndex = currentIndex + 1;
|
||||
player.prepare(mediaSource);
|
||||
player.seekTo(nextIndex, 0);
|
||||
}
|
||||
if (player.hasNext() && currentIndex != null && errorCount <= 5) {
|
||||
int nextIndex = currentIndex + 1;
|
||||
player.prepare(mediaSource);
|
||||
player.seekTo(nextIndex, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue