首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >带控件的HTML5视频播放器+悬停播放

带控件的HTML5视频播放器+悬停播放
EN

Stack Overflow用户
提问于 2017-07-25 01:15:08
回答 1查看 1.9K关注 0票数 0

我想在我的网站上使用Bootstrap + HTML5视频播放器。下面是我得到的信息:

代码语言:javascript
复制
<div align="center" class="embed-responsive embed-responsive-16by9">
    <div class="instruction">
    <p>
    click play to launch fullscreen. click replay to watch in the container from the beginning.
    </p>
    <button href="#" id="play">
    Play
    </button>
    <button href="#" id="replay">
    Replay
    </button>
    </div>
    <video autoplay loop class="embed-responsive-item">
        <source src=http://techslides.com/demos/sample-videos/small.mp4 type=video/mp4>
    </video>
</div>

.instruction {
  width:100%;
  height:100%;
  margin:0;
  padding:0;
  text-align:center;
  position:absolute;
  z-index:99;
  color:#fff;
  top:50%;
}

http://jsfiddle.net/pw7yzLfg/1/

WHat我希望实现以下目标:

  • 视频应该填满整个容器(100%宽度+自动高度),
  • 默认情况下应该停止;仅在悬停时播放
  • 我想使用简单的控制:播放(单击全屏观看视频后)和重放(从头开始播放容器)。

我怎样才能做到这一点呢?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45286411

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档