GithubHelp home page GithubHelp logo

pascalw / airplayer Goto Github PK

View Code? Open in Web Editor NEW
333.0 333.0 42.0 128 KB

Python script to make media playing software Apple Airplay compatbible. Currently supports XBMC, Plex and Boxee.

Home Page: http://pwiddershoven.nl/blog/2011/01/05/airplayer.html

License: BSD 4-Clause "Original" or "Old" License

Python 100.00%

airplayer's People

Contributors

bernhardrode 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  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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

airplayer's Issues

Not finding airplayer

Hey all. Thanks to the help of this awesome community I managed to (I think) correctly install this awesome tool. However when I execute python airplayer.py everything seems to work fine but I still cant find the airplayer (XBMCbuntu 10.1) in iTunes. XBMC even gives a notice and I get the little airplay icon in iTunes, however, no airplay devices.

Heres the debug lines, which I believe is fine right?
xbmc@XBMCLive:/airplayer/airplayer$ python airplayer.py
2013-01-05 00:24:23 [INFO] Starting Airplayer
2013-01-05 00:24:23 [DEBUG] TEMP DIR: /tmp/tmpMl4JRF
2013-01-05 00:24:23 [DEBUG] Sending wake event
2013-01-05 00:24:24 [DEBUG] Registered bonjour service XBMCLive._airplay._tcp.

Does anyone have any tips on how to fix this? Im running iTunes on a windows7 machine.

Issues with pictures/slideshows

Hello,

First, many, many thanks for your hard work on this project. Video works fantastically well with XBMC and AirPlayer, running on Ubuntu 10.10 (streaming from an iPhone 3GS running iOS 4.3).

The issue at hand is that attempts to stream photos to XBMC seem to be totally ignored. When playing a video, there is an immediate reaction in XBMC ("Working..." in the bottom-right corner), but attempts to send photos are seemingly being ignored entirely.

I enabled debug mode in the init script, and only see the following in the AirPlayer log:

2011-03-09 20:13:35 [DEBUG] GET /server-info
2011-03-09 20:13:35 [DEBUG] GET /slideshow-features
2011-03-09 20:13:39 [DEBUG] POST /reverse
2011-03-09 20:13:39 [DEBUG] GET /server-info
2011-03-09 20:13:39 [DEBUG] PUT /photo
2011-03-09 20:13:39 [DEBUG] Sending wake event
2011-03-09 20:15:09 [DEBUG] PUT /photo
2011-03-09 20:15:09 [DEBUG] Sending wake event
2011-03-09 20:15:19 [DEBUG] PUT /photo
2011-03-09 20:15:19 [DEBUG] POST /stop
2011-03-09 20:15:19 [DEBUG] POST /reverse
2011-03-09 20:15:19 [DEBUG] GET /server-info
2011-03-09 20:15:21 [DEBUG] PUT /photo
2011-03-09 20:15:23 [DEBUG] PUT /photo
2011-03-09 20:15:25 [DEBUG] POST /stop
2011-03-09 20:15:56 [DEBUG] GET /server-info
2011-03-09 20:15:56 [DEBUG] GET /slideshow-features
2011-03-09 20:15:58 [DEBUG] POST /reverse
2011-03-09 20:15:59 [DEBUG] GET /server-info
2011-03-09 20:16:00 [DEBUG] PUT /photo
2011-03-09 20:17:59 [DEBUG] PUT /photo
2011-03-09 20:17:59 [DEBUG] Sending wake event
2011-03-09 20:18:02 [DEBUG] PUT /photo
2011-03-09 20:18:05 [DEBUG] PUT /photo
2011-03-09 20:18:08 [DEBUG] PUT /photo
2011-03-09 20:18:11 [DEBUG] PUT /photo
2011-03-09 20:18:14 [DEBUG] PUT /photo
2011-03-09 20:18:17 [DEBUG] PUT /photo
2011-03-09 20:18:20 [DEBUG] PUT /photo
2011-03-09 20:18:23 [DEBUG] PUT /photo
2011-03-09 20:18:26 [DEBUG] PUT /photo
2011-03-09 20:18:29 [DEBUG] PUT /photo
2011-03-09 20:18:32 [DEBUG] PUT /photo
2011-03-09 20:18:35 [DEBUG] PUT /photo

Not entirely sure where to go from here. Any tips would be tremendously appreciated. Thanks!

Regards,
Campbell Krueger

does not seem to work with iphone youtube.app

was fully working yesterday. only aspect changed was an update to the iphone's remote.app, now there are no airplay icons when playing youtube videos on the iphone.

content from iphone's photos seems to work, so does playing video's directly from my iMac's itunes when playing videos.

Video Mirroring

Hi, not really an issue, this is a feature request.

Would it be possible to enable video mirroring via iOS5 & iPad/iPhone4S

Many thanks.

Playing as an audio output.

This works great. I've been able to use it as a video player. However, is it possible to set this as an audio output for playing music in iTunes?

IOError: [Errno 2] No such file or directory: 'requirements.txt

Hi all, I am kinda new to all of this so dont hate me for being a noob!

I was trying to install Airplayer on my Ubuntu system with XBMClive 10.1, on the pip install -r requirements.txt I get the following error:

xbmc@XBMCLive:~$ pip install -r requirements.txt
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.6/dist-packages/pip.py", line 252, in main
self.run(options, args)
File "/usr/lib/python2.6/dist-packages/pip.py", line 406, in run
for req in parse_requirements(filename, finder=finder):
File "/usr/lib/python2.6/dist-packages/pip.py", line 3268, in parse_requirements
filename, content = get_file_content(filename, comes_from=comes_from)
File "/usr/lib/python2.6/dist-packages/pip.py", line 3259, in get_file_content
f = open(url)
IOError: [Errno 2] No such file or directory: 'requirements.txt'

Storing complete log in ./pip-log.txt

Could someone help me out?

Portrait photos created on an iPhone are shown in landscape

Photos that are shot on my iPhone are shown in landscape by Airplayer on XBMC. Portrait photos that were shot by a real camera and synced to my iPhone are shown correctly however. Perhaps this is something that should be fixed in XBMC (reading EXIF data to determine orientation) or is it possible to fix in Airplayer?

Orientation of Videos incorrect

I have just updated to the iOS4.3 version but when I playback videos in the 'Photos' app they work but in some circumstances are displayed in the wrong orientation.

  • Videos that have been recorded using iphone camera are displayed (incorrectly) in landscape. They display correctly on the iphone
  • I also have videos in the Photos app that have been edited with iMovie and these display correctly i.e. portrait
  • Photos and everything else seems to work fine

I am using this with Ubuntu and XBMC

Thanks for your help!

3rd Party Apps Not Working

Firstly i'd like to say how great this project is. Airplay support to mac devices is something that apple should have included from the beginning.

Since they didn't I'm glad someone has taken the initiative.

Airplayer works great for apple's built in apps such as youtube, but I am having trouble streaming video from 60 minutes app. I think this may have to do with the streaming video format utilized by some third party apps. I believe it is .m3u8? Basically the problem is that on the device when I click airplay, the machine running Airplayer doesn't show up in the list of choices.

Exception upon playback? (FIXED)

Hey folks, not sure if this is the right place to put this, but ever since I upgraded my XBMC box to Natty I've been unable to play anything via Airplayer. Trying to start a video results in "Unable to play video on xbmc-livingroom" on the iPhone, and the following string of exceptions on the terminal:

ERROR:root:Exception in I/O handler for fd 13 Traceback (most recent call last): File "/usr/lib/pymodules/python2.7/tornado/ioloop.py", line 252, in start self._handlers[fd](fd, events) File "/usr/lib/pymodules/python2.7/tornado/iostream.py", line 144, in _handle_events self._handle_read() File "/usr/lib/pymodules/python2.7/tornado/iostream.py", line 210, in _handle_read self._consume(loc + delimiter_len)) File "/usr/lib/pymodules/python2.7/tornado/iostream.py", line 165, in _run_callback callback(_args, *_kwargs) File "/usr/lib/pymodules/python2.7/tornado/httpserver.py", line 292, in _on_headers self.stream.read_bytes(content_length, self._on_request_body) File "/usr/lib/pymodules/python2.7/tornado/iostream.py", line 95, in read_bytes callback(self._consume(num_bytes)) File "/usr/lib/pymodules/python2.7/tornado/httpserver.py", line 314, in _on_request_body self.request_callback(self._request) File "/usr/lib/pymodules/python2.7/tornado/web.py", line 1078, in __call__ handler = spec.handler_class(self, request, **spec.kwargs) TypeError: **init**() got an unexpected keyword argument 'media_backend'

Any suggestions? I'm not proficient in Python, but it looks like the Tornado web server is flaking out for some reason. I should note that the XBMC web interfaces all appear to be working normally.

*** EDIT ***
Found the problem; I had to recompile and reinstall Tornado. For some reason it looks like the upgrade broke it. I'll leave this here in case any of your other users have the problem. Keep up the incredible work!

Thanks!

Greg Lindsey

Screen is dimmed during viewing photos

When viewing photos on XBMC from my iPhone or iPad the screens dims after a while. Moving to a different photo still works, but the screen stays dimmed. Perhaps it is possible to wake up the screen every time a new photo is being send to Airplayer.

No Connection iOS 4.3.3

On iOS 4.3.3 devices I cannot connect to airplayer anymore. In debug mode I get no output when initiating the connection. On the device I get "could not connect" error alert.

Ubuntu init script will not start if a different python daemon is already running

The Ubuntu init script will not start if a different python daemon is already running

root@revo:/usr/local/bin/airplayer# /etc/init.d/airplayer start
Starting airplayer: /usr/bin/python already running.
airplayer

The solution is to make airplayer.py executable and change COMMAND in the init script to just

COMMAND="$DAEMON"

Can't get it working

htpc-den@htpc-den:~/Desktop/PascalW-Airplayer-7776e54/airplayer$ python airplayer.py
2011-10-17 20:15:09 [INFO] Starting Airplayer
2011-10-17 20:15:09 [DEBUG] TEMP DIR: /tmp/tmpm8Uu7N
2011-10-17 20:15:09 [DEBUG] Sending wake event
2011-10-17 20:15:10 [DEBUG] Registered bonjour service htpc-den._airplay._tcp.

Running from Ubuntu with Boxee installed on it.

My settings.py are set to Boxee, port 8800, even tried putting my Boxee username/pass into the places for user and pass (tried None/None and 'user'/'pass', neither worked)

Tried port-forwarding both 6002 (airplayer) and 8800 (boxee) to no luck.

When I run python airplayer.py, it does the above quoted text, the AirPlay button shows on my iPhone, I press it, select htpc-den, then nothing happens. No more info in the terminal from the debug being set to true...no picture/video/music in Boxee.

Not sure what I'm doing wrong here...

Python2.6 on AppleTV (1) Crystalbuntu image

I can't find how to install python 2.6 on the famous (?) pin78a or Sam image (from xbmc.org forums) for Ubuntu Hardy 8.04 on Apple TV 1. This runs xbmc live on this ubuntu, but the latest available python is 2.5.2

//
xbmc@atvlinux01:$ sudo apt-get install python
Reading package lists... Done
Building dependency tree
Reading state information... Done
python is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 49 not upgraded.
xbmc@atvlinux01:
$ python --version
Python 2.5.2
//

Image

Hi, first wonderfull :)
Wanted to give it a try, but as ever, someone has done it faster and better !

Just a thing, with the version from today 12:41 and xbmc 2:10.00~svn34731-lucid1 i cannot play pictures (black screen) and the video always starts from the beginning and i cannot navigate, is it normal ?

Thanks !

Not reaaly starting?

After some struggling with the scripts I believe I managed to turn this thing on... But then again not. When I run the Python script it says Airvideo is starting and on screen it says the same. However, when I select a video on my iPad and use AirPlay to transfer it to XBMC, the screen says it does so but the video won't play, it kinda just freezes and nothing shows up in my tv. I can not play the video properly until I switch AirPlay back to the iPad.

Is this a known problem?

Uses the old 4-clause BSD license, GPL-incompatible

Airplayer uses the old 4-clause BSD license, with the attribution clause. This makes it incompatible with GPLed software, making it impossible to write GPLed backends for Airplayer. Please consider switching to either the newer 3-clause BSD license or the MIT license.

Can't work in on iPhone5

On iPhone 5, iOS 6,the video Can't found AirPlaly Divecs.
But on iPad mini, iOS6, worked OK.

Audio

Hey

This is a cool project! Whats the deal with audio streaming though? What needs to be done to get that to work. I'm keen to help.

Hit me up

Adam

Proposing a PR to fix a few small typos

Issue Type

[x] Bug (Typo)

Steps to Replicate and Expected Behaviour

  • Examine airplayer/mediabackends/Plex_media_backend.py, airplayer/mediabackends/XBMC_media_backend.py and observe seperate, however expect to see separate.
  • Examine airplayer/mediabackends/base_media_backend.py and observe wether, however expect to see whether.

Notes

Semi-automated issue generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md

To avoid wasting CI processing resources a branch with the fix has been
prepared but a pull request has not yet been created. A pull request fixing
the issue can be prepared from the link below, feel free to create it or
request @timgates42 create the PR. Alternatively if the fix is undesired please
close the issue with a small comment about the reasoning.

https://github.com/timgates42/Airplayer/pull/new/bugfix_typos

Thanks.

Issues with start position / seeking

Hi there

I've been using Airplayer now for a couple of days. Really nice work!

I'm running into an issue though - when I start playing a video on XBMC, it always starts from the beginning. Likewise, when I move playback back to my iThing, it resumes at the last position played on the iThing (as in... not the position that was last played in XBMC).

I can see that the JSON-RPC calls are failing with 'Unable to parse' in the XBMC log:

22:34:06 T:3055549296 M:1410707456 ERROR: JSONRPC: Failed to parse '{
"id" : "uo9i98t3",
"jsonrpc" : "2.0",
"method" : "VideoPlayer.SeekTime",
"params" : 11
}
'
I changed the method field so that it matched the casing given in the spec, but it didn't help the issue... So the original videoplayer.seektime / seekpercentage calls failed in the same way. Any idea what might be going on here? I'm using an XBMC build from the pvr-testing branch from the source maintained by Lars Opdenkamp...

Cheers
/drdaz

show_picture not working in IOS 5

First of all - awesome tool!

I have no experience with previous versions of Airplay, but my IOS 5 client had some strange behavior with pictures. Photos would show, but would erratically display the prior photo, or the next one in the sequence, and sometimes would get stuck. It turns out that there is some new logic with caching directives:

  1. At first you'll get 3 calls - I'll paste in the headers which will help explain:

{'X-Apple-Session-Id': 'b108f96e-bdcd-4935-8fb2-3103be84853a', 'Content-Length': '159460', 'X-Apple-Assetkey': '857DDE75-1986-4D44-A9A1-2935903CE1FF', 'User-Agent': 'MediaControl/1.0'}
{'X-Apple-Session-Id': 'b108f96e-bdcd-4935-8fb2-3103be84853a', 'Content-Length': '196144', 'User-Agent': 'MediaControl/1.0', 'X-Apple-Assetaction': 'cacheOnly', 'X-Apple-Assetkey': '2065D39A-8DFD-4C41-B0A1-CEF928B7D56E'}
{'X-Apple-Session-Id': 'b108f96e-bdcd-4935-8fb2-3103be84853a', 'Content-Length': '101450', 'User-Agent': 'MediaControl/1.0', 'X-Apple-Assetaction': 'cacheOnly', 'X-Apple-Assetkey': 'DECAC583-F80A-4A38-B926-57ED78266E6F'}

You can see that the first is "this" photo, and the other two are the prior and next pictures in the album which are sent as a pre-cache (cacheOnly). In the current airplay, all three of these are loaded in a non-deterministic and non-thread-safe order which explains the erratic behavior.

  1. Subsequent calls may look like:

    {'X-Apple-Session-Id': 'b108f96e-bdcd-4935-8fb2-3103be84853a', 'Content-Length': '0', 'X-Apple-Assetkey': '2065D39A-8DFD-4C41-B0A1-CEF928B7D56E', 'User-Agent': 'MediaControl/1.0', 'X-Apple-Assetaction': 'displayCached', 'X-Apple-Transition': 'Dissolve'}
    {'X-Apple-Session-Id': 'b108f96e-bdcd-4935-8fb2-3103be84853a', 'Content-Length': '182319', 'X-Apple-Assetkey': 'F1F713A7-A8FC-4707-900D-0E1056E0E323', 'User-Agent': 'MediaControl/1.0', 'X-Apple-Assetaction': 'cacheOnly', 'X-Apple-Transition': 'Dissolve'}

Note two things:
a. The content-length of the first one is 0, and it's X-Apple-Assetaction is 'displayCached' - with the reference to the AssetKey and Session from the first exchange.
b. The second entry is caching the next picture with an actual payload, and, again, cacheOnly.

I have a patch which solves this by separating the caching from the showing, caching in a "session" directory, and generally trying to clean up after itself when the session ends. I have no way of testing on a non-IOS 5 Beta4 client, nor do I know how this will behave on any other target beyond XBMC (though it looks like Boxee/Plex don't implement pictures anyhow)

Mac OSX Launchd Script

The Python script works great, but I am having trouble getting the launchd script to start the service. I am using OSX 10.6.6 and Python 2.7.1. Is there anything I may be missing?

Thanks!

Problem with Justin.TV

Hi,

I tried to use the airplayer functionality with the JustinTV app on my IPhone. It doesn't work, it looks like it is because the video is streamed so there isn't any real "start time". I guess there should be the same problem for any video streamed to the iThing.

2011-07-02 10:31:42 [WARNING] Failed to set start position
WARNING:airplayer:Failed to set start position

[Errno 3] invalid value for ai_flags.

hi.
I've tried to setup Airplayer on a dreambox, using the vlc 3rdpartybackend.
when i try to start airplay, I just get:

python airplayer.py

2011-07-04 00:25:59 [INFO] Starting Airplayer
2011-07-04 00:25:59 [DEBUG] TEMP DIR: /tmp/tmpedBiFa
Started connection to VLC
Traceback (most recent call last):
File "airplayer.py", line 221, in
main()
File "airplayer.py", line 217, in main
raise e
socket.gaierror: [Errno 3] invalid value for ai_flags.

do you have any hints?
thanks in advance

Can't connect to XBMC

Having an issue where AirPlayer can't connect to XBMC.

I've tried using a username/password and without using one. I can connect to XBMC using my web browser just fine, and both my iPhones pick it up XBMC as an airplay device (audio only).

Specifically, I've got this: [WARNING] Couldn't connect to XBMC at 127.0.0.1:8080, are you sure it's running?

Yes, I'm sure it's running. I can connect via the web browser and two iPhones, so it's definitely there.

Any hints on what to do?

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.