diff --git a/Readme.md b/Readme.md index 64eb6c6..96facf0 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,12 @@ # GazeClient -A javascript library to subscribe to local gaze data streams in the OTH/UR Eyetracking Classroom. +A Javascript library to subscribe to local gaze data streams in the OTH/UR Eye-Tracking Classroom. Packed and compressed library files can be found in `/build`. + +GazeClient connects to a running [GazeServer](https://lab.las3.de/gitlab/eye-tracking-classroom/gaze-server.cs) instance on the local machine and publishes gaze data from the currently tracked user. Websockets are used to connect client and server. ## Usage -**Add the library:** +**Add the library to your application:** ``` @@ -19,12 +21,19 @@ gclient.addEventListener("gazeDataAvailable", function onGazeDataAvailable(event }); ``` -**Connect to a running gaze data server:** +**Connect to a running gaze data server by providing a valid URL:** ``` gclient.connect("ws://localhost:8001/gaze"); ``` +### Events + +| Event | Type | Description | Data | +|---|---|---|---| +| ConnectionOpenedEvent | connectionclosed | Invoked when client successfully connected to server. | - | +| ConnectionClosedEvent | connectionclosed | Invoked when client lost connection to server. | - | +| DataEvent | dataavailable | Invoked when new gaze data from eye-tracker is available. | On-display (x,y) coordinates for both eyes | ## Build @@ -32,4 +41,4 @@ gclient.connect("ws://localhost:8001/gaze"); - 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/`. \ No newline at end of file +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/), compress with [uglify-es](https://github.com/mishoo/UglifyJS2/tree/harmony) and copied to `build/` and `demo/`. \ No newline at end of file