+ window.addEventListener("devicelight", this.lightEvent, true);
+ window.addEventListener("deviceproximity", this.proxEvent, true);
+
+ lightEvent: function(lightData) {
+ lightData.value (in lux)
+ },
+ proxEvent: function(proxData) {
+ proxData.min <= .value <= .max (in cm)
+ },
+
+ window.removeEventListener("devicelight", this.lightEvent, true);
+ window.removeEventListener("deviceproximity", this.proxEvent, true);
+
+ // flash/torch code works via navigator.mozCameras.getCamera
+ // flaky and subject to change, please consult code on github