I'm trying to embed HTML5 games in iframes to display in browser on mobile devices such as iPads and iPhones.
If you visit them directly on an iPad they work fine.
But if you embed them using an iframe then when you touch the game and then let go, the game pauses.
Is there a way to stop this iframe behaviour so that they behave as they should?
It seems like maybe focus is lost when you stop touching and it think's your vacant and pauses?
Example
Try the two example links below in the emulator and you will see the issue
iPhone / iPad emulator: https://app.io/safari
Direct Game Link (game works): http://static.tresensa.com/madcab/index.html?dst=A0000
Embedded Game Link (game doesn't work): http://drttrd.com/testIframe.php
The code I'm using (basic)
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Game</title>
</head>
<body>
<div>
<iframe src="http://static.tresensa.com/madcab/index.html?dst=A0000" frameborder="0" scrolling="no" width="960" height="536"></iframe>
</div>
</body>
</html>
What I've tried
css styling to change the interaction type
<div style="overflow:auto;-webkit-overflow-scrolling:touch;">
<iframe src="" height="" height=""></iframe>
</div>
JS to prevent defaults
<script>
document.ontouchmove = function(e) {
e.preventDefault();
};
</script>
... neither have helped