我制作了一个带有HTML5视频的网站,该视频包含海报attritube和视频截图。这是因为不支持自动播放以防止过度使用移动数据的智能手机问题。因此,它将在移动平台上显示屏幕截图,而不是视频。Android中的HTML5视频背景显示为黑色
我有一个ID为“content”的div中的所有网页内容。一切正常,除非网站有需要滚动的信息。如果您删除了视频的固定位置,它就会起作用,但当然网站会混乱,因为视频必须设置为固定位置,这样我才能向下滚动页面而不会使视频移动。
#video_background {
position: fixed; \t
bottom: 0px;
right: 0px;
min-width: 100%;
min-height: 100%;
width: auto;
height: auto;
z-index: -1000;
overflow: hidden;
}
#content { \t
position: absolute; \t
text-align: left; \t
width: 100%; \t
padding: 15px; \t
}
<video id="video_background" poster="images/video.jpg" preload="auto" loop="loop" muted="muted" autoplay="true" volume="0"> \t
<source src="webvid_4.mp4" type="video/mp4">
Video not supported
</video>
<div id="content"> \t
// all information goes here. If too much for the screen, the background goes black.
</div>
如果我重新载入页面,它显示了半秒的海报图像和变黑。
有关如何使此工作的任何提示?或者,也许是一种解决方法?