From: Robert Kaiser Date: Sat, 31 Jan 2015 09:45:48 +0000 (+0100) Subject: add MDN links to slides X-Git-Url: https://git-public.kairo.at/?p=slides.git;a=commitdiff_plain;h=f4679eee03285b8c051bd22c22709e9b751bef13;hp=4a344ef25c5fbd35209b6b1ccc0ed199bb62538c add MDN links to slides --- diff --git a/fosdem2015/index.html b/fosdem2015/index.html index b976577..8877ac3 100755 --- a/fosdem2015/index.html +++ b/fosdem2015/index.html @@ -122,7 +122,7 @@

GPS, WiFi/Cell Location

-

API: Geolocation

+

API: Geolocation

Permission: geolocation

@@ -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 @@
 
 

Accelerometer, Magnetometer

-

APIs: deviceorientation, devicemotion events

+

APIs: deviceorientation, +devicemotion events

Permissions: ---

@@ -160,8 +161,8 @@
-  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 @@
 
 

Microphone

-

APIs: WebRTC(getUserMedia), WebAudio

+

APIs: WebRTC(getUserMedia), +WebAudio

Permissions: audio-capture

@@ -191,12 +193,12 @@
-  navigator.getUserMedia({ audio: true },
+  navigator.getUserMedia({ audio: true },
     function(aLocalMediaStream) {
       gModSound.mAudio.stream = aLocalMediaStream;
-      gModSound.mAudio.context = new window.AudioContext();
+      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.analyzer = gModSound.mAudio.context.createAnalyser();
       gModSound.mAudio.input.connect(gModSound.mAudio.analyzer);
     },
     function(err) { ... }
@@ -204,7 +206,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 +219,9 @@
 
 

Light, Proximity; Flashlight

-

APIs: devicelight, deviceproximity events; Camera API

+

APIs: devicelight, +deviceproximity events; +Camera API

Permissions: ---; camera (for Flash)

@@ -227,8 +231,8 @@
-  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 +244,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
 
@@ -251,7 +255,7 @@

Battery

-

APIs: Battery

+

APIs: Battery Status API

Permissions: ---

@@ -261,26 +265,13 @@
-  (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)