Merge pull request #1413 from react-native-community/bugfix/no-video-out-of-bounds
Fix Array Out of Bounds crash if no video tracks present
This commit is contained in:
commit
fd90167f31
@ -889,12 +889,14 @@ class ReactExoplayerView extends FrameLayout implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (groupIndex == C.INDEX_UNSET && trackType == C.TRACK_TYPE_VIDEO) { // Video auto
|
if (groupIndex == C.INDEX_UNSET && trackType == C.TRACK_TYPE_VIDEO) { // Video auto
|
||||||
|
if (groups.length != 0) {
|
||||||
TrackGroup group = groups.get(0);
|
TrackGroup group = groups.get(0);
|
||||||
tracks = new int[group.length];
|
tracks = new int[group.length];
|
||||||
groupIndex = 0;
|
groupIndex = 0;
|
||||||
for (int j = 0; j < group.length; j++) {
|
for (int j = 0; j < group.length; j++) {
|
||||||
tracks[j] = j;
|
tracks[j] = j;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (groupIndex == C.INDEX_UNSET) {
|
} else if (groupIndex == C.INDEX_UNSET) {
|
||||||
trackSelector.setParameters(disableParameters);
|
trackSelector.setParameters(disableParameters);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user