Readme.md 755 Bytes
Newer Older
Alexander Bazo committed
1 2 3 4 5 6
# GazeClient

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

## Usage

7
**Add the library:**
Alexander Bazo committed
8 9 10 11 12

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

13
**Create a client and subscribe to gaze events:**
Alexander Bazo committed
14 15 16

```
var gclient = new GazeClient();
17 18 19
gclient.addEventListener("gazeDataAvailable", function onGazeDataAvailable(event) {
	console.log(event);
});
Alexander Bazo committed
20 21
```

22
**Connect to a running gaze data server:**
23 24

```
25
gclient.connect("ws://localhost:8001/gaze");
26 27
```

Alexander Bazo committed
28 29 30 31 32 33 34 35

## 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/`.