Git Product home page Git Product logo

play-on-apple-tv's Introduction

play-on-apple-tv

A command line tool to play any audio/video on an Apple TV.

asciicast

npm version ISC-licensed chat on gitter support me on Patreon

Usage

Using npx:

npx play-on-apple-tv some-audio-file.mp3 my-apple-tv.local
npx play-on-apple-tv 'http://some-server/some-audio-file.mp3' my-apple-tv.local

Find the name of your Apple TV using bonjour-browser:

npx bonjour-browser | grep airplay

Play a Youtube video by finding the raw video url using youtube-dl:

npx play-on-apple-tv $(youtube-dl -f 136 --get-url 'https://www.youtube.com/watch?v=jNQXAC9IVRw') my-apple-tv.local

Contributing

If you have a question or have difficulties using play-on-apple-tv, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

play-on-apple-tv's People

Contributors

derhuerst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

play-on-apple-tv's Issues

Cannot play

I see this problem with apple tv 3:

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: Unexpected response to PTTH/1.0 Upgrade request
    at /Users/pakonat/.nvm/versions/node/v7.10.1/lib/node_modules/play-on-apple-tv/node_modules/reverse-http/index.js:59:32
    at /Users/pakonat/.nvm/versions/node/v7.10.1/lib/node_modules/play-on-apple-tv/node_modules/consume-http-header/index.js:12:5
    at done (/Users/pakonat/.nvm/versions/node/v7.10.1/lib/node_modules/play-on-apple-tv/node_modules/consume-until/index.js:52:5)
    at Socket.consume (/Users/pakonat/.nvm/versions/node/v7.10.1/lib/node_modules/play-on-apple-tv/node_modules/consume-until/index.js:33:7)
    at Object.onceWrapper (events.js:293:19)
    at emitNone (events.js:86:13)
    at Socket.emit (events.js:188:7)
    at emitReadable_ (_stream_readable.js:434:10)
    at emitReadable (_stream_readable.js:428:7)
    at readableAddChunk (_stream_readable.js:189:13)

document how to find out & play Youtube HLS URLs

Sending a YouTube video URL directly to an Apple TV (3rd gen) fails.

You can let the Apple TV play an .mp4 URL just fine (and get it via youtube-dl --get-url -f format-id-here url-here), but in order to let the Apple TV choose video quality, it needs an HLS URL; This works via a periodically re-fetched .m3u8 URL containing links to video chunks in several qualities.

The problem is finding out the HLS URL of a non-live-stream Youtube video. I've tried, but failed.

support the PIN code of recent Apple TVs

When I try to connect, I can't authenticate:

The error is:

Error: Unexpected response from Apple TV: 403
at ClientRequest.<anonymous> (~/airplayer/node_modules/airplay-protocol/index.js:155:43)
    at Object.onceWrapper (events.js:293:19)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:191:7)
    at HTTPParser.parserOnIncomingClient (_http_client.js:522:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
    at Socket.socketOnData (_http_client.js:411:20)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)

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.