ChromeCast implementation for Node.js
JavaScript
Switch branches/tags
Nothing to show
Latest commit b062a87 Jul 12, 2015 @phated phated 0.0.6
Permalink
Failed to load latest commit information.
examples update examples Aug 22, 2013
.gitignore initial commit Aug 12, 2013
LICENSE add license file Aug 13, 2013
README.md update readme to include device Aug 22, 2013
index.js use the new dial api Aug 22, 2013
package.json 0.0.6 Jul 12, 2015

README.md

ChromeCast

Initial chromecast work

API

Chromecast

var chromecast = require('chromecast')();

Initialize a new Chromecast object.

A Chromecast object is an event emitter.

Events:

device

Emits an event when a device is found. Receives a Device object.

chromecast.on('device', function(device){
  // device is the chromecast device
});

discover

Chromecast starts looking for devices.

chromecast.discover();

Device

A Chromecast Device object

launch

Device launches an app with given data.

chromecast.on('device', function(device){
  device.launch('YouTube', {
    v: 'cKG5HDyTW8o'
  });
});

appInfo

Device retrieves info about app.

chromecast.on('device', function(device){
  device.launch('ChromeCast', {
    v: 'release-9e8c585405ea9a5cecd82885e8e35d28a16609c6'
  }).then(function(){
    return device.appInfo();
  }).then(function(appInfo){
    console.log(appInfo);
  });
});

connectionUrl

Device retrieves the connection url for app.

chromecast.on('device', function(device){
  device.launch('ChromeCast', {
    v: 'release-9e8c585405ea9a5cecd82885e8e35d28a16609c6'
  }).then(function(){
    return device.appInfo();
  }).then(function(appInfo){
    return device.connectionUrl(appInfo);
  }).then(function(connectionUrl){
    console.log(connectionUrl);
  });
});

TODO:

  • More docs