I have an app in which i have a Video component.
About 1 out of 10 times the video fails to load and i get an error message saying:
java.lang.IllegalArgumentException
I have tried upgrading to SDK 32 and i am using loadAsync to fetch the mp4 file before rendering.
I have a local mp4 file in the assets folder and i have set these parameters in app.json
"packagerOpts": {
"assetExts": ["mp4"]
},
and
"assetBundlePatterns": [
"**/*",
"assets/videos/*"
],
Here is my video component:
<Video
source={require('../../assets/videos/quick_loop.mp4')}
ref={this._handleVideoRef}
rate={1.0}
volume={1.0}
isMuted={true}
resizeMode="contain"
shouldPlay
isLooping
onPlaybackStatusUpdate=
{(playbackStatus) => this._onPlaybackStatusUpdate(playbackStatus)}
style={{ flex: 1, width: null, height: null, alignSelf: 'stretch' }}
onError={event => console.log(event)}
/>
I have also tried using hosted mp4 files with the same error.
Grateful for any tips!