HTML5 video with Sitecore


I worked with a client that was having trouble getting HTML5 video to play in Sitecore. Inside of our support tickets I found the trick to getting it to work is to add the following MIME Types to the App_Config/MIMETypes.config file.

  <mediaType extensions="ogg">
    <mimeType>video/ogg</mimeType>
  </mediaType>
  <mediaType extensions="m4v">
    <mimeType>video/mp4</mimeType>
  </mediaType>

After that I was able to play video with those two formats in IE9 and the latest versions of FF and Chrome. I have not tested on any mobile devices or older browsers.

With HTML5 you need to specify the source video for each codec you want to support because the browsers do not support the same codecs.

<video controls="controls"">
   <source src="~/media/Files/sample_h264.m4v" type="video/mp4" />
   <source src="~/media/Files/sample_ogg.ogg" type="video/ogg"/>
   <p>Your browser does not support the <code>video</code> element.</p>
 </video>
Advertisements