Skip to content

Commit

Permalink
Merged in bugfix/handle-android-network-error (pull request #6)
Browse files Browse the repository at this point in the history
TAB-559 Handle SourceError

Approved-by: Piotr Rogulski
  • Loading branch information
n-bernat committed May 29, 2022
2 parents 1c9489c + ac53f51 commit 560f92d
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 560f92d

Please sign in to comment.