HTML 视频标签在 IE 浏览器中只显示了一半的视频。

4
我一直在做一个项目,需要精确复制https://www.google.com/atap/project-jacquard/
我使用的视频标签用于播放背景视频,但在Internet Explorer中仅显示一半,而其他浏览器则正常。我使用的IE版本是11.0。以下是屏幕截图。

This is the screenshot from IE

我努力了很久,但无法准确指出我的问题所在。如果有人能帮我找到错误,我将不胜感激...
此外,页脚没有响应。
这是我的整个代码 ->

Index.html

    <!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>Project Jacquard</title>

    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="http://fonts.googleapis.com/css?family=Karla:400,700,400italic,700italic" rel="stylesheet">
    <!-- Custom CSS -->
    <link href="css/one-page-wonder.css" rel="stylesheet">
    <link href="css/yes.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->


</head>

<body>

    <!-- Navigation -->
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container">

            <div class="navbar-header">

                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>


            <img id="img1" src="img/jacquard-row.svg" alt="Project Jacquard" class="ri" style=""><!--  width:22.5%; -->
            </div>


        </div>
        <!-- /.container -->
    </nav>

    <header class="header-image">
        <div class="headline" style="height: 850px;">

            <div class="container" id="content">
                <h2 style="padding-bottom: 20px;">Technology woven in.</h2>
                <button class="centerButton">Play Film</button>

            </div>

            <video class="vid" autoplay loop controls muted> <!--  id="bgvid"  style="width:1349; height:600;" -->
                <source src="video/Jacquard.mp4" type="video/mp4">
                    <img id="alternative" src="alternative.jpg" />
            </video> 
             <iframe style="margin-top: 60px;" class="vid" id="yt" src="https://www.youtube.com/embed/qObSFfdfe7I" frameborder="0" allowfullscreen></iframe> 
        </div>
    </header>

    <!-- Page Content -->
    <div class="container">


        <!-- Second Featurette -->
        <div class="featurette" id="services">
            <h2 style="text-align: center; padding-bottom: 50px;">Introducing Project Jacquard</h2>
            <img class="featurette-image img-responsive pull-left" src="img/1.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">

            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Project Jacquard makes it possible to weave touch and gesture interactivity into any textile using standard, industrial looms.</p>
            <br />
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Everyday objects such as clothes and furniture can be transformed into interactive surfaces.</p>
        </div>



        <!-- Third Featurette -->
        <div class="featurette" id="contact" style="padding-top: 50px;">
           <h2 style="text-align: center; padding-bottom: 50px;"> Spinning conductive yarns</h2>
            <img class="featurette-image img-responsive pull-right" src="img/2.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">

            <p class="lead" style="padding-right: 50px; padding-left: 50px;">This is possible thanks to new conductive yarns, created in collaboration with our industrial partners.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Jacquard yarn structures combine thin, metallic alloys with natural and synthetic yarns like cotton, polyester, or silk, making the yarn strong enough to be woven on any industrial loom.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Jacquard yarns are indistinguishable from the traditional yarns that are used to produce fabrics today.</p>
        </div>

        <div class="featurette" id="services"></div>

         <div class="featurette" id="services" style="padding-top: 50px;">
            <h2 style="text-align: center; padding-bottom: 50px;">Weaving interactive textiles</h2>
            <img class="featurette-image img-responsive pull-left" src="img/3.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">
            <img class="featurette-image img-responsive pull-left" src="img/4.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">

            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Using conductive yarns, bespoke touch and gesture-sensitive areas can be woven at precise locations, anywhere on the textile.</p>
            <br />
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Alternatively, sensor grids can be woven throughout the textile, creating large, interactive surfaces.</p>
        </div>

         <div class="featurette" id="contact" style="padding-top: 50px;">
           <h2 style="text-align: center; padding-bottom: 50px;"> Embedding electronics</h2>
            <img class="featurette-image img-responsive pull-right" src="img/5.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">
            <img class="featurette-image img-responsive pull-right" src="img/6.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">

            <p class="lead" style="padding-right: 50px; padding-left: 50px;">The complementary components are engineered to be as discreet as possible. We developed innovative techniques to attach the conductive yarns to connectors and tiny circuits, no larger than the button on a jacket. These miniaturized electronics capture touch interactions, and various gestures can be inferred using machine-learning algorithms.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Captured touch and gesture data is wirelessly transmitted to mobile phones or other devices to control a wide range of functions, connecting the user to online services, apps, or phone features.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">LEDs, haptics, and other embedded outputs provide feedback to the user, seamlessly connecting them to the digital world.</p>
        </div>

         <div class="featurette" id="services" style="padding-top: 50px;">
            <h2 style="text-align: center; padding-bottom: 50px;">Producing at scale</h2>
            <img class="featurette-image img-responsive pull-left" src="img/7.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">
            <img class="featurette-image img-responsive pull-left" src="img/8.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">

            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Jacquard components are cost-efficient to produce, and the yarns and fabrics can be manufactured with standard equipment used in mills around the world.</p>
            <br />
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">One loom can generate as many different textile designs as there are people on the planet. Now that same loom can also weave in interactivity.</p>
        </div>

        <div class="featurette" id="contact" style="padding-top: 50px;">
           <h2 style="text-align: center; padding-bottom: 50px;"> Making connected clothing</h2>
            <img class="featurette-image img-responsive pull-right" src="img/9.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">
            <img class="featurette-image img-responsive pull-right" src="img/10.jpg" style="padding-right: 50px; padding-left: 50px; padding-bottom: 50px;">

            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Connected clothes offer new possibilities for interacting with services, devices, and environments. These interactions can be reconfigured at any time.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Jacquard is a blank canvas for the fashion industry. Designers can use it as they would any fabric, adding new layers of functionality to their designs, without having to learn about electronics.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">Developers will be able to connect existing apps and services to Jacquard-enabled clothes and create new features specifically for the platform.</p>
            <br>
            <p class="lead" style="padding-right: 50px; padding-left: 50px;">We are also developing custom connectors, electronic components, communication protocols, and an ecosystem of simple applications and cloud services.</p>
        </div>

        <div class="featurette" id="services" style="padding-top: 50px;">
            <h3 style="text-align: center; padding-bottom: 50px;">Project Jacquard will allow designers and <br> developers to build connected, touch-sensitive <br>textiles into their own products.</h3>
         </div>

         <div class="featurette" id="contact" style="padding-top: 50px;">
            <img src="img/jacquard-row.svg" style="margin-right: auto; margin-left: auto; padding-bottom: 10px; display: block;">

            <h4 style="text-align: center; padding-bottom: 50px;">Technology woven in.</h4>

        </div>

        <!-- Footer -->
        <footer>
            <div class="row">
                <div class="col-lg-12" style="padding-top: 50px; padding-bottom: 50px;">
                    <img src="img/googleATAP.svg" style=" padding-left: 80px; float: left; vertical-align: middle; padding-top:10px;">
                    <div class="left">
                         <ul style="padding-left: 60px;">
                            <li style="padding-top:20px;"><a href="https://www.google.com/intl/en/about/">About Google</a></li>
                            <li style="padding-left: 50px; padding-top:20px;"><a href="https://www.google.com/intl/en/policies/privacy/?fg=1">Privacy</a></li>
                            <li style="padding-left: 20px; padding-top:20px;"><a href="https://www.google.com/intl/en/policies/terms/regional.html">Terms</a></li>
                        </ul>
                   </div>

                   <div class="right">
                    <ul>
                        <li style="padding-right: 20px; padding-top:20px;">Follow Google ATAP:</li>
                        <li style="padding-right: 20px;"><a style="width: 40px;" href="https://plus.sandbox.google.com/+GoogleATAP/"><img src="img/gplus.svg"></a></li>
                        <li style="padding-right: 80px;"><a style="width: 40px;" href="https://www.youtube.com/user/GoogATAP"><img src="img/youtube.svg"></a></li> 

                    </ul>

                   </div>

                   </div>
            </div>
        </footer>

    </div>
    <!-- /.container -->

    <!-- jQuery -->
    <script src="js/jquery.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="js/bootstrap.min.js"></script>
    <script>

        $("button").click(function () {
            $("#content").hide();
            $("#yt")[0].src += "?autoplay=1";
            setTimeout(function(){ $("#yt").show(); }, 200);
        });
    </script>
</body>

</html>

CSS文件 1 ->

body {
    -webkit-animation-delay: 0.1s;
    -webkit-animation-name: fontfix;
    -webkit-animation-duration: 0.1s;
    -webkit-animation-iteration-count: 1;
    -webkit-animation-timing-function: linear;
    overflow-x:hidden; }

/*video {display: block;}*/

@-webkit-keyframes fontfix {
    from { opacity: 1; }
    to   { opacity: 1; } }

.navbar-inverse {   background-color: #fff; }

.navbar {   min-height: 82px; }

img.ri {    position: absolute;     max-width: 80%;     top: 10%;   left: 10%;  border-radius: 3px;     /*box-shadow: 0 3px 6px rgba(0,0,0,0.9);*/ }

img.ri:empty {  top: 50%;   left: 50%;  -webkit-transform: translate(-50%, -50%);   -moz-transform: translate(-50%, -50%);  -ms-transform: translate(-50%, -50%);   -o-transform: translate(-50%,
-50%);  transform: translate(-50%, -50%); }

video#bgvid { position: relative; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -100;
-webkit-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); background-size: cover; }

.google-front-button{   border-radius: 0;   border: 2px solid #fff;   height: 50px;   line-height: 44px;   padding: 0 30px 2px;   text-transform: none;   transition: all .4s ease-in-out; }

.centerButton {
    display: block;
    height: 50px;
    width: 145px;
    background-color: rgba(255, 255, 255, 0);
    border: 2px solid rgba(255, 255, 255, 0.9);
    color: rgba(255, 255, 255, 0.9);
    margin: 0px auto 0px auto;
    text-align: center;
    font: bold 1.2em/10px "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif;
    padding: 17px 10px;
    transition: background-color 0.5s ease-in-out;
    transition: border 0.5s ease-in-out;
    } /* a.centerButton {

    text-decoration: none; }
*/ a:hover {    color: rgba(255, 255, 255, 0.9);     }

a.centerButton:hover {  text-decoration:none;   background-color: rgba(255, 255, 255, 0.4);     color: rgba(255, 255, 255, 0.9);    border: 2px solid rgba(255, 255, 255, 0.3);     transition: background-color 0.5s ease-in-out;
    transition: border 0.5s ease-in-out; }

.headline {
    padding: 250px 0 1px 0; }

.headline h2 {  font-family: "Karla",sans-serif;
    font-size: 38px;
    color: #fff;
    /*background: #fff;*/
    /*background: rgba(255,255,255,0.9);*/ }

h2{
    font-family: "Karla",sans-serif;
    font-size: 40px; }

.lead{
    font-family: "Karla",sans-serif;
    font-size: 17px;
    color: #404040;
    letter-spacing: 1px;
    line-height: 35px;
    font-weight: 300; }

.container {   width: auto; /*1170px*/ }

#contact{
    background-color: rgba(230,230,230,.8); }

h3{
    font-family: "Karla",sans-serif;
    font-size: 35px;
    color: #676767; }

h4{
    font-family: "Karla",sans-serif;
    font-size: 17px;
    color: black; }

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    overflow: hidden; }


li{
    float: left;
    font-family: "Karla",sans-serif;
    font-size: 16px; }


a {
    font-family: "Karla",sans-serif;
    font-size: 16px;
    display: block;
    width: 100px;
    color:#676767; }

a:hover{
    color:#676767;
    text-decoration: underline; }

.left{
    float: left; }

.right{
    float: right; }

.vid {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    z-index: -1;
    position: absolute;
    -webkit-transform: translateX(-50%) translateY(-50%);
    transform: translateX(-50%) translateY(-50%);
    background-size: cover; }

#yt {
    display: none;
    z-index: 1; }

#content { }

尝试在页脚中使用width:100%;,并使用text-align:center;margin:auto;为所有子元素设置。对于视频,请尝试使用-ms-transform: translateX(-50%)translateY(-50%);。如果有效,请告诉我,我会提供完整的答案。我认为这是你的问题。我没有IE模拟器,所以无法测试它。您在.vid类中的转换翻译中未包含所有浏览器。这就是您拥有的:-webkit-transform: translateX(-50%)translateY(-50%); transform: translateX(-50%)translateY(-50%); 您还应该添加-o--ms--moz- - www139
谢谢,加入其他转换并没有帮助。还有什么想法吗?也许你想保存我的代码,在你的系统上运行一下看看?干杯! - codemode
是的,刚刚试了width:100%;和width:100vw; 两个都试过了..没成功。 - codemode
尝试在“header-image”类上使用overflow:auto;,看看视频是否被裁剪。检查“header-image”类是否占据了视口宽度的100%(100vw)。还可以尝试将-ms-background-size:cover; 添加到“header-image”中。 - www139
尝试做一些不同于“覆盖”的事情。 - www139
显示剩余3条评论
2个回答

2

好的,我通过对代码进行一些操作自己找到了答案。我所需要做的就是在.vid中添加这个“特定”的行来进行IE翻译。

-ms-transform: translateX(0%) translateY(-50%);

在IE中,它也能很好地覆盖屏幕!希望能帮助像我一样遇到困难的人!干杯!


0

与实际的Project Jacquard页面相比较,你的代码似乎缺少一些CSS样式。为了抵消你的翻译,你需要:

left: 50%;
top: 50%;

注意:顶部定位可能不是必要的。Project Jacquard页面没有Y轴的移动,所以很难说。


嗨,谢谢你的回复。我刚试了一下,不起作用... :( - codemode
@codemode 注意:仅当您将position CSS属性应用于absolutefixedrelative的值时,leftright属性才会起作用。 - Mr_Green
1
嘿+BurningLights,我不想让我的赏金浪费了。所以我就让你拿走它...干杯! - codemode
哇,谢谢!你真是太好了!很抱歉我不能再帮你更多了。 - BurningLights

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接