From 39dee21efab52c5d868abe09c3feb63cd036f3e7 Mon Sep 17 00:00:00 2001 From: Nick Fujita Date: Wed, 30 Mar 2022 18:17:56 +0900 Subject: [PATCH] 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 --- .../exoplayer/ReactExoplayerLoadErrorHandlingPolicy.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerLoadErrorHandlingPolicy.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerLoadErrorHandlingPolicy.java index c701310f..d0d68de1 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerLoadErrorHandlingPolicy.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerLoadErrorHandlingPolicy.java @@ -16,7 +16,10 @@ public final class ReactExoplayerLoadErrorHandlingPolicy extends DefaultLoadErro @Override public long getRetryDelayMsFor(LoadErrorInfo loadErrorInfo) { - if (loadErrorInfo.exception instanceof HttpDataSourceException) { + if ( + loadErrorInfo.exception instanceof HttpDataSourceException && + (loadErrorInfo.exception.getMessage() == "Unable to connect" || loadErrorInfo.exception.getMessage() == "Software caused connection abort") + ) { // Capture the error we get when there is no network connectivity and keep retrying it return 1000; // Retry every second } else if(loadErrorInfo.errorCount < this.minLoadRetryCount) {