Created
December 29, 2015 11:57
-
-
Save Rpsl/ff7c8abf852aed7a6500 to your computer and use it in GitHub Desktop.
node js stream soundcloud to airplay
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
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