node-airplay is a native javascript client library for Apple's AirPlay remote playback protocol.
From npm:
npm install airplay-js
// remote video
var browser = require( 'airplay-js' ).createBrowser();
browser.on( 'deviceOn', function( device ) {
device.play( 'http://remotehost/video.mp4', 0, function() {
console.info( 'video playing...' );
});
});
browser.start();
npm install
npm test
...then, turn on your AppleTV!