title: How do I get HTML5 Video to scrub in chrome when delivered via a service?
body: <p>So due to content being on a different drive than my server application's virtual directory, I've had to implement a file getting service. </p>
  
  <p>I am able to the get the file size. Then I want to set the content headers so that the browser knows the total size and thus knows how to proportion the seek bar. </p>
  
  <p>Here I set the total size header:</p>
  
  <pre><code>   string bytes = Convert.ToString( fInfo.Length );                   
     Response.AddHeader("Content-Length", bytes );
     Response.AddHeader("Content-Range", "bytes 0-" + bytes + "/" + bytes);
  </code></pre>
  
  <p>Resulting in:</p>
  
  <pre><code>Content-Length: 1389363
  Content-Type: video/ogg
  Content-Range: bytes 0-1389363/1389364
  </code></pre>
  
  <p>I downloaded the resulting file and confirmed that the bytes match. Works fine in Firefox, all wacky in chrome. <strong>In chrome it plays to the end, but does not move the seek bar and then shows negative infinity in the current time when it reaches the end. ALSO I cannot scrub the video at all, presumably because it has an invalid duration.</strong> </p>
  
  <p>playing the same file directly in chrome works properly, so maybe it's some content header that chrome wants that firefox don't give a s#%t about?</p>
  
  <p>Any ideas? Wrong length unit? built-in server side g-zip encoding interfering? </p>
  
  <p>I'm using standard video object:</p>
  
  <pre><code>&lt;video class="videoplayer" controls="" autoplay="autoplay" tabindex="0"&gt;
  &lt;source type="video/ogg" src="http://vb_html.dev/GetFile.aspx?filename=c:/_assets/4c2c09c2-f2ff-e011-a992-009056af18ff/softsignage/softsignage-00000000600.ogv"&gt;&lt;/source&gt;
  Your browser does not support the video tag.
  &lt;/video&gt;
  </code></pre>
  
  <p>For more reference this is how I'm passing the file data:</p>
  
  <pre><code>  FileStream mystream = new FileStream(anyFilePath, FileMode.Open, FileAccess.Read);
                      byte[] buffer = new byte[4096];
                      using (BinaryReader reader = new BinaryReader(mystream))
                      {
  
                          while (true)
                          {
                              int bytesRead = mystream.Read(buffer, 0, buffer.Length);
                              if (bytesRead == 0) break;
                              Response.OutputStream.Write(buffer, 0, bytesRead);
                          }
                      }
  </code></pre>