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 ...@@ -4,27 +4,25 @@ A javascript library to subscribe to local gaze data streams in the OTH/UR Eyetr
## Usage ## Usage
Add the library: **Add the library:**
``` ```
<script type="application/javascript" src="gazeclient.js"></script> <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(); 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); gclient.connect("ws://localhost:8001/gaze");
function onGazeDataAvailable(event) {
console.log(event);
}
``` ```
......
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