I’m hitting a bit of a wall with Expo AV in my React Native app on iOS, and I’m hoping someone here might have encountered this issue before. Here’s what’s going on: I’m trying to play a video using Expo AV, but every time I initiate playback, I get this really frustrating error code 1002 in the NSURLDomain. It’s super annoying because I’ve followed all the steps in the documentation, but it just doesn’t seem to work.
Initially, I thought it might be a problem with the video file itself, but I’ve tried different videos and the error persists across all of them. I’m pulling videos from a URL, and I double-checked that the videos are accessible. I even tried a couple of different formats – just in case there was an issue with compatibility – but no luck on that front either.
I’ve looked around the community forums and GitHub issues, but I haven’t really found anything that speaks directly to this code 1002 error. Some posts suggest it could be related to network connectivity or permission issues, but my app has all the necessary permissions set up in the Info.plist. Plus, I’m connected to a stable Wi-Fi network, so I really don’t think that’s the issue. I even tried it on multiple devices to be sure it’s not device-specific.
It feels like this is going to drive me crazy if I can’t figure it out soon. If anyone has dealt with this error or has any insights into potential fixes, I’d really appreciate your help! Maybe you had a similar problem that led you down the troubleshooting rabbit hole? Any debugging tips, code snippets, or suggestions for alternative ways to handle video playback would be greatly appreciated. Thanks in advance for any help you can offer!
The error code 1002 you are encountering while using Expo AV in your React Native iOS app typically indicates an issue related to video playback. Given that you’ve confirmed the accessibility of the video URLs and tested various formats without success, the culprit may lie in how the video references are being handled in your app. Ensure that the URLs you are using are well-formed, and try accessing them through a web browser to confirm they are reachable. Additionally, make sure you are using the correct method for playing remote videos in your code. Consider implementing the `Video` component properly, ensuring that the source prop is assigned an object with a URI, like this: `source={{ uri: ‘your_video_url’ }}`.
Another angle to explore is the networking and permissions settings. While you mentioned having the required permissions in your Info.plist, double-check that the `NSAppTransportSecurity` settings allow for arbitrary loads if you’re not using HTTPS. Sometimes, issues can arise if the app cannot handle the video over insecure connections. It may also help to debug the network requests using a tool like Flipper to see if there are any issues in the requests being made to fetch these videos. If you’ve exhausted these options, consider checking out the Expo documentation for any updates or changes in API that might have been introduced recently that could affect video playback.
Ugh, I totally get your frustration with the error code 1002 in NSURLDomain while using Expo AV! I’ve been tearing my hair out over similar issues before. Here are a few things you might want to check out:
NSAppTransportSecurity
settings if you’re accessing non-secure URLs.For debugging, maybe throw some console logs around your playback functions to see exactly where things are failing? It might give a clue.
If it keeps bugging you, looking into Github issues for similar cases or even filing a new one could be an option. Community help is gold sometimes!
Hope this helps a bit! Good luck!