Javascript 窗口大小调整功能不适用于flash
我正在使用视频中的代码片段为大家在我的网站中嵌入视频。这个片段基本上保证了用户可以从任何设备上看到视频。这是我的html:Javascript 窗口大小调整功能不适用于flash,javascript,jquery,flash,video,Javascript,Jquery,Flash,Video,我正在使用视频中的代码片段为大家在我的网站中嵌入视频。这个片段基本上保证了用户可以从任何设备上看到视频。这是我的html: <div class="intermitent-video-container"> <video controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="3
<div class="intermitent-video-container">
<video controls="controls" poster="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360">
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" />
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.webm" type="video/webm" />
<source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.ogv" type="video/ogg" />
<object type="application/x-shockwave-flash" data="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" width="100%" height="100%">
<param name="movie" value="http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf" />
<param name="allowFullScreen" value="true" />
<param name="wmode" value="transparent" />
<param name="flashVars" value="config={'playlist':['http%3A%2F%2Fsandbox.thewikies.com%2Fvfe-generator%2Fimages%2Fbig-buck-bunny_poster.jpg',{'url':'http%3A%2F%2Fclips.vorwaerts-gmbh.de%2Fbig_buck_bunny.mp4','autoPlay':false}]}" />
<img alt="Big Buck Bunny" src="http://sandbox.thewikies.com/vfe-generator/images/big-buck-bunny_poster.jpg" width="640" height="360" title="No video playback capabilities, please download the video below" />
</object>
</video>
</div>
除了视频回退到flash版本之外,上面的代码片段完全符合我的要求。当我在
Safari 5.1.7
中加载页面时(例如使用flash),视频将使用上面的代码片段在加载时精确调整大小,而不是在调整窗口大小时。这是对flash的限制还是我做错了什么?为视频标签添加css
video{
width: 100%;
height: auto;
}
而且您绝对可以肯定间歇视频容器具有响应性。
注意:不要忘记你头脑中的
,不幸的是,HTML并不能解决问题
video{
width: 100%;
height: auto;
}