6

I've set "allowsAirPlay" to "YES" in my MPMoviePlayerController, but AirPlay button doesn't appear. Does iOS simulator support AirPlay? And give please some example how to stream video through Apple TV for example.

Timur Mustafaev
  • 4,869
  • 9
  • 63
  • 109
  • I think the simulator supports AirPlay. Is there an active (i.e. turned on) AirPlay capable device nearby? The Airplay button only appears when a device is available for AirPlay. – Frank Sep 15 '11 at 08:44
  • There are no devices nearby, i thought it will show video in my MacBook in new window, something like AirPlay simulator :) – Timur Mustafaev Sep 15 '11 at 10:23
  • Maybe have a look at this http://www.stuffunwired.com/2011/05/airserver-turns-your-mac-to-receiver.html – Frank Sep 15 '11 at 10:37
  • Hi, am late here. But how does that work? I have tried set the player to allow airplay and set tv out as mentioned above, but the screen is always black and isAllowAirpplay is returning 0. Thanks in advance. – Unheilig Jul 03 '14 at 19:01

2 Answers2

6

Nope, at the time of writing (iOS 7 just released) simulators don't have airplay nor any way to simulate or test it. Having an airplay capable device (apple TV) or program (http://www.airsquirrels.com/reflector/) in the same wifi network makes the mirroring button appear on my iPhone 4S but not on any simulator.

Edit: There is a way of testing it, simulate TV output. enter image description here

txulu
  • 1,602
  • 16
  • 26
  • @EgeAkpinar Hi, am late here. But how does that work? I have tried set the player to allow airplay and set tv out as mentioned above, but the screen is always black and isAllowAirpplay is returning 0. Thanks in advance. – Unheilig Jul 03 '14 at 19:01
  • @Unheilig I've been testing Airplay without problem (haven't tried mirroring though). You can find my code at https://gist.github.com/creatd/86214a662903465008a0 – Ege Akpinar Jul 05 '14 at 09:32
  • @EgeAkpinar Much appreciated, but could you show me how to set up the player as a gist as well? Again, many thanks for help in advance. – Unheilig Jul 05 '14 at 09:49
  • I wasn't using a player (I'm assuming you mean a MPMoviePlayerController) it's very straightforward though. Just initialise it with contents of your movie file, set its view frame to something and add the view as a subview and it will show – Ege Akpinar Jul 06 '14 at 08:28
2

If you want to test your app in real environment without Apple TV or airplay enable speaker then you can test it through your any Mac machine or PC. You just need to download the app "Air Joy" from appstore.

1)Go to App Store

2)Download AirJoy application

OR

AirJoy

But before that make sure that your mac machine(Airjoy installed) and your device is in same network.

I have already tested the Airplay option with the above explanation.

Hiren
  • 12,720
  • 7
  • 52
  • 72