3

I have a problem with my video player, and now I'm asking for help

Video.js is not able to play video in IE 9 (and maybe 10, I'm not able to check), all of other browsers displaying video correctly

Here is an example link.

IE console shows following error:

LOG: Video Error[object Object]

HTML code:

<video class='video-js vjs-default-skin' controls data-setup='{"techOrder": ["flash", "html5", "links"]}' height='576' id='video_16' poster='/system/videos/file_previews/000/000/016/medium/1360091100-30.jpg?1360091101' preload='none' width='720'>
    <source src='http://uklasi.com.ua/5-klas/matematika/koordinatniy-promin/16.mp4' type='video/mp4'>
    <source src='http://uklasi.com.ua/5-klas/matematika/koordinatniy-promin/16.webm' type='video/webm'>
</video>

My HTTP headers:

HTTP/1.1 200 OK
Server: nginx/1.2.6
Date: Sun, 10 Feb 2013 12:05:40 GMT
Content-Type: video/mp4
Content-Length: 41625464
Last-Modified: Tue, 05 Feb 2013 19:05:00 GMT
Connection: keep-alive
Content-Disposition: inline; filename="koordinatniy-promin-16"
Cache-Control: max-age=0, private, must-revalidate
Accept-Ranges: bytes

Did anyone face this problem before? :(

  • You should add that the error only happens to people who don't have Flash - if Flash is available, the example link works just fine. It's the HTML5 video that has that error. – Mörre Feb 10 '13 at 12:26
  • Try http://stackoverflow.com/questions/5006765/html5-video-error-internet-explorer-9 or http://stackoverflow.com/questions/6944679/html5-mp4-video-does-not-play-in-ie9 or etc. (Google is your friend - "ie video error html5") – Mörre Feb 10 '13 at 12:27
  • yes, the problem appears only with html5. – Constantine EmeraldMaster Feb 11 '13 at 08:20
  • I still want to understand why. I have correct mime-types, I use absolute URLs, h264 codec, correct HTML syntax, my http headers are ok too. Will try to do more debug.. – Constantine EmeraldMaster Feb 11 '13 at 08:26
  • Definitely post the solution, for the record and other users, if no one else does (as an answer below - you can then even accept your own answer as the solution to indicate that this question has one). – Mörre Feb 11 '13 at 09:03

1 Answers1

6

I had a similar problem with mp4 and IE9 playing with video.js - this fixed it:

<script type="text/javascript" charset="utf-8">
//mvp - if it is IE9 - the first line tests for IE9 - then fall back to flash
if(navigator.userAgent.indexOf("Trident/5")>-1){
 _V_.options.techOrder = ["flash"];
 _V_.options.flash.swf = "tech/flash/video-js.swf";
}
</script>

Basically it forces use of the flash player if it detects IE9...

mvp

Update...3/28/13 IE10 and video.js was not working either.. added another block to test for IE10 using: "Trident/6" (instead of 5) and this forces IE10 to use Flash as well. Video is playing again!

Have not tried IE11 yet....

mvprzy
  • 105
  • 1
  • 6
  • This solution worked for me, though I had to go to the [videojs documentation](https://github.com/videojs/video.js/blob/master/docs/tech.md#adding-playback-technology) to figure out how to set it up in the current version. I just added a conditional comment after the – cdwhatcott Sep 17 '13 at 16:20