Arthur

Pemberton

Full-stack web applications developer


Problems seeking in Chrome’s HTML5 media player

April 2, 2014Arthur Pemberton0 Comments

If you are serving dynamic binary content via your ASP.net web application with rudimentary code (eg. simple HttpContext.BinaryWrite) you may find that when utilizing audio or video Chrome does not allow fast forwarding/seeking ahead. This is because Chrome relies strictly on the ability to request byte ranges to supply this functionality. This is done with the Accept-Range HTTP response header.

However, simply including this header will not get the job done — you have now told the user-agent (Chrome) that your web application is will to provide bytes of data in chuncks of bytes in ranges it requests. You may then be tempted to simple check for the Range HTTP request header in your .aspx page and process it. That itself is not enough. You need to make use of ASP.net’s ASHX handlers to properly process these request.

While approach this issue, I found some very good sample code to accomplish this (I had to modify it to meet my particular needs): VideoStreamer on CodePlex. I also found a nice intro into create custom ASHX handlers for ASP.net: ASP.NET ASHX Handler.


Leave a Reply