Remy Sharp, State of the Gap, PhoneGap Day EU 2016
Core Plugin Audit
navigator.accelerometer.getCurrentAcceleration(
function(acceleration) {
alert('Acceleration X: ' + acceleration.x + '\n' +
'Acceleration Y: ' + acceleration.y + '\n' +
'Acceleration Z: ' + acceleration.z);
}, onError);
window.addEventListener("devicemotion", function(evt) {
alert('Acceleration X: ' + evt.acceleration.x + '\n' +
'Acceleration Y: ' + evt.acceleration.y + '\n' +
'Acceleration Z: ' + evt.acceleration.z);
}, true);
Device Motion
navigator.camera.getPicture(function cameraSuccess(imageUri) {
displayImage(imageUri);
}, function cameraError(error) {
console.debug("Unable to obtain picture: " + error, "app");
}, options);
navigator.mediaDevices.getUserMedia({video: true})
.then(gotMedia)
.catch(error => console.error('getUserMedia() error:', error));
function gotMedia(mediaStream) {
const mediaStreamTrack = mediaStream.getVideoTracks()[0];
const imageCapture = new ImageCapture(mediaStreamTrack);
console.log(imageCapture);
}
Camera
[console.log] Got deviceready event
[console.log] What do we do now?
[console.log] Try and take over the world!