Commit f1ae651e by Alexander Bazo

Update usage information in Readme

parent a944faf0
......@@ -4,27 +4,25 @@ A javascript library to subscribe to local gaze data streams in the OTH/UR Eyetr
## Usage
Add the library:
**Add the library:**
```
<script type="application/javascript" src="gazeclient.js"></script>
```
Connect to a running *GazeServer*:
**Create a client and subscribe to gaze events:**
```
var gclient = new GazeClient();
gclient.connect("ws://localhost:8001/gaze");
gclient.addEventListener("gazeDataAvailable", function onGazeDataAvailable(event) {
console.log(event);
});
```
Subscribe to gaze events:
**Connect to a running gaze data server:**
```
gclient.addEventListener("gazeDataAvailable", onGazeDataAvailable);
function onGazeDataAvailable(event) {
console.log(event);
}
gclient.connect("ws://localhost:8001/gaze");
```
......
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