【问题标题】:Play Video 100% within the Div Container在 Div 容器中播放视频 100%
【发布时间】:2015-10-19 05:01:11
【问题描述】:

如何让 Youtube 视频在 DIV 容器中 100% 播放。

div 宽度:940px

div 高度:400px

Fiddle here

<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;
}

【问题讨论】:

    标签: javascript jquery youtube video.js


    【解决方案1】:

    我认为你可以这样做:

    .video-js-player {
        position:relative;
        width:940px;
        height:400px;
    }
    
    .video-content {
        width:100%;
        height:100%;//Change this to also 100%
        background:#f2f2f2;
        font-size:18px;
        font-family:verdana;
        font-weight:bold;
        color:#aaa;
        border:1px solid #aaa;
        margin-top:10px;
    }
    

    【讨论】:

      猜你喜欢
      • 2014-05-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-18
      • 1970-01-01
      • 1970-01-01
      • 2014-06-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多