Created
February 12, 2018 17:10
-
-
Save kaiquewdev/38ddfd3d970da0fb49473c8fc6836c57 to your computer and use it in GitHub Desktop.
play a list with projection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Browser = require('nodecast-js'); | |
const timestamp = 60; // in seconds | |
const browser = new Browser(); | |
let args = process.argv.slice(2); | |
let url = args[0]; | |
if (args.length === 0) url = 'https://www.youtube.com/watch?v=JN6H4rQvwgY&list=PLtBw6njQRU-rwp5__7C0oIVt26ZgjG9NI'; | |
browser.onDevice(device => { | |
device.onError(err => console.log(err)); | |
console.log(browser.getList()); // list of currently discovered devices | |
device.play(url, timestamp); | |
}); | |
browser.start(); | |
setTimeout(() => { | |
browser.destroy(); // destroy your browser | |
}, 20000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment