Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

Latest commit

 

History

History
39 lines (29 loc) · 1.09 KB

README.md

File metadata and controls

39 lines (29 loc) · 1.09 KB

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);