Commit 51c3f50f by Alexander Bazo

Update Readme

parent 51bd5294
# GazeClient # 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 ## Usage
**Add the library:** **Add the library to your application:**
``` ```
<script type="application/javascript" src="gazeclient.js"></script> <script type="application/javascript" src="gazeclient.js"></script>
...@@ -19,12 +21,19 @@ gclient.addEventListener("gazeDataAvailable", function onGazeDataAvailable(event ...@@ -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"); 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 ## Build
...@@ -32,4 +41,4 @@ gclient.connect("ws://localhost:8001/gaze"); ...@@ -32,4 +41,4 @@ gclient.connect("ws://localhost:8001/gaze");
- node.js - 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/`. 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 \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment