airplay in simulator - objective-c

2019-01-26 15:12发布

问题:

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.

回答1:

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.



回答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.