Coder Social home page Coder Social logo

airplayer's Introduction

airplayer

Query your local network for Apple TV's or other AirPlay video compatible devices and have them play videos.

Build status js-standard-style

Installation

For programmatic use, install using:

npm install airplayer --save

Or install globally to use via the command line:

npm install airplayer --global

Example Programmatic Usage

var airplayer = require('airplayer')

var list = airplayer()

list.on('update', function (player) {
  console.log('Found new AirPlay device:', player.name)
  player.play(url)
})

Example CLI Usage

If you install the module gobally, simply run the airplayer command with the file you want to play as the first argument.

The airplayer command will look for an Apple TV on your local network. When one is found, it will start playing the chosen video. Use the option -i to select the Apple TV to stream to.

$ airplayer my-video.m4v

Note that the video must be in a format supported by your Apple TV in order for airplayer to play it.

API

var list = airplayer()

Creates a AirPlay list. When creating a new list it will call list.update() once. It is up to you to call afterwards in case you want to update the list.

list.players

An array of the players that have been found on the local network so far.

list.update()

Updates the player list by querying the local network for airplay instances.

list.destroy()

Stop browsing for players.

list.on('update', player)

Emitted when a new player is found on the local network.

The player is an instance of airplay-protocol with the following extra properties:

  • name - The human readable name of the AirPlay device

License

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.