浏览代码

Fix suspended audio context on mobile (#421)

Jean-Denis Boivin 7 年之前
父节点
当前提交
11fcb7aa05
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      hxd/snd/NativeChannel.hx

+ 2 - 0
hxd/snd/NativeChannel.hx

@@ -152,6 +152,7 @@ class NativeChannel {
 		div.onclick = stopInput;
 		div.onclick = stopInput;
 		div.onkeydown = stopInput;
 		div.onkeydown = stopInput;
 		js.Browser.document.body.addEventListener("keydown",stopInput);
 		js.Browser.document.body.addEventListener("keydown",stopInput);
+		js.Browser.document.body.addEventListener("touchend",stopInput);
 		js.Browser.document.body.appendChild(div);
 		js.Browser.document.body.appendChild(div);
 		waitDiv = div;
 		waitDiv = div;
 	}
 	}
@@ -161,6 +162,7 @@ class NativeChannel {
 		waitDiv.remove();
 		waitDiv.remove();
 		waitDiv = null;
 		waitDiv = null;
 		js.Browser.document.body.removeEventListener("keydown",stopInput);
 		js.Browser.document.body.removeEventListener("keydown",stopInput);
+		js.Browser.document.body.removeEventListener("touchend",stopInput);
 		if( ctx != null ) ctx.resume();
 		if( ctx != null ) ctx.resume();
 	}
 	}