如何通过Androids在Chrome上自动播放<video>标签?</video>

时间:2013-10-14 09:48:35

标签: iphone google-chrome mobile video autoplay


<!doctype html>
<html>
<head>
  <title>ING Summer Events</title>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">


  <style type="text/css">
            .imagemap {position:relative;width:device-width;}
            img{display:block;}
    </style>
  <script> function callback () { document.querySelector('video').play(); } window.addEventListener("load", callback, false); </script>

</head>

  <body topmargin="0" leftmargin="0" bgcolor=black>

  <img src="./top.jpg" width=100% border="0" />
          <video width="100%" autoplay preload controls poster="./video.jpg">
              <source src="ingsummer.mp4" type="video/mp4">
              <source src="ingsummer.ogg" type="video/ogv">
          </video>
  <img src="./bottom.jpg" width=100% border="0" />



  </body>
</html>





就是这样,在我的三星Galaxynote2上它完美运行......除了在Chrome上...... 我该怎么办?我无法在Chromes上自动播放

2 个答案:

答案 0 :(得分:0)

我认为Chrome for Android目前已禁用自动播放功能。

请参阅:HTML 5 Autoplay Google Chrome Android Not Playing

答案 1 :(得分:0)

您需要为移动设备的视频添加控件。它们不支持自动播放。