1

I have an API that returns video stream with partial content (206) support. But this API needs some custom headers like authentication, so I use fetch to get the stream and create object URL.

I've created a fetch request:

let vidSrc = fetch(".../video", {
   headers: {
       Authorization: ...
   }
}).then((data) => {
   return URL.createObjectURL(data);
});

videoElement.src = vidSrc;

But then the object URL doesn't transfer the range request to the API service.

How can I get the partial content support with fetch and object URLs?

nrofis
  • 8,975
  • 14
  • 58
  • 113

0 Answers0