久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      ios加載html5 audio標(biāo)簽時(shí)遇到的問(wèn)題分享

      html5 audio標(biāo)簽在ios 微信瀏覽器中是無(wú)法自動(dòng)播放的,最近在做一個(gè)小的項(xiàng)目遇到這個(gè)問(wèn)題,安卓和pc都是正常的,唯獨(dú)ios不行,查閱了很多資料,找到了以下方法,也許不是最好用的方法,如果有更方便的方法,盡請(qǐng)留言:

      html部分:  <audio id="audio"><source src="20161012102044_57fd9dfc044cd.mp3"></audio>  <script>      audio = document.getElementById('audio');      audio.play();  </script>

      js部分:

      // 函數(shù):      function audioAutoPlay(id)  {      var audio = document.getElementById(id);      var play = function() {          document.removeEventListener("WeixinJSBridgeReady", play);          document.removeEventListener("YixinJSBridgeReady", play);          // document.removeEventListener("touchstart", play, false);          audio.play();          audio.pause();          };      audio.play();      audio.pause();      //weixin  document.addEventListener("WeixinJSBridgeReady", play, false);      //yixin   document.addEventListener('YixinJSBridgeReady', play, false);      //touch   document.addEventListener("touchstart", play, false);  }  //調(diào)用:  audioAutoPlay('audio1');

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)