I'm trying to stream QuickTime video to an iPhone from an ASP.NET web application using an HttpHandler. When hosting the web application from IIS 5.1 (Windows XP), the video player opens and then displays the error 'The server is not correctly configured'. However, when using IIS 7.5 (Windows 7), the video plays fine.
The production environment is running IIS 6.0 and has the same problem, where attempting to play videos on the iPhone via Mobile Safari displays the error above.
I've checked the Http Headers and they appear to be practically the same between the two servers (apart from a few, such as the Server header, which will obviously be different), except they appear in different order, though I doubt that this is causing the problem.
According to this thread on Google Groups, adding the 'Accept-Ranges: bytes' header can help, though this made no difference for us. I've also added the ETag header, without any luck.
The code actually responsible for sending the file looks something like this:
Context.Response.Buffer = true;
Context.Response.ContentType = "video/x-m4v";
Context.Response.AppendHeader("Content-Disposition", "filename=\"Video.m4v\"");
Context.Response.AppendHeader("Content-Length", "23456789");
Context.Response.AppendHeader("Accept-Ranges", "bytes");
Context.Response.AppendHeader("ETag", GetETag(path));
Context.Response.TransmitFile(path);
The code above which transmits files appears to be functioning correctly and video files play back correctly in all desktop browsers and when hosting from IIS 7.5 on Windows 7. The problem is only apparent when attempting to play video files on the iPhone using Mobile Safari using the above code with the ASP.NET web application being hosted on IIS 5.1 or IIS 6.0.
Has anyone else experienced anything like this and got any ideas on what I can do to get this working?