huangxiaojing 4 년 전
부모
커밋
748dcf86e3
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      screenIos/pcm-player.js

+ 5 - 5
screenIos/pcm-player.js

@@ -42,11 +42,11 @@ PCMPlayer.prototype.getTypedArray = function () {
 
 PCMPlayer.prototype.createContext = function () {
     this.audioCtx = new (window.AudioContext || window.webkitAudioContext)();
-    // console.log(this.audioCtx);
-    // if (this.audioCtx.state === 'suspended' && 'ontouchstart' in window) {
-    //     var unlock = () => { this.audioCtx.resume(); };
-    //     document.body.addEventListener('touchstart', unlock, false);
-    // }
+    console.log(this.audioCtx);
+    if (this.audioCtx.state === 'suspended' && 'ontouchstart' in window) {
+        var unlock = () => { this.audioCtx.resume(); };
+        document.body.addEventListener('touchstart', unlock, false);
+    }
     this.gainNode = this.audioCtx.createGain();
     this.gainNode.gain.value = 1;
     this.gainNode.connect(this.audioCtx.destination);