Set headers on the Video Component?

Is there a way to set request headers on the <Video /> component? I need to play a m3u8 stream and set some authenticated headers in my request.

Hi @snly2386!

Setting arbitrary custom headers is, unfortunately, not supported at the moment, but you should be able to share cookies between fetch calls and Video loading (if you set cookies for a fetch response, when the Video instance loads a video source it should use the set cookies).

Let me know if this would work for you! :slightly_smiling_face:

1 Like

Hi, @sjchmiela!

My server uses JWT as Authentication method. Is there any way to previously set the headers for fetch to be later used by Video? If not, is there any other suggestion to load the source? An implementation like RN Image would be perfect for our use case.

Thanks in advance.

EDIT: Is it possible to set the Video source from a blob file? Thought of downloading the video file as a blob and showing later.

Unfortunately it’s not possible to pass custom headers to Video downloader right now. When it comes to downloading the file beforehand, it’s totally possible! Just download it to FileSystem and pass the URI to Video source prop. :slightly_smiling_face:

1 Like

Perfect, @sjchmiela! Thanks for the tips!

Just one extra note: it is possible to set the request headers for FileSystem.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.