I am trying to play a video from an api in React Native, the request requires the Authorization header and uses basic authentication.
The video player works just fine as long as I do not use any extra headers but as soon as I add the Authorization header nothing works as the header simply is not passed in the request.
I have checked everything using Postman and everything works properly.
Here's my Video component:
<Video ref={playbackInstance} source={{ uri: path, headers: { Authorization: `Basic ${base64.encode(`${API_USER}:${API_PASS}`)}`, }, }} style={styles.video} useNativeControls resizeMode="contain" isLooping usePoster={true} onFullscreenUpdate={onFullscreenUpdate} />
I have logged the output of the base64 encoder and the result is correct, so the issue truly is as simple as the headers not being passed with the request. Can anyone assist me?