Skip to content

Instantly share code, notes, and snippets.

@kaiquewdev
Created September 29, 2017 14:00
Show Gist options
  • Save kaiquewdev/34569c754038b6ea75b442ff9ef98797 to your computer and use it in GitHub Desktop.
Save kaiquewdev/34569c754038b6ea75b442ff9ef98797 to your computer and use it in GitHub Desktop.
var Browser = require('nodecast-js');
var url = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/big_buck_bunny_1080p.mp4';
var timestamp = 60; // in seconds
var browser = new Browser();
browser.onDevice(function (device) {
device.onError(function (err) {
console.log(err);
});
console.log(browser.getList()); // list of currently discovered devices
device.play(url, timestamp);
});
browser.start();
setTimeout(function () {
browser.destroy(); // destroy your browser
}, 20000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment