This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

[PUBLISHED] Airplay client

swtttswttt Member
edited December 2017 in Apps
Hi guys,

The app is submitted to the appstore.
App is removed from app store by developer

For  now there are 2 flow cards, one for playing (url, stream or video) and one for stopping the stream.
Only the video api is integrated, this means when playing audio, the apple tv will show a black screen.

Flowcard input can be a youtube url, streaming url or any other suported audio or video format by airplay.

Working devices:
- Apple TV
- Kodi (coming in 0.0.2)

Let me know any feature requests or issues you may find.

https://github.com/swttt/com.swttt.airplay

Special thanks to the Chromecast devs for (ab)using their code and @Fire69 for debugging airplay for Kodi.
«1

Comments

  • Will try this tonight!
  • Will try this tonight!
  • Just got 2 log files on Slack. 
    Both issues with resolving the local hostname.

    Will invest some more time tonight to find out whats causing this. Could be related to homey, or the library (and it's depancies).
  • Just uploaded a new version that works, just to show some proof of concept. Wil work it out in to an app :smile: 

  • Can i try it with the Apple TV 3 or no need?

  • The error in the previous version was homey related and a bug they are working on. 
    I just need to make sure i save the hostname AND ip adress. For now i need to use the ip adress, but later using hostname would be more user friendly (if your ip changes, it still works).

    Updated github 5 min ago with a version that should work. You can try ;)
  • Bugs Bunny on the Apple TV 3 , check!

  • Works over here. AppleTV 4
  • swtttswttt Member
    edited November 2016
    Cool, thanks for the check!

    will work it out in a full working (usefull) app :smile: 
  • Anytime
  • Great!
  • Fire69Fire69 Member
    edited November 2016
    Test with 2 Kodi's (1 Raspi, 1 W10)
    Starting airplay client
    Found an AirPlay server: { addresses: [ '192.168.1.13' ],
      name: 'Raspi-Berging',
      fqdn: 'Raspi-Berging._airplay._tcp.local',
      host: 'Raspi-Berging.local',
      referer: { address: '192.168.1.13', family: 'IPv4', port: 5353, size: 109 },
      port: 36667,
      type: 'airplay',
      protocol: 'tcp',
      subtypes: [] }
    Found an AirPlay server: { addresses: [ '192.168.1.21', 'fe80::a1f6:31e8:39e3:b7a' ],
      rawTxt: <Buffer 1a 64 65 76 69 63 65 69 64 3d 46 46 3a 46 46 3a 46 46 3a 46 46 3a 46 46 3a 46 32 0c 6d 6f 64 65 6c 3d 58 62 6d 63 2c 31 0e 73 72 63 76 65 72 73 3d 31 ... >,
      txt:
       { deviceid: 'FF:FF:FF:FF:FF:F2',
         model: 'Xbmc,1',
         srcvers: '101.28',
         features: '0x20F7',
         xbmcdummy: 'odddummy' },
      name: 'Kodi-W10',
      fqdn: 'Kodi-W10._airplay._tcp.local',
      host: 'PC-5CG6132CSC.local',
      referer: { address: '192.168.1.21', family: 'IPv4', port: 5353, size: 275 },
      port: 36667,
      type: 'airplay',
      protocol: 'tcp',
      subtypes: [] }
    Error: connect ECONNREFUSED 192.168.1.13:7000
        at Object.exports._errnoException (util.js:907:11)
        at exports._exceptionWithHostPort (util.js:930:20)
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1077:14)
    
    --- INFO: com.swttt.airplay has been killed ---
    

  • @Fire69 Updated the code, should work now. Has to do with kodi not using the default airplay port (7000).
  • So first early beta app is on github. You can add every airplay device seperate, and send an url to it from a flow.
    Please stress test the hell out of this and post your logs on crashes :smile: 

  • Adding device: Check!
    Playing url: Check!
    Crashes: Nope, sorry!

  • Airplay is having problems with keeping the connection alive. Can you guys test and confirm?

    Will look into fixing this issue :smile: 


  • Might found a way to fixed the issue with timing out. Will test out tonight.
    Can someone please test if my hypothesis is right, and the connection drops after exactly 60 sec? (not home now, so can't test :D )

  • Cool, the time out issue seems resolved.
    Current (working) code is on github :smile: 

    Kodi still seems to have some quirks, but for the apple tv it seems to work.
  • Working for Apple tv on github. (see updated first post)
    Waiting for aproval in the appstore.

    Kodi will be fixed in the near future.
  • Cool, i will look at this app when it is in the AppStore! Thx @swttt ;
  • @phil_s ;
    It's published now :smile: 

  • I will give it a try when I am home in the evening! :-)
  • An example of what can be put in the URL field would be nice.

    Thanks for making this !
  • @YvesGeffens ;
    Url field behaves the same as the chromecast app.
    You can input a youtube url, m3u radio stream or any other airplay supported video format.
  • YvesGeffensYvesGeffens Member
    edited December 2016
    It's the first time I'm going to use something like this.
    So I can just put 

    https://www.youtube.com/watch?v=RDfjXj5EGqI

    in the URL field?
    (not at home, have to try it tonight)
  • @YvesGeffens Yup indeed that should work :smile: 
    You also can use this for example: http://vip-icecast.538.lw.triple-it.nl/RADIO538_MP3
    That one points to the radio 538 m3u stream.

    Someone asked if a webcam url wil work as wel, not sure about that since only a few video codecs are supported on airplay. But if your webcam feed is supported by the airplay protocol, you can view the stream of your frontdoor when the doorbell is pressed, and stop the stream after X seconds.
  • Someone posted an issue in the appstore. Can others test if they get the same or similair error?

    "Hi! I get an error when trying to play something: "Device requirements. This Airplay connection requires iOS 7.1 or later". Latest Apple TV with latest tvOS. Just letting you know. Will update when I find a solution."
  • he needs to turn off his device verification :smile: (long live google!)
    or you need to build that into the app of course :smiley: which is a little bit harder i think

    Settings > AirPlay > Security > Require Device Verification
  • phil_sphil_s Member
    edited December 2016
    thank you very much. i use it for streaming webradiostations in germany (m3u etc.) 
    works a lot better than my chromcast audio alternative "audiocast m5 by iEast".

    i have a apple tv3 no errors like this in the lines above...

    thank you @swttt ;;

  • @phil_s You are welcome :smile: 
    Do note that when you use an audio stream it allways shows a black screen (at least it does on the latest apple tv).
    WIll look into adding the audio api later on, first a fix for Kodi :smile: 

Sign In or Register to comment.