Skip to content

Commit

Permalink
fix(ReactExoplayerView): return unset track index when there are no t…
Browse files Browse the repository at this point in the history
…rack available

This fix was integrated on version 4.0.0. We need it in order to fix a problem
on Android, where the video freezes on the first frame when using a remote url
instead of an asset.

link to the upstream PR:
TheWidlarzGroup#1233
  • Loading branch information
rrosatti committed May 6, 2019
1 parent 252562d commit 24d05e6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,9 @@ public void setSelectedTrack(int trackType, String type, Dynamic value) {
}

private int getTrackIndexForDefaultLocale(TrackGroupArray groups) {
if (groups.length == 0) { // Avoid a crash if we try to select a non-existant group
return C.INDEX_UNSET;
}
int trackIndex = 0; // default if no match
String locale2 = Locale.getDefault().getLanguage(); // 2 letter code
String locale3 = Locale.getDefault().getISO3Language(); // 3 letter code
Expand Down

0 comments on commit 24d05e6

Please sign in to comment.