iina icon indicating copy to clipboard operation
iina copied to clipboard

Add Airplay functionality

Open nienkeboomsma opened this issue 7 years ago • 62 comments

It would be cool if IINA supported Airplay, so you can play videos on your Apple TV without having to mirror your entire screen.

nienkeboomsma avatar Jan 06 '17 19:01 nienkeboomsma

I'll add my vote to this. AirPlay receiver/recorder and sender would be a great add.

DrHurt avatar Jan 16 '17 08:01 DrHurt

AirPlay only supports H.264/AAC mp4 file, which is supported by QuickTime nicely.

inflation avatar Jan 31 '17 02:01 inflation

Beamer supports sending many other formats, not sure if its transcoding or not tho. https://beamer-app.com/features

matthewdias avatar Jan 31 '17 06:01 matthewdias

AirPlay (as a protocol) is not restricted to any formats. Apple TV only supports H.264/AAC/Tx3g. 3rd party video players on iOS (and to a lesser extent on macOS) support AirPlay streaming in any format (by de-muxing on the fly).

For example: I use nPlayer on my iPad to AirPlay MKV/HEVC/OPUS/VobSub to my TV via an Android TV box and it works perfectly.

Summary: Format support depends on the receiving device which is NOT necessarily an Apple TV. Many 3rd party video players support streaming via AirPlay and many TV sticks and boxes support receiving AirPlay. (allowing use of many formats)

DrHurt avatar Jan 31 '17 07:01 DrHurt

By default people think of AirPlay as a way to stream videos to Apple TV. Developer guide suggests encoding video with H.264 compression and so on: https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AirPlayGuide/PreparingYourMediaforAirPlay/PreparingYourMediaforAirPlay.html

The problem of implementing this functionality was discussed at mpv: https://github.com/mpv-player/mpv/issues/3448#issuecomment-268125970

Also there are some write-ups on how this can be achieved: https://github.com/feross/webtorrent-desktop/issues/1097 https://github.com/butterproject/butter-desktop/issues/528#issuecomment-267760909

To begin with something, I suggest implementing basic AirPlay functionality for streaming supported formats (which seems relatively easy to do). Here is one library: https://github.com/qasim/Airstream

euf avatar Apr 01 '17 02:04 euf

As of tvOS 10.2, AirPlay requires “device verification” which has broken many third-party implementations. Beamer doesn't work. AirParrot added support March 16.

IINA should absolutely support AirPlay, but I understand if it's not top priority. I'm excited to see a proper GUI video player again since MPlayerX.

jooize avatar Apr 05 '17 23:04 jooize

https://nto.github.io/AirPlay.html https://gist.github.com/watson/50e46a6085ffc805d326 http://sergiochan.xyz/2016/08/29/iOS-Airplay-中的-Airtunes-Server-服务协议和机制详解以及-Android-Demo-的实现/ https://github.com/xbmc/xbmc/pull/698 https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/AirPlayGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40011045-CH1-SW1

Hope it helps.

mysteriouss avatar May 20 '17 19:05 mysteriouss

Thanks for the links, but it appears that the first one is for iOS 5. Do you know of anything newer?

saagarjha avatar May 20 '17 19:05 saagarjha

Sorry, I did not notice, that's as far as it goes now. I've hopper-reversed the airserver mac app recently and it failed to load the dylibs, which is annoying. I'll keep up with this if I find something valuable.

mysteriouss avatar May 20 '17 20:05 mysteriouss

Alright, thanks!

saagarjha avatar May 20 '17 20:05 saagarjha

This one seems difficult now as I couldn't find any document or o-s implementation of new device verification (/pair-verify without PIN), let alone FairPlay encryption (/fp-setup, hope this is not mandatory in newer airplay servers).

Any help on those protocols are greatly appreciated.

HarukaMa avatar Aug 03 '17 20:08 HarukaMa

For basic operations already documented, you just give airplay server a URL to play, and the airplay device fetch and try to play that url. This has been tested on AirServer app and works, but greatly limited on many aspects. Beside from the format supported, I don't even know are actual devices still support this type of operation, and you need to put up a http server for the device to fetch. This could be a security issue from my point of view.

I was looking into airplay protocols, and will update if I have time to play with that again.

HarukaMa avatar Aug 03 '17 20:08 HarukaMa

An alternative app for the airplay feature. https://atksoft.com/index.php?name=Home

lvhailong avatar Aug 30 '17 12:08 lvhailong

@fabi94music Sorry, out of the loop here. Is 1.0 gonna inculde AirPlay?

kaardilugeja avatar Apr 17 '18 19:04 kaardilugeja

It's unlikely as of now, since I don't think any of us are working on it. One of these days I might take a look at trying to reverse engineer AirPlay, but there are no plans for support currently since this is not a publicly documented protocol.

saagarjha avatar Apr 17 '18 20:04 saagarjha

https://developer.apple.com/documentation/avfoundation/airplay_2/getting_airplay_2_into_your_app

alexiscreuzot avatar May 27 '18 18:05 alexiscreuzot

AirPlay 2 is an audio streaming API, as opposed to being a video streaming one as we would need here. In addition, it's only available on iOS and tvOS. The ability to stream video from macOS is not public API on macOS, to my knowledge.

saagarjha avatar May 27 '18 20:05 saagarjha

The original WWDC session does list it as supporting on macOS, although AVAudioSession that the docs recommend doesn't seem to be present on the platform. That might also be the case for the documented method for Airplay 1 though; I'm not super familiar with macOS / iOS audio frameworks.

If it is possible now, or in the future, I would like to chime in and say that even just an audio streaming capability would be quite useful for those of us that use IINA but would like to the audio play over an external speaker. Currently the latency of Airplay 1 means this not really viable but supposedly Airplay 2 should have no problems with real-time playback.

philipbelesky avatar Jun 11 '18 06:06 philipbelesky

Hello, when about to wait for airplay?

svanichkin avatar Aug 07 '18 09:08 svanichkin

It will be cool to have airplay listed in the feature!

milabobo avatar Sep 03 '18 15:09 milabobo

Any news about AirPlay? Could be awesome to watch whatever videos or stream link directly on the Apple TV

mickaphd avatar Dec 13 '18 21:12 mickaphd

Actually you can (using this workaround),

As a workaround, you can activate Airplay to AppleTV as a second monitor, and use inna in full screen airplayed at AppleTV as your second monitor;

Works perfectly.

Em 13 de dezembro de 2018 às 19:31:53, mickaphd ([email protected]) escreveu:

Any news about AirPlay? Could be awesome to watch whatever videos or stream link directly on the Apple TV

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lhc70000/iina/issues/63#issuecomment-447127894, or mute the thread https://github.com/notifications/unsubscribe-auth/APvTV3lKpDmiBkBH4ADKJXy-55k6HRNsks5u4sdJgaJpZM4LdDEL .

pradorocchi avatar Dec 14 '18 10:12 pradorocchi

Mirroring the Mac screen does not work perfectly. It is not smooth at all with the Apple TV 4 the video is chopped. I am using Airflow which does a way greater job. https://airflowapp.com/ But that would be great to have it in iina.

sgandon avatar Jan 01 '19 22:01 sgandon

@lhc70000 VLC will get AirPlay 2 Support for Android and multiple 2019 TV's will be able to receive AirPlay 2 video and audio. Is there a way to implement it into IINA as well?

ghost avatar Jan 12 '19 13:01 ghost

Almost 2019, issue still open ...

We are short at either experienced people or time, especially on this topic. Your help is welcomed.

inflation avatar Apr 04 '19 04:04 inflation

https://developer.apple.com/documentation/avfoundation/airplay_2/getting_airplay_2_into_your_app

whatthehomepod avatar Apr 04 '19 04:04 whatthehomepod

@whatthehomepod This public API belongs to AVFoundation but IINA doesn't use AVFoundation to play videos. Integrating AirPlay into IINA requires reverse engineering and implementing the protocol by ourselves.

lhc70000 avatar Apr 04 '19 04:04 lhc70000

(See my response to this exact link above)

saagarjha avatar Apr 04 '19 04:04 saagarjha

Integrating AirPlay into IINA requires reverse engineering and implementing the protocol by ourselves.

That's pretty unfortunate. For those in need of this feature, VLC announced Airplay 2 support in version 4 (Nightly builds are available).

alexandreleroux avatar Jun 01 '19 19:06 alexandreleroux

@alexandreleroux Do you have any documentation of this feature? I couldn't find any references to AirPlay in the VLC source code, or any indication of AirPlay 2 capabilities in the macOS VLC 4 nightly builds.

chrisballinger avatar Jun 01 '19 21:06 chrisballinger