Force IE9 into browser compatibility view

See MSDN documentation.
You should use emulateIE7 since compatibility mode is kind of IE7:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">

Edit

If the above does not work, the other options are really poor.
Quoting from the link above:

  • Microsoft has not placed the domain name of the site on a blacklist. (blacklist linked in original article is very old and not being updated, you can find a local copy on your computer)
  • An intranet admin has not placed the site on a blacklist.
  • The user has not pressed the Compatibility View button (duh)
  • The site is not in the intranet zone
  • The page is not framed by a Compatibility Mode page.

The above are, AFAIK, the only causes for compatibility mode.
Unless you are prepared to contact Microsoft directly to have your website added to the global blacklist, there isn't much you can do (unless you want to wrap your site in a frame that originates from a blacklisted domain).


I've tried the various methods suggested by the MSDN article at http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx regarding forcing IE9 to emulate a previous version with the X-UA-Compatible header in order to display correctly.

In my case, the test is playing an MP4 video file in an IE9 browser which is using the default standard mode rather than the compatibility mode. Other websites have said that Internet Explorer is only configured to play MP4 files (rather than ogg and webm video files), so I assumed that would be the safest file format to test.

I had tested the view of the webpage using IE9 emulating the IE8 standard and the IE7 standard views of that page, and in both cases, the old standard views worked for playing the MP4 video file. And the IE9 compatibility mode also played that web page. But I forced the IE9 to revert back to the standard view in order to test a code that would work for playing the video for those who had not configured their own IE9 browser to use compatibility mode.

The methods suggested by that MSDN article referenced earlier seem to be directed towards this issue, but in testing each of those methods, none of them fixed the problem of an IE9 browser playing an MP4 video file.

The solution to my problem came from this Stack Overflow ticket: HTML5 Video not working only in IE9

I actually had to add the following lines to the .htaccess file on the website:

AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/mp4 .mov
AddType video/webm .webm

Then, I also needed to make sure that the first line of code used this:

<!DOCTYPE html>

... rather than this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

I did not need to use any of the "previous version" code such as this:

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8">

On my test page, I also used the video-js code, which I had assumed would take care of the IE9 standard problem (as it had for other web browsers). Its own code seems to have also output the following X-UA-Compatible codes:

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="X-UA-Compatible" content="IE=9" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

However, these codes alone did not solve the problem. Ultimately, I believe it was due to the addition of the code to the .htaccess file.