Skip to content

Commit 33b7bf1

Browse files
VEX-6834: Android: Sometimes the player fails with RNV-3005 (#34)
Fix RNV-3005 errors when exiting the player and loading a new video immediately. In most cases this error was just happening internally and the user would not experience it, but it skewed the error rate reporting.
1 parent d1c9490 commit 33b7bf1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

+2-3
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,8 @@ else if (e.type == ExoPlaybackException.TYPE_SOURCE) {
13161316
} else if(cause instanceof MediaDrmCallbackException || cause instanceof DrmSessionException) {
13171317
errorCode = "3005";
13181318
errorString = getResources().getString(R.string.unrecognized_media_format);
1319-
if (!hasDrmFailed) {
1319+
// DrmSessionExceptions can be caused by a lot internal reasons for failure, in most cases they can be safely retried and playback will recover
1320+
if (!hasDrmFailed || cause instanceof DrmSessionException) {
13201321
// When DRM fails to reach the app level certificate server it will fail with a source error so we assume that it is DRM related and try one more time
13211322
hasDrmFailed = true;
13221323
playerNeedsSource = true;
@@ -1403,7 +1404,6 @@ public void onMetadata(Metadata metadata) {
14031404
public void setSrc(final Uri uri, final String extension, Map<String, String> headers) {
14041405
if (uri != null) {
14051406
boolean isSourceEqual = uri.equals(srcUri);
1406-
14071407
hasDrmFailed = false;
14081408
this.srcUri = uri;
14091409
this.extension = extension;
@@ -1440,7 +1440,6 @@ public void setReportBandwidth(boolean reportBandwidth) {
14401440
public void setRawSrc(final Uri uri, final String extension) {
14411441
if (uri != null) {
14421442
boolean isSourceEqual = uri.equals(srcUri);
1443-
14441443
this.srcUri = uri;
14451444
this.extension = extension;
14461445
this.mediaDataSourceFactory = buildDataSourceFactory(true);

0 commit comments

Comments
 (0)