2.0.0 • Published 4 years ago

live-remote-api v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

live-remote-api

The browser part of m4l-ApiServer

This is a library used to communicate with https://github.com/mihop/m4l-apiserver from a browser or node client.

Look at the index.html file in this project for an example of how to get started using the api quickly.

Look at the RemoteApi.spec.ts file in the test folder for a demo of all the capabilities.

In a nutshell

npm install live-remote-api

and then either

// the library assumes you're in a browser, so you have to feed it some globals.
WebSocket = require('websocket').w3cwebsocket;
location = { hostname: '127.0.0.1', port: '8080' };

const { RemoteApi } = require('live-remote-api');

or

<script src="dist/live-remote-api.js"></script>

and then finally

RemoteApi.onOpen(function () {
  RemoteApi.create('live_set master_track mixer_device volume', function (err, api) {
    api.observe('value', function (v) {
      console.log('Master Track Volume Value', v);
    });
    api.set('value', 0.85);
  });
});
2.0.0

4 years ago

1.0.0

8 years ago