0

我正在尝试在我正在处理的页面中插入视频。但是我的页面没有显示海报图片。只有视频在播放时有效。为什么?

<body class="page page-index">

     <!-- Button to trigger modal -->
    <a href="#myModal" role="button" class="btn" data-toggle="modal">Launch demo modal</a>

    <!-- Modal -->
    <div id="myModal" class="modal hide fade" style="overflow:hidden" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-header" style="padding:0px 0px;">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

      </div>

      <div class="modal-body" style="max-height:none" >

        <video controls height="480" width="480" poster="img/poster480.png">
        <source src="video/sample.mp4"  type="video/mp4">

     </video>
      </div>

    </div>
    <script src="js/bootstrap-modal.js"></script> 
    <script src="js/script.js"></script>
    </body>
4

1 回答 1

1
<!-- Button trigger modal -->
  <a data-toggle="modal" href="#myModal" class="btn btn-primary btn-lg">
      Launch demo modal</a>

  <!-- Modal -->
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
           aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal"
        aria-hidden="true">&times;</button>
          <h4 class="modal-title">Modal title</h4>
        </div>
        <div class="modal-body">
           <video controls height="400" width="400" poster="images/amit.jpg">
                <source src="images/big_buck_bunny.mp4"  type="video/mp4">
            </video>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-default" 
         data-dismiss="modal">Close</button>
          <button type="button" class="btn btn-primary">Save changes</button>
        </div>
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
  </div><!-- /.modal -->    

在谷歌 Chrome 和 Firefox 中测试正常工作。

请注意:我使用的是 v2.3.1 版本的 bootstrap.min.js,请检查您是否使用的是旧版本。

干杯!!

于 2013-10-21T06:52:38.577 回答