小提琴:https
://codepen.io/anon/pen/ZyLqPd小提琴YTVideos:https://codepen.io/anon/pen/KqXavy ? editors = 0100
http://www.seanmccambridge.com/tubular/ https://pupunzi.com/#mb.components/mb.YTPlayer/YTPlayer.html
是否有库可以轻松地将背景youtube视频添加到div中?
我一遍又一遍地搜索,找不到任何东西.
基本上我想播放一个YouTube视频作为div的背景与此截图中的图像.
$('.canvas .box').YTPlayer({
fitToBackground: true,
videoId: '-JlcxL2ux_A'
});
Run Code Online (Sandbox Code Playgroud)
小智 6
在你的模型中,视频具有正常的16:9宽高比,所以这就是我所使用的而不是你最初拥有的方块.这是调整:
https://codepen.io/saetia/full/BZwWdx/
视频盒
<div class="ib box">
<div class="responsive"><iframe src="https://www.youtube.com/embed/8nH-49PgKdw?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe></div>
</div>
Run Code Online (Sandbox Code Playgroud)
款式
.canvas .box {
display: inline-block;
width: 25%;
pointer-events: none;
}
.canvas .box .responsive {
position: relative;
height: 0;
overflow: hidden;
padding-bottom: 56.25%;
}
.canvas .box iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
871 次 |
最近记录: |