I need help please. I do not get to operate the controller. The game loads on the computer screen, however I copied the following code in a file controller.html and the driver does not appear in the device:
<html>
<head>
<!--<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>-->
<meta name="viewport" content="user-scalable=yes"/>
<style type="text/css">
html, body {
height: 100%;
overflow: hidden;
}
body {
background-color: #222;
}
button {
margin-bottom: 1px;
width: 48%;
height: 48%;
border: 0;
box-sizing: border-box;
font-size: 40px;
color: #FFFFFF;
background-color: #333333;
outline: none;
}
</style>
</head>
<body>
<div style="width:100%;float:left;">
<button id="leftup">UP</button>
<button id="rightup">UP</button>
</div>
<body>
<div style="width:100%">
<button id="leftdown">DOWN</button>
<button id="rightdown">DOWN</button>
</div>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="https://www.airconsole.com/api/airconsole-1.3.0.js"></script>
<script type="text/javascript">
var air_console = new AirConsole();
// Let the screen know we are here
var sendHandshake = function() {
air_console.message(AirConsole.SCREEN, {
handshake: true
});
};
air_console.onReady = function() {
sendHandshake();
};
air_console.onMessage = function(device_id, data) {
if (data.handshake) {
sendHandshake();
}
};
var down_event = isMobile() ? 'touchstart' : 'mousedown';
var up_event = isMobile() ? 'touchend' : 'mouseup';
$("#leftup").on(down_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'leftup'
});
});
$("#leftdown").on(down_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'leftdown'
});
});
$("#leftup").on(up_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'leftstop'
});
});
$("#leftdown").on(up_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'leftstop'
});
});
$("#rightup").on(down_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'rightup'
});
});
$("#rightdown").on(down_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'rightdown'
});
});
$("#rightup").on(up_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'rightstop'
});
});
$("#rightdown").on(up_event, function () {
air_console.message(AirConsole.SCREEN, {
message: 'rightstop'
});
});
/**
* Returns true if device is a mobile device
* — {Boolean}
*/
function isMobile() {
if (navigator.userAgent.match(/Android/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/iPad/i) ||
navigator.userAgent.match(/iPod/i) ||
navigator.userAgent.match(/BlackBerry/i) ||
navigator.userAgent.match(/Windows Phone/i) ||
navigator.userAgent.match(/Opera Mini/i) ||
navigator.userAgent.match(/IEMobile/i)) {
return true;
} else {
return false;
}
};
</script>
</body>
</html>
How do I have to create the driver?
Thank you.