diff --git a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java index 366bd6509e..dc5aefac6d 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicy.java @@ -72,9 +72,12 @@ public class DefaultLoadErrorHandlingPolicy implements LoadErrorHandlingPolicy { IOException exception = loadErrorInfo.exception; if (exception instanceof InvalidResponseCodeException) { int responseCode = ((InvalidResponseCodeException) exception).responseCode; - return responseCode == 404 // HTTP 404 Not Found. + return responseCode == 403 // HTTP 403 Forbidden. + || responseCode == 404 // HTTP 404 Not Found. || responseCode == 410 // HTTP 410 Gone. || responseCode == 416 // HTTP 416 Range Not Satisfiable. + || responseCode == 500 // HTTP 500 Internal Server Error. + || responseCode == 503 // HTTP 503 Service Unavailable. ? DEFAULT_TRACK_BLACKLIST_MS : C.TIME_UNSET; } diff --git a/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java b/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java index 50b06c14db..5ca434761a 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/upstream/DefaultLoadErrorHandlingPolicyTest.java @@ -77,8 +77,8 @@ public final class DefaultLoadErrorHandlingPolicyTest { public void getExclusionDurationMsFor_dontExcludeUnexpectedHttpCodes() { InvalidResponseCodeException exception = new InvalidResponseCodeException( - 500, - "Internal Server Error", + 418, + "I'm a teapot", Collections.emptyMap(), new DataSpec(Uri.EMPTY), /* responseBody= */ Util.EMPTY_BYTE_ARRAY);