Skip to content

Instantly share code, notes, and snippets.

@Rpsl
Created December 29, 2015 11:57
Show Gist options
  • Save Rpsl/ff7c8abf852aed7a6500 to your computer and use it in GitHub Desktop.
Save Rpsl/ff7c8abf852aed7a6500 to your computer and use it in GitHub Desktop.
node js stream soundcloud to airplay
var browser = require('airplay').createBrowser(2);
var resolve = require('soundcloud-resolve');
browser.on('deviceOnline', function(device) {
console.log('device online: ' + device.id);
if(device.info_.name == 'SysadmTV') {
console.log(device)
resolve(client_id,'https://soundcloud.com/doornrecords/meg-nerak-renaissance-available-january-11', function(err, res, body){
// console.log(err);
// console.log(res);
console.log(body);
device.play(body, 0, function(res) {
console.log(res);
if (res) {
// playing
} else {
// failed to start playback
}
});
});
}
});
browser.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment