Skip to content

Commit 39dee21

Browse files
authored
Updates disableDisconnectError retry condition to be more specific (#22)
Updates disableDisconnectError retry condition to be more specific. Jira: VEX-6518 Reviews Major reviewer (domain expert): @armadilio3 Minor reviewer: @gabriel-rivero
1 parent e6dd52a commit 39dee21

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerLoadErrorHandlingPolicy.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ public ReactExoplayerLoadErrorHandlingPolicy(int minLoadRetryCount) {
1616

1717
@Override
1818
public long getRetryDelayMsFor(LoadErrorInfo loadErrorInfo) {
19-
if (loadErrorInfo.exception instanceof HttpDataSourceException) {
19+
if (
20+
loadErrorInfo.exception instanceof HttpDataSourceException &&
21+
(loadErrorInfo.exception.getMessage() == "Unable to connect" || loadErrorInfo.exception.getMessage() == "Software caused connection abort")
22+
) {
2023
// Capture the error we get when there is no network connectivity and keep retrying it
2124
return 1000; // Retry every second
2225
} else if(loadErrorInfo.errorCount < this.minLoadRetryCount) {

0 commit comments

Comments
 (0)