Closed ryanramage closed 10 years ago
Hey Ryan, you can use a combination of elements in the awe.js
API to target different types of operating systems and browsers with different capabilities. In general, at the moment Chrome and Firefox are widely supported across both PC and Android. But as you'll see below you could even target specific applications for browsers like Safari on iOS if you only need certain capabilities that they support. But in general for AR related functionality I'd stick with Chrome or Firefox. And each of the examples we publish should generally detect and let you know if the browser you are testing them with is supported.
We'll also be publishing some tutorials on this topic soon, but in the meantime here's a few tips.
If you look in examples/geo_ar/index.html
just inside awe.init()
you'll see we set device_type: awe.AUTO_DETECT_DEVICE_TYPE
. This tells this app to use awe.js
's automatic device detection. You can see the code for this inside js/awe.js
and the result is available by accessing awe.device_type()
(e.g. pc
, android
, iphone
, etc.). Of course you can choose to use your own device detection and then at the beginning of awe.init()
you would just set the awe.device_type
value yourself.
Inside the ready: function() {...}
within awe.init()
you will also see that we call awe.util.require()
with an array of objects. And inside each object we have a key called capabilities that is an array of strings like gum
, gyro
and webgl
. The files listed in the files:
block will only be loaded if these capabilities are met. And once they are loaded then the success: function() {...}
will be called.
Here's is a summary of the set of capabilities awe.js
currently automatically detects and this is defined in the detect_capabilities()
function inside js/awe.js
.
ajax : false, // is ajax supported
geo : false, // is geo supported
lat: undefined, // only populated once location requested
lon: undefined, // only populated once location requested
gyro : false, // is orientation supported
motion : false, // is motion supported
audio : false, // is web audio supported
gum: false, // is camera/microphone access supported
webgl: false, // is webgl supported
css3d: false, // is css3d supported
storage : false, // is local storage supported
sockets : false // are web sockets supported
Also, inside each plugin (e.g. see examples/geo_ar/awe.geo_ar.js
) you can optionally define the classes of device_types()
that should load and register that plugin. We'll also be doing some dedicated tutorials on plugins soon too.
I hope that helps get you started and please let us know if you have any other questions.
roBman
I want to do some development using awe, what is a supported desktop browser?