AirPlay vs iOS API

This post should not be a big surprise. As you might have guessed I had other ideas with my AppleTV.

I think there’s a large, untapped potential in the AppleTV to be used with/from other devices. Collaboration, visualization and of course gaming (think of the Wii U) comes to mind. Sadly several pieces are missing for this to become reality :( Let’s try to add one of them…

If you played the iOS API for AirPlay you already know it does not really support pictures, i.e. what the (Apple supplied) Photo.app does is not available to developers. In particular:

  • The device selector (available thru MPVolumeView) shows every AirPlay devices, including AirExpress for speakers. Photo.app somehow filters them since they can’t show pictures;
  • It does not allow you to provide what’s to be shown on the AppleTV, that must be done with the MPVolumeView which is not picture friendly;
  • The closest you can get is screen mirroring (only on recent iOS devices) and that’s not quite the same since your (iOS device) screen is not available to other uses.

Note: I know private API exists to do this but, like the jailbreaking, I do not want my app to depend on them.

Like I showed before using .NET to show pictures to an AppleTV is quite simple. What’s needed is a UI for this…

And here’s come Poupou.AirPlay assembly that provides browsing AirPlay devices and sending pictures to them. It works on any iPad and iPhone/iPod Touch (at least everything running iOS5, I did not test earlier versions – feedback appreciated).

To select a AirPlay device the code uses UIActivity, available in iOS 6 (and later).

airpic-iphone-60iOS 6.0 screenshot

But it’s easy to support earlier iOS releases with a bit of extra code. The sample application shows you how to do that.

airpic-iphone-51iOS 5.1 screenshot

About these ads

About spouliot

Xamarin Hacker, Mono Contributor, Open Source Enthusiast with strong interests in Code Analysis, Cryptography and Security. Presently working on MonoTouch, previous projects were Moonlight and libgdiplus and a lot of the cryptographic work done on Mono.
This entry was posted in airplay, appletv, mono, monotouch, xamarin. Bookmark the permalink.

3 Responses to AirPlay vs iOS API

  1. Pingback: Graphics vs Resolution Independance | take a bit, get a byte

  2. Does this install some handler that allows people to share their pictures to their Apple TV by invoking your app?

    Or where does the “TV” icon come from?

    • spouliot says:

      It’s UIActivity-based (iOS6) but that’s limited to the application that includes it (not cross process).

      So the application includes (for itself) an UIActivity-derived type that handles “UIImage to AirPlay”. The “tv” icon comes from the customization of that new UIActivity type

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s