Selaa lähdekoodia

恢复代码,放弃ios自动播放

孙志雷 6 vuotta sitten
vanhempi
commit
9459f50c26
2 muutettua tiedostoa jossa 9 lisäystä ja 11 poistoa
  1. 1 1
      index.html
  2. 8 10
      view/question.html

+ 1 - 1
index.html

@@ -25,7 +25,7 @@
             contentType:'application/json;charset=utf-8',
             contentType:'application/json;charset=utf-8',
             data: jionData,
             data: jionData,
             success: function (userData) {
             success: function (userData) {
-                //alert(JSON.stringify(userData.data))
+                alert(JSON.stringify(userData.data))
                 localStorage.setItem('userData', JSON.stringify(userData.data));
                 localStorage.setItem('userData', JSON.stringify(userData.data));
             },
             },
             error: function (e) {
             error: function (e) {

+ 8 - 10
view/question.html

@@ -212,16 +212,14 @@ window.onload=function(){
         };
         };
     }
     }
     // 解决苹果不能播放
     // 解决苹果不能播放
-    function audioAutoPlay(id){  
-        var audio = document.getElementById(id);  
-        audio.play();  
-        document.addEventListener("WeixinJSBridgeReady", function () {  
-                audio.play();  
-        }, false);  
-        document.addEventListener('YixinJSBridgeReady', function() {  
-            audio.play();  
-        }, false);  
-    }  
+    function audioAutoPlay(id){
+      var audio = document.getElementById(id);
+    play = function(){
+            audio.load();
+       audio.play();
+    };
+       $('.audiobtn').on("click",play);
+    }
 }
 }
 </script>
 </script>
 </html>
 </html>