Monday, July 9, 2012

Visual Studio Development Web Server, mp4 isn’t part of the set of built in known Mime types.

With HTML5 video element, I found the video missing when using Internet Explorer 9. IE9 supports the HTML5 video element, but the video was just missing.

Correcting the problem

Because Visual Studio’s Development Web Server is missing mp4 mime type, and to my knowledge there isn’t a way to add a missing mime type to Visual Studio’s Development Web Server built in know Mime types.

I added to the applications config.sys file:

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


This adds it to the IIS server, so now I need to switch from using the Development Web Server to Local IIS Server.


Within Visual Studio, I must be administrator when working under Local IIS. The process opening Visual Studio as Administrator:

Right click on Visual Studio’s shortcut icon > properties > shortcut tab > advanced button > check run as administrator checkbox.


Now when I open Visual Studio, I will be running Visual Studio as administrator.


Now set the application properties:


project > properties > Web > click Use Local IIS Server radio button. Project URL should be set to the application’s virtual directory path.


Now HTML5 videos should work using mp4. 


The purpose is solely for my notes.

2 comments:

  1. I was running into the same problem and came across your posting while scanning Google search results. This fixed my problem for IE9. However, my videos still don't play on Firefox. I tried the same technique for the .ogv extension but it got me nowhere. The video sits there with its controls but they don't play the video when clicked. If you got any ideas, could you post a reply. I'll check back later. BTW you never know when your "solely for my notes" will help someone else. Thanks. Bob the Builder.

    ReplyDelete
  2. Hi ,
    Thank you for this blog.
    It really helped.

    Regards
    Chirag Satasiya

    ReplyDelete