title: How do properly stream a video using partial content ranges from Azure blob storage?
body: <p>I have an mp4 video I've uploaded to Azure Blob Storage (blocks, storage v2). I am unable to serve the video using a <code>&lt;video&gt;</code> tag without there being a delay in playback as the video is completely downloaded from the server (with a 200 response status code). </p>
  
  <p>(To make matters worse, and while not exactly relevant to my question because I think it's more of a browser issue, the video is set to loop, and it is being redownloaded with each loop.)</p>
  
  <p>I would instead like to stream the video using partial content ranges so that playback begins immediately.</p>
  
  <p>I've tried sourcing the video directly, providing the absolute URI to the <code>&lt;video&gt;</code> tag <code>src</code> attribute; and I've also tried serving the video via an ASP .NET Core 3.1 controller method, returning a <code>FileStreamResult</code> and setting the <code>enableRangeProcessing</code> parameter to <code>true</code>. Here is that code:</p>
  
  <pre><code>public async Task&lt;IActionResult&gt; GetVideo(string videoUrl)
  {
      var httpClient = new HttpClient();
      var stream = await httpClient.GetStreamAsync(videoUrl);
      return File(stream, new MediaTypeHeaderValue("video/mp4").MediaType, true);
  }
  </code></pre>
  
  <p>It seems regardless of what I try, I cannot get a range response with a 206 status code. I've seen suggestions about using Azure Media Services, but it seems like overkill and that this should be something that's just supported without having to incorporate yet another service.</p>
  
  <p>Any help/suggestions would be greatly appreciated - thanks!</p>