1 | # CasparCG to Node interface
|
2 |
|
3 | [![Build Status](https://travis-ci.org/respectTheCode/node-caspar-cg.png)](https://travis-ci.org/respectTheCode/node-caspar-cg)
|
4 |
|
5 | This project is early in development and API may change. The query, playout, data and template commands are mostly finished and I will be adding more as I need them. If you need something that is missing add an issue.
|
6 |
|
7 | For now docs are in the source only. I will be moving them to github pages at some point.
|
8 |
|
9 | ## Road Map
|
10 | 0.1 - Implement the entire AMCP Protocol
|
11 | 0.2 - First stable release
|
12 | 0.3 - Add events for all commands and channel/layer status by polling
|
13 | 0.4 - Stable release
|
14 |
|
15 | ## Install
|
16 |
|
17 | npm install caspar-cg
|
18 |
|
19 | ## Usage Example
|
20 |
|
21 | var CasparCG = require("caspar-cg");
|
22 |
|
23 | ccg = new CasparCG("localhost", 5250);
|
24 | ccg.connect(function () {
|
25 | ccg.info(function (err, serverInfo) {
|
26 | console.log(serverInfo);
|
27 | });
|
28 |
|
29 | ccg.play("1-1", "AMB");
|
30 |
|
31 | setTimeout(function () {
|
32 | ccg.clear("1");
|
33 | ccg.disconnect();
|
34 | }, 10 * 1000);
|
35 | });
|
36 |
|
37 | ccg.on("connected", function () {
|
38 | console.log("Connected");
|
39 | });
|
40 |
|
41 | ## Breaking Changelog
|
42 |
|
43 | ### v0.0.5-5
|
44 |
|
45 | Socket errors are now emitted as `connectionError` instead of `error`.
|
46 |
|
47 | ### v0.0.6
|
48 |
|
49 | `ccg.info()` now parses layers and returns a much more predictable result.
|
50 |
|
51 | * Layers is always an array
|
52 | * Numbers and Booleans are parsed (all values were strings before)
|
53 | * Parameters with `-` and `_` are replaced with cammel case
|
54 | * Inconsistent parameters are renamed |
\ | No newline at end of file |