1
如何使Youtube視頻在DIV容器內100%播放。在Div容器內播放視頻100%
寬度的div:940px
格的高度:400像素
<div class="videojs-wrapper">
<div class="video-js-player">
<video id="vid1" src="" class="video-js vjs-default-skin" autoplay="autoplay" muted loop preload="auto" width="100%" height="400px" data-setup='{ "techOrder": ["youtube"], "src": "http://www.youtube.com/embed/5PaIjFd02js?enablejsapi=1" }'>
</video>
</div>
</div>
.video-content {
width:100%;
height:300px;
background:#f2f2f2;
font-size:18px;
font-family:verdana;
font-weight:bold;
color:#aaa;
border:1px solid #aaa;
margin-top:10px;
}
.videojs-wrapper {
position:relative;
}
.video-js-play {
position: absolute;
top: 0;
background-color: #fff;
padding: 10px;
right: 47%;
left: 44%;
width: 100px;
bottom: 0;
top: 40%;
text-align: center;
height: 36px;
}
.video-js-player {
position:relative;
}