DON’T GZIP F4V’S 

SYMPTOMS

The other day we deployed a new site to the production servers only to find our video player was bugging out. Specifically in Firefox, it seemed that the file size and video length was not being interpreted correctly. Load complete events and video play complete events were being fired prematurely, if not instantaneously. It other browsers the bytes loaded of the net stream never updated, but the video played fine. It worked perfectly in our dev environment and had passed QA, but for some reason broke when deployed to production. This lead us to believe that it was environmental and  differences between the server configurations were at fault.

CAUSE

I’ve seen this type of thing before and wrote about it here. Using an HTTP proxy (I use Charles), I looked at the differences in responses to the F4V requests from the two servers. Both were returning a “plain-text” mime-type. Not a good thing, but still did not explain the differences in behavior. The only difference was the production server was using gzip compression for F4V files. I did a quick search on the web and found only two documented cases of malfunctioning F4Vs and gzip compression, so I figured it was worth writing about.

SOLUTION

The solution is to exclude F4Vs from gzip compression in your apache configuration. Unfortunately, we don’t have administration rights to out client’s servers, so we defaulted to the lower quality and slightly larger file size of FLV, which fixed the issue.

REFERENCES

  1. http://www.longtailvideo.com/support/forum/Setup-Problems/21791/MP4-and-Firefox-3-5-7-#msg143431
  2. http://stackoverflow.com/questions/1100888/f4v-player-works-on-every-site-but-one

IIS FLV MIME Type PWNS You 

If you are using FLVs on an IIS server (ex. Windows 2003 Server), make sure the MIME type settings for FLV is “flv-application/octet-stream”. If not, you may find yourself in a world of pain.

I recently had the glorious task of debugging someone else’s project for a client that shall remane nameless. The syptoms were when switching between videos using NetStream in Flash 7, the videos would stop loading/playing “only in IE”. The NetStream was closed between every source change.

The first thing I did was analyze the http headers and I noticed:

  • The return MIME type was “application/octet-stream”. This is incorrect.
  • The http request for the FLV would not close if you switced video sources before the FLV had fisnished loading. Flash in IE would then lock up after two open requests.
  • Unlike IE, Firefox would close the request for the FLV and wuold continue with no hiccups

This would lead you to beleive that there was a problem between Flash and IE. However, I moved the FLVs to another server(apahce) and there were no problem at all in IE or FF. So, the problem was specfically between IE and IIS. I did some searching and found this post with the same exact issue and also found this Adobe TechNote which outlines the proper settings for IIS.

After we changed the MIME type to “flv-application/octet-stream” all was good in the world and the people rejoiced.