/nodecast-js

Node.js module for UPnP/DLNA/Chromecast support

Primary LanguageJavaScriptMIT LicenseMIT

nodecast-js

Nodecast-js is a simple module for streaming media to Chromecast/UPnP/DLNA.

Build Status NPM version Dependency Status npm

Installation

npm install nodecast-js --save

Usage

const NodeCast = require('nodecast-js');

const url = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4';
const timestamp = 60; // in seconds
const nodeCast = new NodeCast();

nodeCast.onDevice(device => {
    device.onError(err => {
        console.log(err);
    });

    console.log(nodeCast.getList()); // list of currently discovered devices

    device.play(url, timestamp);
});

nodeCast.start();

setTimeout(() => {
    nodeCast.destroy(); // destroy nodecast
}, 20000);