Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML5 Video > Dont not work in IE 9.0.8, but works ok in IE 9.0.8 #209

Closed
dilrajahdan opened this issue Aug 1, 2012 · 1 comment
Closed

Comments

@dilrajahdan
Copy link

Any ideas? It looks like the IE9 Update Version 9.0.8 is not loading the vids. Update version 9.0.1 is ok. Trippy!

Video Format: MP4 / H.264.

Mime type: video/mp4

HTML:
< video id="video_1262" class="video-js vjs-default-skin" controls preload="none"
poster="/media/4165/puzzle.jpg" data-setup="{}">
< source src="/media/6221/video.mp4" type='video/mp4' />
< /video>

Javascript:

function initVideos(){

if ($('video').length) {

$('video').each(function(){

  _V_( $(this).attr('id') ).ready(function(){  

      var myPlayer = this;  // Store the video object
      var aspectRatio = 9/16; // Make up an aspect ratio

      function resizeVideoJS(){
            // Get padding 
            var paddingL = parseInt($('#'+myPlayer.id).parent().css('padding-left')),
                paddingR = parseInt($('#'+myPlayer.id).parent().css('padding-right'))                

            // Get the parent element's actual width
            var width = document.getElementById(myPlayer.id).parentElement.offsetWidth;

            // Recalculate width to include padding
            width = width - (paddingL + paddingR);
            myPlayer.width(width).height( width * aspectRatio ); // Set width to fill parent element, Set height 
      }

      resizeVideoJS(); // Initialize resizeVideoJS()
      window.onresize = resizeVideoJS; // Call resizeVideoJS() on window.resize();
  });// ready

});// each

}// if

}// function

@dilrajahdan
Copy link
Author

Solution/Hack:

I got videos working in IE 9.0.8 (albeit via Flash and not HTML5 video) by:

1 - Updating Modernizr from 2.5.3 to 2.6.1
2 - Adding the following script BEFORE initialising the videos

< !-- Video JS for IE 9 - Force Flash mode. -->
< !--[if IE 9]>
< script type="text/javascript">
jQuery(document).ready(function($) {
V.options.techOrder = ["flash", "html5", "links"]; });
< /script>
< ![endif]-->

note: Remove spaces were required

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant