Skip to content

K4T/casparcg-node.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Project Info

Simple Node.js module for communication with the CasparCG server.

Usage Example

var Client = require('./lib/Network/Client'),
    AMCPCommands = require('./lib/Network/AMCP/Commands/index');

var client = new Client('localhost', 5250);

client.connect();

client.on(
    'connect',
    function(connectionInfo) {
        console.log('Connected to: ' + connectionInfo['hostAddress'] + ':' + connectionInfo['port']);

        client.sendCommand(AMCPCommands.Play(1, 1, 'AMB', 'SLIDE 10 LEFT'));
        client.sendCommand(AMCPCommands.Bye());
    }
);

client.on(
    'disconnect',
    function() {
        console.log('Server connection has been ended.');
    }
);

client.on(
    'error',
    function(error) {
        console.log('Server connection error: ' + error);
    }
);

client.on(
    'sent',
    function(command) {
        console.log('Command ' + command + ' has been sent.');
    }
);

client.on(
    'response',
    function(command, response) {
        console.log('Server reply: ' + response.toString());
    }
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published