Readme.md 740 Bytes
Newer Older
Alexander Bazo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
# GazeClient

A javascript library to subscribe to local gaze data streams in the OTH/UR Eyetracking Classroom. 

## Usage

Add the library:

```
<script type="application/javascript" src="gazeclient.js"></script>
```

Connect to a running *GazeServer*:

```
var gclient = new GazeClient();
gclient.connect("ws://localhost:8001/gaze");
```

20 21 22 23 24 25 26 27 28 29
Subscribe to gaze events:

```
gclient.addEventListener("gazeDataAvailable", onGazeDataAvailable);

function onGazeDataAvailable(event) {
	console.log(event);
}
```

Alexander Bazo committed
30 31 32 33 34 35 36 37

## Build

**Prerequisite**

- node.js

To build a current version of this library run `npm install` and `npm run build`. The client library is packed with [rollup](https://rollupjs.org/guide/en/) and copied to `build/` and `demo/`.