Skip to content

Commit

Permalink
Handle SourceError
Browse files Browse the repository at this point in the history
  • Loading branch information
n-bernat committed May 29, 2022
1 parent 1c9489c commit ac53f51
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,14 @@ public void onPlaybackStateChanged(int playbackState) {

@Override
public void onPlayerError(@NonNull final ExoPlaybackException error) {
eventSink.error("VideoError", "Video player had error " + error, null);
boolean isSourceError = error.type == ExoPlaybackException.TYPE_SOURCE;

if (isSourceError) {
eventSink.error("SourceError", "Source error: " + error, error);
}
else {
eventSink.error("VideoError", "Video player had error: " + error, error);
}
}
});

Expand Down

0 comments on commit ac53f51

Please sign in to comment.