X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;ds=inline;f=fosdem2015%2Findex.html;h=afab08ef34743d07b6d1a742ac8ff8a94cd9b435;hb=refs%2Fheads%2Fmaster;hp=b976577dd2c06c2efd1db2f953a6fb4c7d892e77;hpb=a5b5cb49b761a50d347f99b9f8f78f0c190b915c;p=slides.git diff --git a/fosdem2015/index.html b/fosdem2015/index.html index b976577..afab08e 100755 --- a/fosdem2015/index.html +++ b/fosdem2015/index.html @@ -122,7 +122,7 @@
@@ -132,7 +132,7 @@- this.watchID = navigator.geolocation.watchPosition( + this.watchID = navigator.geolocation.watchPosition( function(position) { position.coords.latitude / .longitude / .accuracy / ... }, @@ -150,7 +150,8 @@@@ -160,8 +161,8 @@Accelerometer, Magnetometer
-APIs: deviceorientation, devicemotion events
+APIs: deviceorientation, +devicemotion events
Permissions: ---
- window.addEventListener("deviceorientation", this.orientEvent, true); - window.addEventListener("devicemotion", this.motionEvent, true); + window.addEventListener("deviceorientation", this.orientEvent, true); + window.addEventListener("devicemotion", this.motionEvent, true); orientEvent: function(orientData) { orientData.alpha / .beta / .gamma (in °) @@ -181,7 +182,8 @@@@ -191,12 +193,13 @@Microphone
-APIs: WebRTC(getUserMedia), WebAudio
+APIs: WebRTC(getUserMedia), +WebAudio
Permissions: audio-capture
- navigator.getUserMedia({ audio: true }, + navigator.getUserMedia({ audio: true }, function(aLocalMediaStream) { gModSound.mAudio.stream = aLocalMediaStream; - gModSound.mAudio.context = new window.AudioContext(); - gModSound.mAudio.input = gModSound.mAudio.context.createMediaStreamSource(gModSound.mAudio.stream); - gModSound.mAudio.analyzer = gModSound.mAudio.context.createAnalyser(); + gModSound.mAudio.context = new window.AudioContext(); + gModSound.mAudio.input = + gModSound.mAudio.context.createMediaStreamSource(gModSound.mAudio.stream); + gModSound.mAudio.analyzer = gModSound.mAudio.context.createAnalyser(); gModSound.mAudio.input.connect(gModSound.mAudio.analyzer); }, function(err) { ... } @@ -204,7 +207,7 @@ // in window.requestAnimationFrame(): var data = new Uint8Array(gModSound.mAudio.frequencySlices); - gModSound.mAudio.analyzer.getByteFrequencyData(data); + gModSound.mAudio.analyzer.getByteFrequencyData(data); // ... do something with data ... gModSound.mAudio.stream.stop(); @@ -217,7 +220,9 @@@@ -227,8 +232,8 @@Light, Proximity; Flashlight
-APIs: devicelight, deviceproximity events; Camera API
+APIs: devicelight, +deviceproximity events; +Camera API
Permissions: ---; camera (for Flash)
@@ -251,7 +256,7 @@ @@ -261,26 +266,13 @@- window.addEventListener("devicelight", this.lightEvent, true); - window.addEventListener("deviceproximity", this.proxEvent, true); + window.addEventListener("devicelight", this.lightEvent, true); + window.addEventListener("deviceproximity", this.proxEvent, true); lightEvent: function(lightData) { lightData.value (in lux) @@ -240,7 +245,7 @@ window.removeEventListener("devicelight", this.lightEvent, true); window.removeEventListener("deviceproximity", this.proxEvent, true); - // flash/torch code works via navigator.mozCameras.getCamera + // flash/torch code works via navigator.mozCameras.getCamera // flaky and subject to change, please consult code on github- (navigator.battery.level * 100).toFixed(1) + "%"; - - if (navigator.battery.charging) { - if (navigator.battery.chargingTime == 0 || - navigator.battery.chargingTime == Infinity) { - "charging"; - } - else { - "charging, " + navigator.battery.chargingTime + "s remaining"; - } - } - else { - if (navigator.battery.dischargingTime == 0 || - navigator.battery.dischargingTime == Infinity) { - "discharging"; - } - else { - navigator.battery.dischargingTime + "s usage remaining"; - } - } + 0 <= navigator.battery.level <= 1 + + .charging (true/false) + + .chargingTime (in s; 0 or Infinity: unknown) + + .dischargingTime (in s; 0 or Infinity: unknown)