Help wanted getting video.js to work with IE8 and FF

Discussion in 'JavaScript' started by chrisj, Jun 4, 2013.

  1. #1
    I'm looking for a little js guidance with this:
    http://www.videojs.com/docs/setup/
    This code I'm currently using plays the video.js player in IOS, IE10 & Chrome, but not IE8 and FF

       <script _V_.options.flash.swf = "http://theurl.com/video-js/video.js.swf"
    </script>
    <script videojs.options.flash.swf = "http://theurl.com/video-js/video.js.swf"
    </script>
    <video id="_1200k.mp4" class="video-js vjs-default-skin"
          controls preload="none" width="640" height="264"
          poster="[var.base_url]/[var.thumb_file]"
          data-setup='{"example_option":true}'>
          <source src="http://theurl.com/uploads/Yr7fGNOH0ell3Ml_1200k.mp4" type='video/mp4' />
    </video>
    Code (markup):
    I'd like help getting it to work in IE8 and FF. Any help will be greatly appreciated.
     
    chrisj, Jun 4, 2013 IP
  2. HuggyStudios

    HuggyStudios Well-Known Member

    Messages:
    724
    Likes Received:
    20
    Best Answers:
    26
    Trophy Points:
    165
    #2
    IE8 does not support HTML5 which the <video> tag is. You need to add a conditional like I've made in the code below.

    <!-- ie8 and lower -->
    <!--[if lt IE 9]>
    <object width="640" height="264" data="http://theurl.com/uploads/Yr7fGNOH0ell3Ml_1200k.mp4""></object>
    <![endif]-->
     
    <!-- html5 supported browser -->
    <!--[if gte IE 9]>
    <script _V_.options.flash.swf = "http://theurl.com/video-js/video.js.swf"></script>
    <script videojs.options.flash.swf = "http://theurl.com/video-js/video.js.swf"></script>
    <video id="_1200k.mp4" class="video-js vjs-default-skin"
          controls preload="none" width="640" height="264"
          poster="[var.base_url]/[var.thumb_file]"
          data-setup='{"example_option":true}'>
          <source src="http://theurl.com/uploads/Yr7fGNOH0ell3Ml_1200k.mp4" type='video/mp4' />
    </video>
    <![endif]-->
    
    Code (markup):
     
    HuggyStudios, Jun 8, 2013 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    Generally speaking I'm of the opinion that if you need javascript for a flash embed, you're doing something WRONG. I don't know what this 'video.js' crap is, but I'd swing a massive axe at it as pointless BS.
     
    deathshadow, Jun 9, 2013 IP