diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ac26914..60460e2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ * Support video caching for iOS [#955](https://github.com/react-native-community/react-native-video/pull/955) * Video caching cleanups [#1172](https://github.com/react-native-community/react-native-video/pull/1172) * Add ipod-library support [#926](https://github.com/react-native-community/react-native-video/pull/926/files) +* Fix crash on ExoPlayer when there are no audio tracks [#1233](https://github.com/react-native-community/react-native-video/pull/1233) +* Reduce package size [#1231](https://github.com/react-native-community/react-native-video/pull/1231) +* Remove unnecessary import in TextTrackType [#1229](https://github.com/react-native-community/react-native-video/pull/1229) ### Version 3.2.0 * Basic fullscreen support for Android MediaPlayer [#1138](https://github.com/react-native-community/react-native-video/pull/1138) diff --git a/TextTrackType.js b/TextTrackType.js index caff65a9..9dc14077 100644 --- a/TextTrackType.js +++ b/TextTrackType.js @@ -1,5 +1,3 @@ -import keyMirror from 'keymirror'; - export default { SRT: 'application/x-subrip', TTML: 'application/ttml+xml', 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 e098c72a..0c1a178f 100644 --- a/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java +++ b/android-exoplayer/src/main/java/com/brentvatne/exoplayer/ReactExoplayerView.java @@ -830,6 +830,10 @@ class ReactExoplayerView extends FrameLayout implements } 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 diff --git a/android/src/main/java/com/brentvatne/react/ReactVideoView.java b/android/src/main/java/com/brentvatne/react/ReactVideoView.java index b7c2eec5..3ff17a1f 100644 --- a/android/src/main/java/com/brentvatne/react/ReactVideoView.java +++ b/android/src/main/java/com/brentvatne/react/ReactVideoView.java @@ -1,6 +1,7 @@ package com.brentvatne.react; import android.annotation.SuppressLint; +import android.annotation.TargetApi; import android.app.Activity; import android.content.res.AssetFileDescriptor; import android.graphics.Matrix; diff --git a/package.json b/package.json index cfef620d..5fc9a51c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-video", - "version": "3.2.0", + "version": "3.2.1", "description": "A