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.
This commit is contained in:
parent
d1c9490ce3
commit
33b7bf1ee1
@ -1316,7 +1316,8 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
} else if(cause instanceof MediaDrmCallbackException || cause instanceof DrmSessionException) {
|
||||
errorCode = "3005";
|
||||
errorString = getResources().getString(R.string.unrecognized_media_format);
|
||||
if (!hasDrmFailed) {
|
||||
// DrmSessionExceptions can be caused by a lot internal reasons for failure, in most cases they can be safely retried and playback will recover
|
||||
if (!hasDrmFailed || cause instanceof DrmSessionException) {
|
||||
// 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
|
||||
hasDrmFailed = true;
|
||||
playerNeedsSource = true;
|
||||
@ -1403,7 +1404,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
public void setSrc(final Uri uri, final String extension, Map<String, String> headers) {
|
||||
if (uri != null) {
|
||||
boolean isSourceEqual = uri.equals(srcUri);
|
||||
|
||||
hasDrmFailed = false;
|
||||
this.srcUri = uri;
|
||||
this.extension = extension;
|
||||
@ -1440,7 +1440,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
public void setRawSrc(final Uri uri, final String extension) {
|
||||
if (uri != null) {
|
||||
boolean isSourceEqual = uri.equals(srcUri);
|
||||
|
||||
this.srcUri = uri;
|
||||
this.extension = extension;
|
||||
this.mediaDataSourceFactory = buildDataSourceFactory(true);
|
||||
|
Loading…
Reference in New Issue
Block a user