Границы iframe и автоигра в Chrome - PullRequest
0 голосов
/ 10 апреля 2019

У меня проблемы с избавлением от границ Iframe в моем видео. Всякий раз, когда я назначаю свое видео в качестве iframe, оно создает черные рамки с обеих сторон видео. Я хочу, чтобы мое видео было полноэкранным без черных границ. Я пробовал frameborder = "0", border = "0" и т. Д. и ничего не работает. Однако мне не нужно будет использовать iframe, если я смогу воспроизвести видео в Google Chrome. Я знаю, что Chrome не позволяет автоматически воспроизводить видео без отключения звука, но мне действительно нужен звук, когда человек попадает на страницу. Иначе я не смогу получить тот эффект, который хочу. Есть ли способ переопределить эту проблему с помощью кода или, возможно, другого типа тега видео? Пожалуйста, дайте мне знать, если вы можете помочь.

Вот HTML:

<!DOCTYPE html>
<html>
<head>
    <!---Bootstrap--->
    
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
      
      <link rel="stylesheet" href="Animation.css">
      
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
        
        <!--Bootstrap meta name-->
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    
<!--Metadata from W3 Schools--->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
<!--CSS Style-->
    
</head>
    
    
    <!---Website Content--->
    
<body>
    
<div class = "container">
<div id="myNav" class="overlay">
  <a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a>
  <div class="overlay-content">
    <a href="Animation.html">Home</a>
  <a href="History.html">History</a>
  <a href="Techniques.html">Techniques</a>
  <a href="Production.html">Production</a>
  <a href="Visual_FX.html">Visual FX</a>
    <a href="Characters_&_Gaming.html">Characters & Gaming</a>
      </div>
  </div>
</div>
<span style="font-size:30px;cursor:pointer" onclick="openNav()">&#9776; </span>

<script>
function openNav() {
  document.getElementById("myNav").style.width = "50%";
}

function closeNav() {
  document.getElementById("myNav").style.width = "0%";
}
</script>
<!--    <h4>Welcome To</h4>-->
    <header>
        The Wonderful World of Animation
    </header>

<!--Video-->
    
    
  <iframe class="embed-responsive-item" src="Animation%20Montage%20-%20HD.mp4"></iframe>


    
<!--
    <video controls autoplay loop id="myVideo">
  <source src="Animation%20Montage%20-%20HD.mp4" type="video/mp4">
        <source src="Animation%20Montage%20-%20HD.webm" type="video/webm">
        <source src="Animation%20Montage%20-%20HD.ogg" type="video/ogv">
</video>
-->
            
    

</body>
</html>

Вот CSS:

body{
    margin: 20px;
}


iframe{
    position: fixed;
    right: 0;
    bottom: 0;
    min-width: 100%;
    min-height: 100%;
    z-index: -1;
}

h4{
    
    color: white;
    text-align: center;
    opacity: 0.8;
}

header{
    z-index:2;
    text-align: center;
    color: white;
    font-size: 70px;
    opacity: 0.9;
}

span{
    
        color: white;
        padding: 20px;
    padding-left: 110px;
        z-index: 1;
        border-top: 70px;
    }

.overlay {
  height: 100%;
  width: 0;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: rgb(0,0,0);
  background-color: rgba(0,0,0, 0.9);
  overflow-x: hidden;
  transition: 0.5s;
}

.overlay-content {
  position: relative;
  top: 25%;
  width: 100%;
  text-align: center;
  margin-top: 30px;
}

.overlay a {
  padding: 8px;
  text-decoration: none;
  font-size: 36px;
  color: #818181;
  display: block;
  transition: 0.3s;
}

.overlay a:hover, .overlay a:focus {
  color: #f1f1f1;
}

.overlay .closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  font-size: 60px;
}

@media screen and (max-height: 450px) {
  .overlay a {font-size: 20px}
  .overlay .closebtn {
  font-size: 40px;
  top: 15px;
  right: 35px;
  }
}
...