1

Original Question

I have a MPVolumeView added to a custom view as

_airplayButton = [[MPVolumeView alloc] init];
[_airplayButton setShowsVolumeSlider:NO];
[self addSubview:_airplayButton];

I don't have a real device to test but when on iOS simulator the button doesn't appear. I have more than one Apple TV connected on my network. Is it because the simulator doesn't support AirPlay?

I tried adding external display on the simulator and still the view seems to be hidden.

UPDATE

I tried adding the external display and on the control centre AirPlay wasn't activated. Is there something else I need to do to get AirPlay activated on simulator other than adding an external display?

Vig
  • 1,532
  • 1
  • 12
  • 28
  • 1
    You can find the answer here : http://stackoverflow.com/a/19283672/1734690 hope that helps. – Sivakumar Punniyakotti Mar 24 '15 at 05:15
  • Thanks I indeed tried that as well. But the MPVolumeView wasn't added. I am trying out few other demo apps as well and have the same issue. I think I did everything right in terms of making sure an external output is added. – Vig Mar 24 '15 at 13:33

1 Answers1

3

AirPlay is not supported in the iOS Simulator. The closest thing you can do is enable an extended display (eg: a 720p TV). That is not going to be the same experience as AirPlay but may get you what you need.

There are also various bugs with the media player and extended display, so if you can't get it working in the sim, I'd recommend testing on device before concluding that there's something wrong with your app.

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
  • So MPVolumeView will always be hidden on simulator? – Vig Mar 24 '15 at 21:15
  • 1
    I'm just saying that there are a bunch of bugs in the simulator in that particular area, so it might not be a problem with your app. I'm not sure if MPVolumeView in particular is affected. I suggest you test on device. – Jeremy Huddleston Sequoia Mar 24 '15 at 21:16
  • Looks like the MPVolumeView won't work for external displays. It did work on an actual device. – Vig Apr 07 '15 at 15:15
  • External displays (in iOS simulator) don't show up at all from `AVRoutePickerView`s. – Jonny Jun 27 '18 at 07:19