I want to stream my application on APPLE TV using AirPlay API.? How to use that? Can it work through iPhone and iPad both? If yesy please share some doc regarding or demo for the same
Asked
Active
Viewed 3,293 times
1 Answers
4
You can implement support for external displays very easily. Here is one blog post about it by Matt Gemmell: http://mattgemmell.com/2010/06/01/ipad-vga-output/
If the user enables AirPlay (by clicking the home button twice and then swiping left to reveal the AirPlay shortcut) with an Apple TV, your app will detect one additional screen, the Apple TV. You can then use the API described in the blog post above to stream your app's view to the Apple TV.
There is no way I know of to add an AirPlay button directly in your app, though.

Fabian Kreiser
- 8,307
- 1
- 34
- 60
-
But I want to call AirPlay API property on my app i.e. allowsairplay option. On the above blog code they didnt call Airplay option anywhere.Please help me on that prespective. – Nishi Aug 29 '12 at 08:47
-
Well, that's a property on MPMoviePlayerController. I thought you want to stream your app (your app's view) to the Apple TV and not just a video? – Fabian Kreiser Aug 29 '12 at 09:06
-
Yes. Now where we have to call MPMoviePlayerController class on delegate? Because have to show the whole app. Yet I am defining MPMoviePlayerController code on delegate on didFinishLaunchOption am I right? and also please share the code so that I can cross check with mine – Nishi Aug 29 '12 at 09:24
-
1I think you're misunderstanding something here. MPMoviePlayerController is for playing a video file only. If you want to mirror your app (not a video, the table views, etc.) to an Apple TV, the user has to enable AirPlay mirroring. If you want to display your app in an external display (TV) over AirPlay, you'll have to use the API described in the blog post. – Fabian Kreiser Aug 29 '12 at 09:45
-
and also if I am not writing above blog code on my project Did it affect while connecting to APPLE Tv as I want to connect only to Apple Tv for mirroring. – Nishi Aug 29 '12 at 11:02
-
-
If I wont call above blog api Did it affect while connecting to APPLE TV. – Nishi Aug 29 '12 at 12:16
-
If you don't implement support for external displays, it won't work, obviously. The user can still mirror your app to the Apple TV, though. – Fabian Kreiser Aug 29 '12 at 14:49
-
let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/16000/discussion-between-nishi-and-fabian-kreiser) – Nishi Aug 30 '12 at 05:18