Bug
I'm using react-native-video
package for adding video player to my app. This error keeps getting thrown by react-native-video on Android. This happens when I play a video and seek it or sometimes when the video loads.
{"error": {"errorException": "com.google.android.exoplayer2.ExoPlaybackException: java.lang.IllegalStateException", "errorString": "ExoPlaybackException type : 1"}}
Platform
Android ReactNative Exoplayer
Environment info
react-native info
System:
OS: macOS 11.4
CPU: (8) x64 Apple M1
Memory: 27.89 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 14.17.0 - /usr/local/bin/node
Yarn: Not Found
npm: 7.19.1 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 23, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3
System Images: android-30 | Google APIs Intel x86 Atom, android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.3 => 0.63.3
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Library Version
react-native-video: 5.1.1
Steps To Reproduce
Exact steps to reproduce
Way 01
- Start playing in portrait mode.
- Switch to landscape mode and seek to some random position.
- Play the video.
- Video buffers for sometime and then error is thrown. Video doesn't continue playing.
Way 02
- Wrap the Video component in a small
View
as as follows:
<View style={{width: 200, height: 200}}>
...<Video/>
</View>
- Error is thrown as soon as the video is loaded.
Note
In both the cases, I have setcontrols={false}
and I was manually handling the seek, play, resume, etc.
Expected behaviour
- Error shouldn't be thrown when I seek and then resume playing it!
MORE INFO AND IMPLEMENTATION DETAILS ARE HERE
: GitHub Issue and Implementation gist