BrowserSensorWatcher
Collection of browser based sensor events. Sensors should be continuous events. Therefor each should be setup in similar way using an event listener. Objects of events, arguments and implementations may differ.
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
sensorHandles: {"watchPosition": *, "getUserMedia": *, "deviceOrientation": *, "deviceLight": *, "deviceProximity": *, "deviceMotion": *, "test": *} All sensor handles must return promise and take no arguments. |
Method Summary
Public Methods | ||
public |
SensorListener(): {"start": *, "stop": *, "check": *} Common object for handling sensors start: Starts watching sensor stop: Stops watching sensor check: Checks for support |
Private Methods | ||
private |
Gets test SensorListener that can be used without access to sensors. |
|
private |
_getWindowEventListenerObject(eventName: String): SensorListener Common SensorListener for window events such as devicemotion. |
Public Constructors
public constructor() source
Public Members
public sensorHandles: {"watchPosition": *, "getUserMedia": *, "deviceOrientation": *, "deviceLight": *, "deviceProximity": *, "deviceMotion": *, "test": *} source
All sensor handles must return promise and take no arguments. start: required. args: (optional options object) should resolve an array with arguments to be passed to stop. stop: required. args: (returnedData from start) check: optional.
Public Methods
public SensorListener(): {"start": *, "stop": *, "check": *} source
Common object for handling sensors start: Starts watching sensor stop: Stops watching sensor check: Checks for support
Return:
{"start": *, "stop": *, "check": *} |
Private Methods
private _getTestEventListenerObject(): SensorListener source
Gets test SensorListener that can be used without access to sensors. Used for testing on displaying when sensors not available.
private _getWindowEventListenerObject(eventName: String): SensorListener source
Common SensorListener for window events such as devicemotion.
Params:
Name | Type | Attribute | Description |
eventName | String |