jakschu
jakschu

Reputation: 127

Why does mediaelements.js not scale youtube videos in Internet Explorer 8?

I use jQuery, boostrap and mediaelements on a Website. Nothing too fancy.. This code works fine on every browser i have checked out, but doesn't scale the video on IE8.

<div class="row-fluid">
<div class="span12">
<video preload="none" width="100%" height="100%">
<source type="video/youtube" src="http://www.youtube.com/watch?v=nOEw9iiopwI" />
</video> 
</div>
</div>

What could be causing this? Here is the obligatory screenshot: http://postimage.org/image/6q75jwc8b/

Upvotes: 1

Views: 619

Answers (1)

jakschu
jakschu

Reputation: 127

I have figured it out myself. I need to set the video size. Then I can use width:100% and height:100% in CSS. So for the example above, this would be:

<head>
<style>
video {
    width:100%;
    height: 100%;
}
</style>
...
</head>
...

<div class="row-fluid">
<div class="span12">
<video preload="none" width="960" height="540">
<source type="video/youtube" src="http://www.youtube.com/watch?v=nOEw9iiopwI" />
</video> 
</div>
</div>

Maybe this will help others too!

Upvotes: 1

Related Questions