We cannot make react-native-video player to play a video from a API file service
See original GitHub issueBug
Postman or android devices play it nicely, but on iOS platform we are facing the problem. Basically, a user logs in the application and makes a call to API service which returns the mp4 video.Postman header info is also attached. Any help is appreciated.
<Video
source={{
uri: "https://api.xxxx.org/v1/files/7afbd0c3-ab0e-4cfb-910a-10c058a07b20"
}}
// Can be a URL or a local file.
controls={true}
fullscreen={true}
resizeMode="contain"
ref={(ref) => {
this.player = ref
}}
/>
Platform
- iOS
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11
Top Results From Across the Web
We cannot make react-native-video player to play a video from ...
Basically, a user logs in the application and makes a call to API service which returns the mp4 video.Postman header info is also...
Read more >react-native-video - npm
Start using react-native-video in your project by running `npm i ... Indicates whether the player should only play the audio track and ...
Read more >Playing videos in React Native - BigBinary Blog
We decided to use react-native-video v5.1.1 for playing videos in React Native application. Here is the guide to set up the video player....
Read more >YouTube Player API Reference for iframe Embeds
The IFrame player API lets you embed a YouTube video player on your website and control the player using JavaScript. Using the API's...
Read more >Play and pause a video - Flutter documentation
You can use the video_player plugin to play videos stored on the file system, ... On iOS, the video_player plugin makes use of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi guys I’ve found a workaround, this might not work for everyone but still I’m posting it for the ones that need this urgent.
The thing is that like @Sanglepp said “Seems that iOS doesn’t play videos that have Content-Dispositon: “attachment” header.” so I decided to download the file locally and then pass that local video to the
<Video/>component.This approach worked for my because I have small videos on repeat (like “gifs”) so I didn’t have any problems downloading those videos and then showing them.
I’ve created a hook using
rn-fetch-blobthat downloads the video and returns the path where is located.and then I call that hook to get the working uri like this:
If you are using nestjs try this code