vagaerg
vagaerg

Reputation: 209

Force flash when using IE

I am creating a webpage for videos using videojs. The fact is that IE does not play my files correctly, even if it supports the mp4 format. I would like to force videojs to play flash if using IE, while keeping HTML5 if it's any other browser.

I have read about the techorder property, but as I should apply it once the webpage has been loaded, it will not affect the videos that have already been loaded using HTML5.

Does anyone know what to do with this?

Thanks in advance

Upvotes: 0

Views: 450

Answers (1)

heff
heff

Reputation: 3239

To be clear, The techOrder setting can work for all videos if you use it when initializing the player, but in your case you want to first test for IE and then set it to use Flash.

The first thing I would suggest is figuring out what the issue with your MP4 file is. A common issues is using an unsupported codecs (e.g. when using MPEG-2 codec instead of h.264). You might try encoding your file with handbrake or zencoder or another transcoder that defaults to h.264.

It could also be that the wrong mime type is being sent from your server. You can check the mime type with http://web-sniffer.net or using curl:

curl -I http://www.videojs.com

(replace http://www.videojs.com with a link to your MP4)

You're looking for the Content-Type header which should be video/mp4. If it's not, IE will fail on your file, and you should update the mime type your server is sending for that file.

There's a hack you could use to force Flash on just IE, but that's not the right way to solve this, and one of the previous methods usually fixes this issue.

Upvotes: 1

Related Questions