diff --git a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java index 703298a8..3eb6c9c1 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -1612,14 +1612,19 @@ class ReactExoplayerView extends FrameLayout implements supportedFormatLength++; } } - tracks = new int[supportedFormatLength + 1]; - int o = 0; - for (int k = 0; k < allTracks.length; k++) { - Format format = group.getFormat(k); - if (isFormatSupported(format)) { - tracks[o] = allTracks[k]; - supportedTrackList.add(allTracks[k]); - o++; + if (allTracks.length == 1) { + // With only one tracks we can't remove any tracks so attempt to play it anyway + tracks = allTracks; + } else { + tracks = new int[supportedFormatLength + 1]; + int o = 0; + for (int k = 0; k < allTracks.length; k++) { + Format format = group.getFormat(k); + if (isFormatSupported(format)) { + tracks[o] = allTracks[k]; + supportedTrackList.add(allTracks[k]); + o++; + } } } }