自动播放音频在Android中不起作用

时间:2019-04-25 14:48:20

标签: javascript android html audio

大家好,我正在使用此代码。并且无法在移动设备上正常运行,在网站上也可以正常运行。谁能告诉我这个问题?我搜索了很多网站,但是我的代码仍然无法正常工作。

<!doctype html>
<html lang="en">
<head>
  <!-- Required meta tags -->
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <!-- Bootstrap CSS -->
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <!-- Jquery Link -->

  <link rel="icon" href="images/1.jpg" sizes="16x16">

  <title>Top Notch Lahore</title>

</head>
<body style="background-color:black">


  <div class="container">
    <div class="row">          
      <div class="col-sm-12">

          <video height="500px" width="100%" id="video_background" autoplay loop controls webkitallowfullscreen mozallowfullscreen allowfullscreen>
                  <source src="4_compressed6.mp4" type="video/mp4">
          </video>

         <!--  <video width="100%" height="500" id="video_player" controls autoplay loop>
            <source id="video_mp4" src="4_compressed6.mp4" type="video/mp4"  />
          </video> -->
         <!--  <iframe style="position: absolute; top: 2; left: 0;" type="text/html"
          src="4_compressed6.mp4" width="100%" height="500px" frameborder="0"  webkitallowfullscreen controls="false" mozallowfullscreen allowfullscreen id="player" loop="true"></iframe> -->

         </div>
            </div>




          </div>
        </div>


<script src="js/bootstrap.min.js"></script>


      </body>
      </html>

0 个答案:

没有答案