代码之家  ›  专栏  ›  技术社区  ›  The KNVB

如何用chrome制作全高视频?

  •  0
  • The KNVB  · 技术社区  · 5 年前

    我正在尝试建立自定义视频控件。

    <html>
        <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
            <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
            <style>
                video {
                    transform: scale(-1, 1);
                    object-fit: cover;
                }
            </style>
            <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
            <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
            <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
        </head>
        <body class="p-1">
            <div class="border-top border-primary container-fluid">
                <div class="h-25 row">
                    <div class="border-left border-bottom border-primary col-6 d-flex flex-column p-1" style="box-sizing:border-box">
                        <div class="bg-primary h-75 text-white">
                            sdfsfd
                        </div>
                        <div class="bg-secondary h-25 text-danger">
                            9080
                        </div>
                    </div>
                    <div class="border-left border-bottom border-right border-primary col-6 d-flex flex-column p-1">
                        <video id="remoteView" autoplay muted>
                            <source src="https://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
                        </video>
                    </div>
                </div>
                <div class="row">
                    <div class="align-items-center border-left border-bottom border-right border-primary col-12 d-flex flex-row justify-content-center p-0">
                        <div class="btn-group-toggle d-flex justify-content-center p-1">
                            <button class="btn-sm btn btn-lg btn-success">A</button>
                        </div>
                        <div class="btn-group-toggle d-flex justify-content-center p-1">
                            <button class="btn-sm btn btn-lg btn-success">B</button>
                        </div>
                        <div class="btn-group-toggle d-flex justify-content-center p-1">
                            <button class="btn-sm btn btn-lg btn-success">C</button>
                        </div>
                    </div>  
                </div>
            </div>
        </body>
    
    </html>

    当Chrome浏览器左上角窗口无法正确显示时,无法将其最小化。

    但是,在Firefox浏览器中,这个问题并不存在。

    2 回复  |  直到 5 年前
        1
  •  0
  •   Lahiru Supunchandra    5 年前
    video { height: 100vh; min-height: 100%; }
    

    你可以得到更多关于全屏视频的详细信息 How to - Fullscreen Video

        2
  •  0
  •   Paul Roub jim    5 年前

    试着按一下 + 轮班 + . 在大多数情况下,它可以解决问题。