HTML5:如何在同一页面上获得2个视频?

时间:2016-11-15 14:43:38

标签: css html5 video

我试图显示两个控件彼此相邻的视频,但我似乎无法让它工作。我可以拥有其中一个,但不能拥有其中一个。我已经尝试过,如果我不正确地指向文件但是没有,一切似乎都要检查。



@fontface {
  font-family: Halo;
  src: url(fonts/Halo.ttf);
}
body {
  background-image: url(images/background-image/ExuberantWitness.jpg);
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}
#head {
  font-family: Halo;
  font-size: 60px;
  text-align: center;
}
.leftVideo {
  margin: 0 auto;
  width: 600px;
  float: left;
}
.rightVideo {
  margin: 0 auto;
  width: 600px;
  float: left;
}

<!doctype HTML>
<html>

<head>
  <title>HaloPLAY</title>
  <link href="Trailer.css" rel="stylesheet" type="text/css">
  <meta charset="utf-8">
</head>

<body>
  <a href="index.html">
    <img style="margin: 0px auto;display:block" src="images/title/Halo.jpg" width="750" height="100">
  </a>
  <h1 id="head">WATCH THE TRAILER TO LEARN MORE</h1>
  <div class="leftVideo">
    <video width="500" height="350" controls>
      <source src="video/Halo5Trailer.mp4" type="video/mp4">
        <source src="video/Halo5Trailer.ogg" type="video/ogg">
          </class>
          <div class="rightVideo">
            <video width="500" height="350" controls>
              <source src="video/Halo5Trailer2.mp4" type="video/mp4">
                <source src="video/Halo5Trailer2.ogg" type="video/ogg">
                  </class>
</body>

</html>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

更改

</class>

</video>

答案 1 :(得分:0)

您似乎拥有未关闭的代码并关闭了不存在</class>的代码。

试试这样:

<div class="leftVideo">
    <video width="500" height="350" controls>
    <source src="video/Halo5Trailer.mp4" type="video/mp4">
    <source src="video/Halo5Trailer.ogg" type="video/ogg">
    </video>
</div>
<div class="rightVideo">
     <video width="500" height="350" controls>
     <source src="video/Halo5Trailer2.mp4" type="video/mp4">
     <source src="video/Halo5Trailer2.ogg" type="video/ogg">
     </video>
</div>

请点击此处http://www.w3schools.com/html/html5_video.asp了解详情。

问候语,

亚历