title: .NET Core| MVC pass audio file to html5 player. Enable seeking
body: <p>Hi i have problem with html5 player and seeking.</p>
  
  <p>This is my action method: </p>
  
  <pre><code>public IActionResult GetAudio(string url)
      {
          var file = System.IO.File.ReadAllBytes(url);
          long fSize = file.Length;
          long startbyte = 0;
          long endbyte = fSize - 1;
          int statusCode = 200;
          var rangeRequest = Request.Headers["Range"].ToString();
  
          if (rangeRequest != "")
          {
              string[] range = Request.Headers["Range"].ToString().Split(new char[] { '=', '-' });
              startbyte = Convert.ToInt64(range[1]);
              if (range.Length &gt; 2 &amp;&amp; range[2] != "") endbyte = Convert.ToInt64(range[2]);
              if (startbyte != 0 || endbyte != fSize - 1 || range.Length &gt; 2 &amp;&amp; range[2] == "")
              { statusCode = 206; }
          }
  
          long desSize = endbyte - startbyte + 1;
          Response.StatusCode = statusCode;
          Response.ContentType = "audio/wav";
          Response.Headers.Add("Content-Accept", Response.ContentType);
          Response.Headers.Add("Content-Length", desSize.ToString());
          Response.Headers.Add("Content-Range", string.Format("bytes {0}-{1}/{2}", startbyte, endbyte, fSize));
  
          var stream = new MemoryStream(file, (int)startbyte, (int)desSize);
  
          return File(stream, Response.ContentType);
      }
  </code></pre>
  
  <p>Audio player working properly, but i cant seeking throw file. Progres bar also working properly(moving).
  When i try to seek audio stop for a while and continue playing with the same moment.</p>
  
  <p>Probably i must add so more Headers right?</p>