node package manager


Apple AirPlay client library for AppleTV


node-airplay is a client library for Apple's AirPlay remote playback protocol.

some code full reference node-airplay, thanks!

From npm:

npm install airplay2

From bower:

bower install airplay

From source:

git clone
npm link
  • node_mdns

    • It's my fork, hack an error no such record
    • Unfortunately the original node_mdns is woefully out of date and has required many tweaks to get working
  • ffmpeg

    brew install ffmpeg

// remote video 
var browser = require('airplay2').createBrowser();
browser.on('deviceOn', function(device) {'http://remotehost/video.mp4', 0, function() {'video playing...');
// local video (by HLS) 
var hls = require('airplay2').createHLS();
hls.start(7001);'/Users/zfkun/videos/1.mkv', function(info) {'video opened: ', info);
var browser = require('airplay2').createBrowser();
browser.on('deviceOn', function(device) {, 0, function() {'video playing...');
  • 多码率切换
  • 外挂字幕