# airplayer

> Query your local network for Apple TV's and have them play videos

Latest version **2.0.0** (published 2016-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install airplayer
pnpm add airplayer
yarn add airplayer
bun add airplayer
```

Provides the command `airplayer`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2016-04-30 |
| First published | 2016-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.12 |
| Dependencies | 8 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 84 |
| Author | Thomas Watson Steen |
| Maintainers | watson |
| Keywords | airplay, apple, tv, appletv, video, player, play, cli, command |

## Links

- npm: https://www.npmjs.com/package/airplayer
- Repository: https://github.com/watson/airplayer
- Homepage: https://github.com/watson/airplayer#readme
- Issues: https://github.com/watson/airplayer/issues
- npm.io page: https://npm.io/package/airplayer

## Dependencies (8)

- [mime](https://npm.io/package/mime.md) ^1.3.4
- [bonjour](https://npm.io/package/bonjour.md) ^3.3.1
- [minimist](https://npm.io/package/minimist.md) ^1.2.0
- [internal-ip](https://npm.io/package/internal-ip.md) ^1.2.0
- [range-parser](https://npm.io/package/range-parser.md) ^1.0.3
- [server-destroy](https://npm.io/package/server-destroy.md) ^1.0.1
- [airplay-protocol](https://npm.io/package/airplay-protocol.md) ^2.0.2
- [appendable-cli-menu](https://npm.io/package/appendable-cli-menu.md) ^2.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2016-04-30
- 1.1.0 — 2016-04-24
- 1.0.2 — 2016-04-18
- 1.0.1 — 2016-04-17
- 1.0.0 — 2016-04-17

## README

# airplayer

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

[![Build status](https://travis-ci.org/watson/airplayer.svg?branch=master)](https://travis-ci.org/watson/airplayer)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

## 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

```js
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`](https://github.com/watson/airplay-protocol) with
the following extra properties:

- `name` - The human readable name of the AirPlay device

## License

MIT

---
_Source: https://npm.io/package/airplayer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
