【发布时间】:2017-08-09 01:13:43
【问题描述】:
我正在尝试在网页中全宽显示 vimeo 视频。
这就是现在的样子:
如您所见,黑色是全宽的,但不是视频。它应该是全宽的,没有显示控件,自动播放并循环播放。
我的代码现在看起来像这样:
<iframe src="https://player.vimeo.com/video/208176323?autoplay=1&loop=1&background=1" width="100%" height="500px" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
客户端有 vimeo plus 但没有 vimeo pro。有人可以帮我解决这个问题吗?
更新:
我已将代码更改为:
<style>
.embed-container {
position: relative;
padding-bottom: 56.25%;
height: 0; overflow: hidden;
max-width: 100%; height: auto;
}
.embed-container iframe, .embed-container object, .embed-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
</style>
<div class='embed-container'><iframe src='https://player.vimeo.com/video/208791851?autoplay=1&loop=1&background=1' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>
但我的底部和顶部仍然有黑色边框。
我创建了一个 jsfiddle,您也可以在其中看到:https://jsfiddle.net/07fkfwz3/。而且here看到的视频是没有边框的。
【问题讨论】:
标签: html css video width vimeo