Chapter 11 The touch interface and accessing hardware Flashcards
where can you find the information provided by gyroscopes, compasses, and accelerometers?
HTML5 DeviceOrientation Event API Specification created by the W3C.
How many and what events are contained in the DevicePOrientation Event API?
devicemotion
device orientation
compassneedscalibration
What is devicemotion?
This event is automatically and continually fired passing information received from the motion sensing hardware.
What is deviceorientation?
This event is automatically fired when a major change in the device orientation occurs.
What is compassneedscalibration?
This event is automatically fired if it is determined that there is a difference in the motion sensing data that is being gathered from the motion sensing hardware.
What coordinates are used to provide information from motion sensing hardware?
x, y and z coordinates.
What is the alpha value?
Rotation of the z axis
What is the beta value?
Rotation of the x axis
What is the gamma value?
Rotation of the y axis
Is deviceorientation part of window object?
Yes, it is part of window object and the event listener must be added to the window object.
What is the js for deviceorientation?
AddEventListener and Collect Data window.addEventListener('deviceorientation', function(event) { var alpha = event.alpha; var beta = event.beta; var gamma = event.gamma; // Do something }, false);
What are the two property that devicemotion provides?
Acceleration property
rorationRate property
accelerationIncludingGravity
What is rotationRate property?
The rotationRate property provides the rotation rate in degrees per second around each axis
What attribute to use when capturing still video, picture and audio by using a web cam?
Example 1: Take a Still Picture using web cam
Example 2: Capture Video using web cam
Example 3: Capture Audio using microphone device
***accept=”audio/”capture
what is getUserMedia() used for?
The getUserMedia() function is part of this specification that is used to get the video or still image that can then be streamed to a video control
There is no src attribute.