为什么mediaelements.js不能在ie8中缩放youtube视频?

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

本文关键字:缩放 youtube 视频 ie8 mediaelements js 不能 为什么      更新时间:2023-09-26

我在网站上使用jQuery, boostrap和mediaelements。不要太花哨……这段代码在我检查过的每个浏览器上都可以正常工作,但不能在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>

是什么原因导致的?这是必不可少的截图:http://postimage.org/image/6q75jwc8b/

我自己弄明白了。我需要设置视频大小。然后我可以在CSS中使用width:100%和height:100%。所以对于上面的例子,这将是:

<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>

也许这也会帮助别人!