VEX-6625: Handle state to keep playing after gaining connection (#28)
This PR handles autoplay after disconnection Jira: VEX-6625 There was an error in react-native-video not being properly handled, in addition, the state of the player when reconnecting using a free user was not the expected one, requesting the player to keep playing when ready, made the behavior consistent in all scenarios Velocity PR: crunchyroll/velocity#2430 Reviews Major reviewer (domain expert): @jctorresM Minor reviewer: @jacob-livingston
This commit is contained in:
parent
b274541431
commit
9035e7dfc9
@ -817,7 +817,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
case Player.STATE_IDLE:
|
||||
case Player.STATE_ENDED:
|
||||
initializePlayer();
|
||||
break;
|
||||
case Player.STATE_BUFFERING:
|
||||
case Player.STATE_READY:
|
||||
if (!player.getPlayWhenReady()) {
|
||||
@ -827,7 +826,6 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
initializePlayer();
|
||||
}
|
||||
@ -1314,6 +1312,12 @@ class ReactExoplayerView extends FrameLayout implements
|
||||
setPlayWhenReady(true);
|
||||
return;
|
||||
}
|
||||
} else if (cause instanceof HttpDataSource.HttpDataSourceException) {
|
||||
// this exception happens when connectivity is lost
|
||||
updateResumePosition();
|
||||
initializePlayer();
|
||||
setPlayWhenReady(true);
|
||||
return;
|
||||
} else {
|
||||
errorCode = "2021";
|
||||
errorString = getResources().getString(R.string.unrecognized_media_format);
|
||||
|
Loading…
Reference in New Issue
Block a user