Raba - Defend your code RSS 2.0
# Saturday, July 24, 2010

After we understand what video stream is all about and we wrote our first piece of SWFObject in Javascript. let’s try to have this working on our servers, of course that such things tend to fail. But let’s understand why…

First thing we need to understand is whether such failures occur due to my code, file format or server configuration.
let’s have a simple check trying to access the file directly using our browser.

IIS7:

configure your IIS to serve the following files: swf and mp4 using Static Content

<add name="FlashFiles" path="*.swf" verb="*" modules="StaticFileModule" scriptProcessor="" resourceType="File" requireAccess="Script" />
<add name="VideoFiles" path="*.mp4" verb="*" modules="StaticFileModule" scriptProcessor="" resourceType="File" requireAccess="Script" />


Setting handler(s) won’t be good enough, requesting the server again will return “404.3 – mime type missing”.
Don’t worry Adding new  mime type to IIS 7 - is easy:

<configuration>
    <system.webServer>
        <staticContent>
            <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
        </staticContent>
    </system.webServer>
</configuration> 

Apache:

While installing the static content on our static servers (apache) – we’ve found out that requesting the files from firefox return with “no content length” and “incorrect mime type”
adding the correct mime type to the /etc/mime.type

video/mp4     mp4

Check the Request\Response we’ve found out that our servers are still returning compressed response , googling it find out that Firefox cann’t handle gzipped video stream,
compression was selectively disabled by adding the following line to /etc/httpd/conf.d/static.d/static.conf:

SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|mp4)$ no-gzip dont-vary

Apache solution provided by Tomer G.

Saturday, July 24, 2010 11:01:30 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] - Trackback
IIS7 | Software Development | Web

Archive
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567
Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2013
Shani Raba
Sign In
Statistics
Total Posts: 146
This Year: 0
This Month: 0
This Week: 0
Comments: 97
Cool Stuff
Add to Technorati Favorites
Themes
Pick a theme:
All Content © 2013, Shani Raba
DasBlog theme 'Business' created by Christoph De Baene (delarou)